Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda Python virtualdev can't find libpython3.5m.so.1.0 on Windows Subsystem for Linux (Ubuntu 14.04)

I installed Python 3.5.2 using Anaconda 4.1.1 on the Windows Anniversary Edition Linux Subsystem (WSL), which is more or less embedded Ubuntu 14.04.5 LTS.

I installed virtualenv using:

pip install virtualenv

Then I tried to create a virtual environment inside ~/temp:

user@host:~$ virtualenv ~/temp/test
Using base prefix '/home/user/anaconda3'
New python executable in /home/user/temp/test/bin/python
/home/user/temp/test/bin/python: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
ERROR: The executable /home/user/temp/test/bin/python is not functioning
ERROR: It thinks sys.prefix is '/home/user' (should be '/home/user/temp/test')
ERROR: virtualenv is not compatible with this system or executable

It's easy to assume that this is just a WSL issue, but everything else was working so far, and I've seen similar errors reported on Ubuntu. Any idea what the problem is?

like image 342
Garret Wilson Avatar asked Sep 02 '16 18:09

Garret Wilson


2 Answers

I have not experienced the same issue or tried to replicate the WSL environment. But usually when something similar happens with other libraries it is just likely to be a poorly configured environment. You have to checkout your library path:

echo $LD_LIBRARY_PATH

And make sure the directory that holds libpython is there. If not:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/the/py/lib/dir

Add this last line to your .bash_profile or .bashrc to make it permanent.

like image 171
rll Avatar answered Nov 14 '22 06:11

rll


mine solution :

open a shell

cd
vim .bashrc

add a line

export LD_LIBRARY_PATH=~/anaconda3/lib
like image 36
Atongsa Miyamoto Avatar answered Nov 14 '22 06:11

Atongsa Miyamoto