40

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

经过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
查看全部
weixin_43256057
weixin_43256057
2020/04/02 19:06
  • python
  • virtualenv
  • 点赞
  • 收藏
  • 回答
    私信

2个回复