2016-07-04 1 views
0

numpy를 설치하면 이미 최신 버전이며 pip list에 의해 반환 된 목록에 표시되지만 가져 오기를 수행하면 가져 오기 오류가 발생합니다 (이 문제는 설치된 다른 모든 모듈 (예 : scipy)에 있습니다. , matplotlib).설치된 패키지에 대한 Python ImportError

시스템에 문제가 있으며이를 해결하는 방법은 무엇입니까? 편집

[email protected]:~$ pip list 
adium-theme-ubuntu (0.3.4) 
cycler (0.9.0) 
decorator (4.0.6) 
matplotlib (1.5.1) 
numpy (1.11.0) 
Pillow (3.1.2) 
pip (8.1.1) 
pyeemd (1.3.1) 
pyparsing (2.0.3) 
python-dateutil (2.4.2) 
pytz (2014.10) 
scipy (0.17.0) 
setuptools (20.7.0) 
six (1.10.0) 
unity-lens-photos (1.0) 
wheel (0.29.0) 
[email protected]:~$ python 
Python 2.7.11 (default, May 28 2016, 17:16:00) 
[GCC 5.3.1 20160413] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named numpy 
>>> quit() 
[email protected]:~$ sudo apt-get install python-numpy 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
python-numpy is already the newest version (1:1.11.0-1ubuntu1). 
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded. 
[email protected]:~$ 

: 나는 (내가 python3 전에 만진 적이 없었다) 작업 수입을 얻기 위해 내 우분투 시스템에 python3에 대한 pip3을 사용했는데, 다시

인, 위와 똑같은 결과를 얻을 수
[email protected]:~$ pip3 install numpy 
Collecting numpy 
    Downloading numpy-1.11.1-cp35-cp35m-manylinux1_x86_64.whl (15.6MB) 
    100% |████████████████████████████████| 15.6MB 57kB/s 
Installing collected packages: numpy 
Successfully installed numpy 
You are using pip version 8.1.1, however version 8.1.2 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 
[email protected]y:~$ python 
Python 2.7.11 (default, May 28 2016, 17:16:00) 
[GCC 5.3.1 20160413] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named numpy 
>>> quit() 
[email protected]:~$ pip3 list 
apturl (0.5.2) 
beautifulsoup4 (4.4.1) 
blinker (1.3) 
Brlapi (0.6.4) 
chardet (2.3.0) 
checkbox-support (0.22) 
command-not-found (0.3) 
cryptography (1.2.3) 
defer (1.0.6) 
feedparser (5.1.3) 
guacamole (0.9.2) 
html5lib (0.999) 
httplib2 (0.9.1) 
idna (2.0) 
Jinja2 (2.8) 
language-selector (0.1) 
louis (2.6.4) 
lxml (3.5.0) 
Mako (1.0.3) 
MarkupSafe (0.23) 
numpy (1.11.1) 
oauthlib (1.0.3) 
onboard (1.2.0) 
padme (1.1.1) 
pexpect (4.0.1) 
Pillow (3.1.2) 
pip (8.1.1) 
plainbox (0.25) 
ptyprocess (0.5) 
pyasn1 (0.1.9) 
pycups (1.9.73) 
pycurl (7.43.0) 
pygobject (3.20.0) 
PyJWT (1.3.0) 
pyparsing (2.0.3) 
python-apt (1.1.0b1) 
python-debian (0.1.27) 
python-systemd (231) 
pyxdg (0.25) 
reportlab (3.3.0) 
requests (2.9.1) 
sessioninstaller (0.0.0) 
setuptools (20.7.0) 
six (1.10.0) 
system-service (0.3) 
ubuntu-drivers-common (0.0.0) 
ufw (0.35) 
unattended-upgrades (0.1) 
unity-scope-calculator (0.1) 
unity-scope-chromiumbookmarks (0.1) 
unity-scope-colourlovers (0.1) 
unity-scope-devhelp (0.1) 
unity-scope-firefoxbookmarks (0.1) 
unity-scope-gdrive (0.7) 
unity-scope-manpages (0.1) 
unity-scope-openclipart (0.1) 
unity-scope-texdoc (0.1) 
unity-scope-tomboy (0.1) 
unity-scope-virtualbox (0.1) 
unity-scope-yelp (0.1) 
unity-scope-zotero (0.1) 
urllib3 (1.13.1) 
usb-creator (0.3.0) 
wheel (0.29.0) 
xdiagnose (3.8.4) 
xkit (0.0.0) 
XlsxWriter (0.7.3) 
You are using pip version 8.1.1, however version 8.1.2 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 
[email protected]:~$ 
+0

패키지를 설치하는 데 사용한 것과 같은 이름으로 패키지를 가져올 필요는 없습니다. 하지만 이것은 numpy의 경우가 아니므로 질문에 numpy라는 태그를 추가 할 수 있습니다. 'sudo apt-get python-numpy'를 실행하고 pip로 설치하십시오. ('pip install numpy') – CodenameLambda

+0

@CodingLambdas 실제로, pip install이 시스템에이 이상한 오류를 던졌습니다. "TypeError : - = : 'Retry'와 'int'에 대해 지원되지 않는 피연산자 유형 전,하지만 아무것도 얻을 수 없었다! – devautor

+0

핍의 설치가 많이 손상된 것 같습니다 ... 핍을 다시 설치하려고 했습니까? 그리고 이것이 작동하지 않는다면 파이썬을 다시 설치하려고 했습니까? 또 다른 가능한 문제 : python2의 pip를 사용하고 python3 또는 다른 방법을 사용하고 있습니까? – CodenameLambda

답변

0

python3.5. *에는 numpy를 설치했지만 python2.7.11에서는이 파일을 가져옵니다. 그렇지 않니? 이름으로

[email protected]:~$ pip3 install numpy 
Collecting numpy 
    Downloading numpy-1.11.1-cp35-cp35m-manylinux1_x86_64.whl (15.6MB) 
    100% |████████████████████████████████| 15.6MB 57kB/s 
Installing collected packages: numpy 
Successfully installed numpy 

"cp35"는 "NumPy와-1.11.1-cp35-cp35m-manylinux1_x86_64.whl"는 python3.5를 위해 뜻. *.

[email protected]:~$ python 
Python 2.7.11 (default, May 28 2016, 17:16:00) 
[GCC 5.3.1 20160413] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named numpy 

여기에서 "python"을 입력 한 다음 python3.7. *이 아닌 python2.7.11을 엽니 다. python3.5. *의 설치 디렉토리에 "cd"를 입력하고 "python3.5.exe"를 입력하십시오. 도움을 받으시겠습니까?