Python: error loading shared libraries: libpython3.4m.so.1.0: cannot open shared objects file: such file or directory is missing

I created a python virtual environment using virtualenv, after activating it, I see where Python is installed,

(virtualenv-test) bash -4.1 $ whereis python

python: /usr/bin/python2.6/usr/bin/python2.6-config/usr/bin/python / usr / lib / python 2.6 / usr / lib64 / python2.6 / usr / X11R6 / bin / python2. 6 / usr / X 11R6 / bin / python2.6-config / usr / X11R6 / bin / python / usr / bin / X 11 / python2.6 / usr / bin / X11 / python2.6-config / usr / bin / X 11 / python / usr / include / python2.6 / usr / share / man / man 1 / python.1.gz

(virtualenv-test) bash -4.1 $, which python

/ data / virtualenv test / bin / Python

However, after entering python, I received the following error message, what could be the main reason?

(virtualenv-test) bash-4.1$ python
python: error while loading shared libraries: libpython3.4m.so.1.0: cannot open shared object file: No such file or directory
+20
5
  1. - , ( , , ): lib py3.4 $ LD_LIBRARY_PATH lib python3.4 ( , ), : /opt/python361/lib, :
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python361/lib
  1. virtualenv python3.6, :
    • -, sudo vi /etc/ld.so.conf, lib python3.x ( : /opt/python361/lib) conf;
    • sudo /sbin/ldconfig -v. .
+20

export LD_LIBRARY_PATH=[your python path to libpython3.4m.so]

libpython3.4m.so python, .

.bashrc, .

virtualenv 3.4 , , lib v python. , libpython3.4m.so .

+8

Python 3.6

sudo apt-get install libpython3.6-dev
+5

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

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

/usr/local/lib - libpython3.*.so

+3

, Python 3.X :

sudo apt-get install libpython3.x-dev

There is no need to make any changes to the environment path manually.

0
source

Source: https://habr.com/ru/post/1674519/


All Articles