Reputation: 1589
I created a package (called PyLib) and now, I want to use its content from other script files. I use macOS Catalina and Spyder which came with the Anaconda distribution. I added the absolute path for my package to sys.path:
Next, I added an __init__.py
(which is empty) to the folder (and some content):
To verify if it works, I restarted the kernel (and Spyder, and macOS) but still my package is not recognized:
What did I forget to do? What can I do to make python recognize my package?
Upvotes: 0
Views: 60
Reputation: 1630
Try setting your sys.path value one directory higher to the directory that has PyLib in it instead of to PyLib itself.
Upvotes: 3