how to install python module without pip after we download the module to local folder

耗尽温柔 提交于 2021-01-29 12:56:15

问题


we can download the module - requests , as the following

cd /home/module/
pip download requests
ls -l
certifi-2019.9.11-py2.py3-none-any.whl  chardet-3.0.4-py2.py3-none-any.whl  idna-2.8-py2.py3-none-any.whl  requests-2.22.0-py2.py3-none-any.whl  urllib3-1.25.6-py2.py3-none-any.whl

now we can easily to install the module as

pip install *.whl

we can check it by

python -c "import requests"

now - since on some Linux redhat machines we not have pip ( we cant install pip because security reasons )

so we want to install the module without pip

we try

 easy_install --install-dir=/home/module/*

but we get errors , maybe I not use it right ,

so can we get advice how to install the requests module without pip from local folder ?


回答1:


You could install the module from source:

foo@bar:~/$ git clone https://github.com/psf/requests.git
foo@bar:~/$ cd requests
foo@bar:~/requests$ git checkout v2.22.0
foo@bar:~/requests$ python setup.py install


来源:https://stackoverflow.com/questions/58438767/how-to-install-python-module-without-pip-after-we-download-the-module-to-local-f

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