为什么在centOS下使用miniconda激活环境后使用pip导入环境后发现没有生效?

发布于 2022-09-11 18:51:01 字数 3256 浏览 12 评论 0

问题描述

在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缱倦旧时光 2022-09-18 18:51:01

找到原因了,发现跟命令和环境没有关系

补充日志:

THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    certifi==2016.2.28 from https://pypi.doubanio.com/packages/db/60/1ed0106bde7b14b363b15b17cc308aad93ba57d3582570f3ad7180ae0fae/certifi-2016.2.28-py2.py3-none-any.whl#md5=409448ee124f3159d912e4e155b034b0 (from -r requirements.txt (line 3)):
        Expected md5 409448ee124f3159d912e4e155b034b0
             Got        cf44bfe940b61be89ea6c82dc04f44e6

是更新时,校验值不一样导致的

解决方法:

requirements.txt文件中删除certifi==2016.2.28就可以了

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文