I have been using matplotlib
from python
and the spyder ide
to create some figures for a publication. It always worked but even after years of using linux the whole thing for me still is a black box.
Yesterday I tried to run another application and it was complaining that numpy
and cv2
were not installed (I don't know why as they were installed). I think I tried to upgrade those two packages by calling sudo pip install [package_name] --upgrade
. End of the story - nothing works.
At the moment my goal is just to get spyder running so that I can create figures again.
When I want to import scipy.io (
import scipy.io as sio`) I just get a bunch of errors.
runfile('/home/test/Desktop/python_test.py', wdir='/home/test/Desktop')
Traceback (most recent call last):
File "<ipython-input-1-83166c6df179>", line 1, in <module>
runfile('/home/test/Desktop/python_test.py', wdir='/home/test/Desktop')
File "/usr/lib/python2.7/dist-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "/usr/lib/python2.7/dist-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile
builtins.execfile(filename, *where)
File "/home/test/Desktop/python_test.py", line 1, in <module>
import scipy as sio # to import matlab files
File "/home/test/.local/lib/python2.7/site-packages/scipy/__init__.py", line 62, in <module>
from numpy import show_config as show_numpy_config
File "/home/test/.local/lib/python2.7/site-packages/numpy/__init__.py", line 140, in <module>
from . import _distributor_init
ImportError: cannot import name _distributor_init
What do I need to do to fix this?
Currently, I have the following setup:
Ubuntu 18.04.2 LTS
Spyder 3.2.6
test@test:~$ python --version
Python 2.7.15rc1
test@test:~$ pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
test@test:~$ pip install scipy
Collecting scipy ... Successfully installed numpy-1.16.2 scipy-1.2.1
test@test:~$ sudo apt-get install python-numpy python-scipy
python-numpy is already the newest version (1:1.13.3-2ubuntu1).
python-scipy is already the newest version (0.19.1-2ubuntu1).