close

[Solved] python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory Error Occurs?

Today I get the following error python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory in python.

How To Solve python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory Error ?

  1. How To Solve python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory Error ?

    To Solve python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory Error Try adding the python3.4's lib path to the $LD_LIBRARY_PATH environment variable.

  2. python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory

    To Solve python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory Error Try adding the python3.4's lib path to the $LD_LIBRARY_PATH environment variable.

Solution 1

Try adding the python3.4’s lib path to the $LD_LIBRARY_PATH environment variable.

First find out the lib path of python3.4 (depends on how you installed python3.4)

For me it was: /opt/python361/lib, then add it to environment variable like so:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python361/lib

P.S. I came across a similar problem while using virtualenv with python3.6, and I fixed it like so:

  • First, append include <lib path of python3.x> to /etc/ld.so.conf (Something like: include /opt/python361/lib or include /usr/local/lib)
  • Then, activate the new configuration by running sudo /sbin/ldconfig -v.

Solution 2

Another way is adding LDFLAGS="-Wl,-rpath /usr/local/lib" in configure, for example

./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"

/usr/local/lib is the path where libpython3.*.so files are in

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read