脾气暴躁:get-apt升级后python2.7的导入错误

时间:2018-08-26 18:13:32

标签: python python-2.7 pip ubuntu-16.04 conda

今天,我决定升级我的软件包:

sudo apt-get upgrade

在那之后,我尝试启动我的python2代码,并出现错误:

ImportError: No module named numpy

我尝试了pip install numpy,但收到了一条消息

Requirement already satisfied: numpy in /home/user/anaconda3/lib/python3.5/site-packages (1.15.1)

pip2 install numpy产生异常:

pkg_resources.VersionConflict: (pip 18.0 (/usr/local/lib/python3.5/dist-packages), Requirement.parse('pip==8.1.1'))

conda install numpy产生

# All requested packages already installed.

which python给了我

/home/user/anaconda3/bin/python

which pip产生

/home/user/anaconda3/bin/pip

可能是什么问题?似乎无法为python2安装numpy,因为它已经为python3安装了。我想,conda中的python2 vs python3链接出了什么问题? python,numpy,pip,conda或环境有问题吗?

0 个答案:

没有答案