I have created a python virtual environment using virtualenv, after activating it, I can see where is Python installed in my shell as following:
I got it running by installing the package
sudo apt-get install libpython3.x-dev
This one worked for me.
cd ~/
vim .bashrc
export LD_LIBRARY_PATH=~/miniconda/envs/python3.6/lib/
For Python 3.6, it was fixed by
sudo apt-get install libpython3.6-dev
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
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.
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