virtualenv虚拟环境中安装MarkupSafe后报错

其中:lianxi目录为我已下载好各类的离线库包(按自己的使用需要去下载),ceshi2.txt是我本次想要安装的库列表,例:MarkupSafe==1.1.1

(2env) [root@xxxxx]$ pip install --no-index --find-links=lianxi -r ./ceshi2.txt --target=2env/lib/python2.7/site-packages
Ignoring indexes: https://pypi.python.org/simple
Collecting MarkupSafe==1.1.1 (from -r ./ceshi2.txt (line 1))
Installing collected packages: MarkupSafe
Successfully installed MarkupSafe
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 366, in run
for item in os.listdir(lib_dir):
OSError: [Errno 2] No such file or directory: '/tmp/tmp1DRK7_/lib/python

解决办法:
使用安装命令:pip install --no-index --find-links=lianxi -r ./ceshi2.txt

posted @ 2020-07-01 18:38  天地一体  阅读(312)  评论(0编辑  收藏  举报