为什么虚拟环境pip install 只能安装在真实环境中 而且没法卸载干净? 40C

经过pip3 uninstall mpl_finance, 重启VMware后再操作:

(dm) python@ubuntu:~$ sudo -H pip3 install mpl_finance


Requirement already satisfied: matplotlib in /usr/local/lib/python3.6/dist-packages (from mpl_finance)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->mpl_finance)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->mpl_finance)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->mpl_finance)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->mpl_finance)
Requirement already satisfied: numpy>=1.11 in /usr/local/lib/python3.6/dist-packages (from matplotlib->mpl_finance)
Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from cycler>=0.10->matplotlib->mpl_finance)
Installing collected packages: mpl-finance
Successfully installed mpl-finance-0.10.1


成功后找不到 mpl_finance

(dm) python@ubuntu:~$ pip3 freeze
attrs==19.3.0
.....
MarkupSafe==1.1.1
matplotlib==2.2.2
mistune==0.8.4
more-itertools==8.0.2

发现原来是安装在真实环境中

(dm) python@ubuntu:~$ deactivate
python@ubuntu:~$ pip3 freeze
apturl==0.5.2
。。。。。。
Mako==1.0.7
MarkupSafe==1.0
matplotlib==3.2.1
mitmproxy==2.0.2
mpl-finance==0.10.1

2个回答

这种奇怪的问题很可能是网络的原因,类似这个
https://blog.csdn.net/yagamil/article/details/72236538

weixin_43256057
weixin_43256057 已经解决了 https://blog.csdn.net/weixin_43256057/article/details/105357133
4 个月之前 回复
weixin_43256057
weixin_43256057 还是不行啊,各自尝试了,好沮丧
6 个月之前 回复

应该是系统的问题,PATH变量里默认是真实环境,你尝试用绝对路径运行pip3
注意到你这个路径/usr/local/lib/python3.6/dist-packages是在真实环境里的,问题应该就在这里
如果有效,望采纳

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐