Python - manually install package using virtualenv

痞子三分冷 提交于 2019-11-29 18:45:42

I typically would extract the program to a temporary folder, then from that folder, run the setup.py using the direct path to the virtualenv python instance. eg if your virtualenv is in /home/username/virtualpy, use this (from your temporary folder)

/home/username/virtualpy/bin/python setup.py install

This should install it to your virtualenv site package folder.

well when you switch to the virtual environment. you should type

which python

and if it returns the path where your virtual environment exists then its okay you can directly run this command.

$ python setup.py build
$ python setup.py install

but if it gives the global level path which is not your virtualenv's path then you should try using

$ ~/.virtualenv/python-env/bin/python setup.py build
$ ~/.virtualenv/python-env/bin/python setup.py install

If a package won't install from repository, try under venv by use sudo. As example for python pathos package;

/venv3.6/bin$ sudo pip3 install pathos
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!