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

后端 未结 9 1565
别那么骄傲
别那么骄傲 2021-02-02 07:36

I have created a python virtual environment using virtualenv, after activating it, I can see where is Python installed in my shell as following:



        
相关标签:
9条回答
  • 2021-02-02 08:07

    I got it running by installing the package

    sudo apt-get install libpython3.x-dev 
    
    
    0 讨论(0)
  • 2021-02-02 08:15

    This one worked for me.

    cd ~/
    vim .bashrc
    export LD_LIBRARY_PATH=~/miniconda/envs/python3.6/lib/
    
    0 讨论(0)
  • 2021-02-02 08:17

    For Python 3.6, it was fixed by

    sudo apt-get install libpython3.6-dev
    
    0 讨论(0)
  • 2021-02-02 08:20

    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

    0 讨论(0)
  • 2021-02-02 08:20

    Kudos to above, For python 3.X you can fix this issue with:

    sudo apt-get install libpython3.x-dev
    

    No need to any changes to environment path manually.

    0 讨论(0)
  • 2021-02-02 08:22

    On python 3.8, I resolved this by deleting the virtualenv directory (./venv in my case) and recreating using python's built-in venv module installed of the pip-installed virtualenv. I'm on arch linux and also first did sudo pacman -Syu. Python was originally installed using just sudo pacman -S python.

    $ rm -r ./venv
    $ python -m venv venv
    $ . ./venv/bin/activate
    $ python --version
    Python 3.8.1
    
    0 讨论(0)
提交回复
热议问题