2

I am using Ubuntu 14.04 LTS, 64-bit. I downloaded Python3.5.1 Gzipped tarball source from https://www.python.org/downloads/release/python-351/.

Then installed using

./configure
sudo make install

Then I upgrade pip by

sudo pip install --upgrade pip

it upgraded pip to 8.1.2, which is the latest version. Then installed matplotlib package using

sudo pip install --upgrade matplotlib

Now, when I import matplotlib into python, I get

Python 3.5.1 (default, Jun  9 2016, 14:37:08) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/site-packages/matplotlib/pyplot.py", line 29, in <module>
import matplotlib.colorbar
File "/usr/local/lib/python3.5/site-packages/matplotlib/colorbar.py", line 32, in <module>
import matplotlib.artist as martist
File "/usr/local/lib/python3.5/site-packages/matplotlib/artist.py", line 14, in <module>
from .transforms import (Bbox, IdentityTransform, TransformedBbox,
File "/usr/local/lib/python3.5/site-packages/matplotlib/transforms.py", line 39, in <module>
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

Please advise on how to fix this?

2
  • Example location of libpython3.5m.so.1.0 in an Ubuntu package : /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 packages.ubuntu.com/xenial/amd64/libpython3.5/filelist ... i.e. may not be found in /usr/local/[hidden-location] , unless you point to it. - Jun 9, 2016 at 17:55
  • I just went to /usr/lib/x86_64-linux-gnu/, libpython3.5m.so.1.0 is not there Jun 9, 2016 at 18:06

2 Answers 2

0

Most people installed matlibplot through Anaconda or Canopy instead of installing it as an individual module. Usually if you have an error from _path, it means something wrong with your installation or compilation. _path is related to compiled c extentions. You can read the installation page of matlibplot. But the easiest way to fix it is to install Anaconda and you won't worry about a lot of things. Good luck!

3
  • I am aware of Anaconda but I am trying to use tensorflow0.9 which is not yet a conda package, I installed tensorflow0.9 using pip and I can't seem to use it with Anaconda. Hence, I installed Python3 and matplotlib individually, so I can use tensorflow with them. Jun 9, 2016 at 18:03
  • Ok, so I didn't realize that there is Pip included inside Anaconda as well... so I installed tensorflow0.9 using instructions tensorflow.org/versions/r0.9/get_started/… but also add --ignore-installed with pip command and it works with anaconda now... so I guess I don't have to worry about these import errors anymore Jun 9, 2016 at 18:16
  • Yes. This page will help you to manage packages in Anaconda. Jun 9, 2016 at 18:20
0

I ran into a similar issue. It's because my libpython binaries were installed to /usr/local/lib/ and the program was looking for libpython under /usr/lib/. Making a symbolic link in /usr/lib/ solved the problem:

sudo ln -s /usr/local/lib/libpython3.8.so.1.0 /usr/lib/libpython3.8.so.1.0

or, in your case,

sudo ln -s /usr/local/lib/libpython3.5m.so.1.0 /usr/lib/libpython3.5m.so.1.0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.