[英]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. 我在Windows Anniversary Edition Linux子系统(WSL)上使用Anaconda 4.1.1安装了Python 3.5.2,它或多或少嵌入了Ubuntu 14.04.5 LTS。
I installed virtualenv using: 我使用以下方法安装了virtualenv:
pip install virtualenv
Then I tried to create a virtual environment inside ~/temp
: 然后我尝试在
~/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. 很容易假设这只是一个WSL问题,但到目前为止其他所有工作都有效,而且我在Ubuntu上看到了类似的错误报告。 Any idea what the problem is?
知道问题是什么吗?
I have not experienced the same issue or tried to replicate the WSL environment. 我没有遇到过同样的问题,或者试图复制WSL环境。 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. 并确保包含
libpython
的目录存在。 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. 将最后一行添加到
.bash_profile
或.bashrc
以使其永久化。
mine solution : 我的解决方案
open a shell 打开一个壳
cd
vim .bashrc
add a line 添加一行
export LD_LIBRARY_PATH=~/anaconda3/lib
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.