python中找不到模块_在我的python中找不到模块

1586010002-jmsa.png

I tried to read all the issues concerning the python's error

ImportError: No module named

I reinstalled all the modules I need using

sudo apt-get install build-essential python-dev python-setuptools python-numpy python-scipy libatlas-dev libatlas3gf-base

I also upgraded using pip

sudo pip install --upgrade numpy

sudo pip install --upgrade scipy

When runing pip list I get

matplotlib (1.3.1)

scipy (0.17.0)

numpy (1.11.0)

But here is the execution result :

>>> import matplotlib

Traceback (most recent call last):

File "", line 1, in

ImportError: No module named matplotlib

>>> import numpy

Traceback (most recent call last):

File "", line 1, in

File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in

from . import add_newdocs

File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in

from numpy.lib import add_newdoc

File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in

from .type_check import *

File "/usr/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in

import numpy.core.numeric as _nx

File "/usr/lib/python2.7/dist-packages/numpy/core/__init__.py", line 6, in

from . import multiarray

ImportError: /usr/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS4_AsUnicodeEscapeString

I don't know what's happening! please help!!

OS ubuntu14.04

NEW EDIT

So some news: I checked out the install of python and I found different versions in different places. In the python2.7 case I have :

/usr/bin/python2.7

/usr/local/bin/pyton2.7

While using which I get

which python

/usr/local/bin/python

But the /usr/bin/python2.7 works really fine

cd /usr/bin

./python2.7

Python 2.7.6 (default, Jun 22 2015, 17:58:13)

[GCC 4.8.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import scipy

>>> import numpy

>>> import matplotlib

>>>

Thanks

解决方案

Install matplotlib like this if pip3 install didn't work for you

sudo apt-get install python3-matplotlib

Note - before doing check inside site-packages are present or not locate python using

which python

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值