为什么在centOS下使用miniconda激活环境后使用pip导入环境后发现没有生效?
问题描述
在centOS下使用miniconda激活环境中使用pip导入环境后发现没有生效
要安装的环境
astroid==2.1.0
backcall==0.1.0
certifi==2016.2.28
cffi==1.11.5
colorama==0.4.1
decorator==4.3.2
Django==1.11.14
django-multiselectfield==0.1.8
flake8==3.6.0
gevent==1.4.0
greenlet==0.4.15
ipython==7.3.0
ipython-genutils==0.2.0
isort==4.3.4
jedi==0.13.3
Jinja2==2.10
lazy-object-proxy==1.3.1
MarkupSafe==1.1.0
mccabe==0.6.1
parso==0.3.4
pickleshare==0.7.5
prompt-toolkit==2.0.9
pycodestyle==2.4.0
pycparser==2.19
pyflakes==2.0.0
Pygments==2.3.1
pylint==2.2.2
PyMySQL==0.9.3
pytz==2018.9
rope==0.11.0
six==1.12.0
tqdm==4.29.0
traitlets==4.3.2
typed-ast==1.1.1
wcwidth==0.1.7
wincertstore==0.2
wrapt==1.11.0
xlrd==1.2.0
yapf==0.25.0
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
(active_env) [root@localhost Crm_Project]# pip install -r ../requirements.txt
Looking in indexes: https://pypi.doubanio.com/simple
Requirement already satisfied: astroid==2.1.0 in /opt/env/envs/active_env/lib/python3.5/site-packages (from -r ../requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: backcall==0.1.0 in /opt/env/envs/active_env/lib/python3.5/site-packages (from -r ../requirements.txt (line 2)) (0.1.0)
Collecting certifi==2016.2.28 (from -r ../requirements.txt (line 3))
Downloading https://pypi.doubanio.com/packages/db/60/1ed0106bde7b14b363b15b17cc308aad93ba57d3582570f3ad7180ae0fae/certifi-2016.2.28-py2.py3-none-any.whl (366kB)
100% |████████████████████████████████| 368kB 373kB/s
Collecting pexpect; sys_platform != "win32" (from ipython==7.3.0->-r ../requirements.txt (line 12))
Downloading https://pypi.doubanio.com/packages/89/e6/b5a1de8b0cc4e07ca1b305a4fcc3f9806025c1b651ea302646341222f88b/pexpect-4.6.0-py2.py3-none-any.whl (57kB)
100% |████████████████████████████████| 61kB 453kB/s
Collecting ptyprocess>=0.5 (from pexpect; sys_platform != "win32"->ipython==7.3.0->-r ../requirements.txt (line 12))
Downloading https://pypi.doubanio.com/packages/d1/29/605c2cc68a9992d18dada28206eeada56ea4bd07a239669da41674648b6f/ptyprocess-0.6.0-py2.py3-none-any.whl
Installing collected packages: certifi, pycparser, cffi, colorama, decorator, pytz, Django, django-multiselectfield, pyflakes, mccabe, pycodestyle, flake8, greenlet, gevent, ipython-genutils, traitlets, Pygments, wcwidth, prompt-toolkit, parso, jedi, ptyprocess, pexpect, pickleshare, ipython, isort, MarkupSafe, Jinja2, pylint, PyMySQL, rope, tqdm, wincertstore, xlrd, yapf
Found existing installation: certifi 2018.8.24
Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
你期待的结果是什么?实际看到的错误信息又是什么?
然后在使用pip list 查看安装的环境是时发现一个也没有安装成功
(active_env) [root@localhost Crm_Project]# pip list
Package Version
----------------- ---------
astroid 2.1.0
backcall 0.1.0
certifi 2018.8.24
lazy-object-proxy 1.3.1
pip 19.0.3
setuptools 40.2.0
six 1.12.0
typed-ast 1.1.1
wheel 0.31.1
wrapt 1.11.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到原因了,发现跟命令和环境没有关系
补充日志:
是更新时,校验值不一样导致的
解决方法:
在
requirements.txt
文件中删除certifi==2016.2.28
就可以了