0

Working on MacOS with Python 3.9. I am a very new with python.

I did create some Lib's that are specific to my needs and want them place at the right place so I could use them in my play, snippets, work and final folders. If I use

python3.9 -m site
sys.path
= [
    '/Volumes/Data/Users/LA',
    '/Library/Frameworks/Python.framework/Versions/3.9/lib/python39.zip',
    '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9',
    '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload',
    '/Volumes/Data/Users/LA/Library/Python/3.9/lib/python/site-packages', 
    '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages',
]

I get my python3.9 user_base and user_site folder and did place my Libs in there. Inside '/Volumes/Data/Users/LA/Library/Python/3.9/lib/python/site-packages'

However if I import them like I did when they where in the same folder as my application code I get the error that it can't be found.

What do I wrong? I did kill all the Python processes in the hope it will load everything, but after that everything is still the same. I can import when I use the old way, but using the user sitepackages folder it is not.

>>> import importlib
>>> import sys
>>> importlib.reload(sys.modules['myGenericLib'])


from myGenericLib import reload

and more doesn't work.

What could be the solution? Thank you

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
iPadawan
  • 898
  • 1
  • 12
  • 23
  • Probably it's an error with your project tree. Maybe duplicate of [this question](https://stackoverflow.com/questions/54598292/python-modulenotfounderror-when-trying-to-import-module-from-imported-package/54613085) – crissal Mar 14 '21 at 11:32
  • I did do this and again again. A NoGo. The only thing is that if I use the PYTHONPATH and add my path in there it works when I am in debug mode but not in the terminal. For now I did give up and created from where the modules are a softlink to the same folder where my main script lives. – iPadawan Mar 15 '21 at 16:39

0 Answers0