Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Manually installing modules with python3.9

My usual workflow for manually installing python modules doesn’t work since I upgraded to python3.9 on my mac. Suppose I want to install a custom module called "myfiles" from the setup script, I do

cd myfiles
python3 setup.py install --user

The output contains the line

Extracting myfiles-1.6.1-py3.9.egg to /Users/antonius/Library/Python/3.9/lib/python3.9/site-packages

When I inspect the content of sys.path, I see the directory

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

/Users/antonius/Library/Python/3.9/lib/python/site-packages

as well as all other directories under it. However, the directory

/Users/antonius/Library/Python/3.9/lib/python3.9/site-packages

does not appear in the list of paths. Even if I edit my ~/.zshrc to include the line

export PYTHONPATH="/Users/antonius/Library/Python/3.9/lib/python3.9/site-packages:$PYTHONPATH"

then the list of paths contains this directory, but does not contain any of the directories under it, so I cannot import my module.

What is going on? How do I tell python to expand the list of paths from the content of the site-packages/ directory? Even then, it doesn’t seem right that I need to add that path in my ~/.zshrc.

Btw, the content of my ~/.pydistutils.cfg file is just

[install]
prefix=

>Solution :

Use pip. pip install --user . will do the same thing. setup.py is deprecated.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading