繁体   English   中英

Anaconda Python virtualdev在Windows的Linux子系统上找不到libpython3.5m.so.1.0(Ubuntu 14.04)

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

我在Windows Anniversary Edition Linux子系统(WSL)上使用Anaconda 4.1.1安装了Python 3.5.2,它或多或少嵌入了Ubuntu 14.04.5 LTS。

我使用以下方法安装了virtualenv:

pip install virtualenv

然后我尝试在~/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

很容易假设这只是一个WSL问题,但到目前为止其他所有工作都有效,而且我在Ubuntu上看到了类似的错误报告。 知道问题是什么吗?

我没有遇到过同样的问题,或者试图复制WSL环境。 但通常当其他库发生类似情况时,它很可能是一个配置不当的环境。 你必须签出你的图书馆路径:

echo $LD_LIBRARY_PATH

并确保包含libpython的目录存在。 如果不:

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

将最后一行添加到.bash_profile.bashrc以使其永久化。

我的解决方案

打开一个壳

cd
vim .bashrc

添加一行

export LD_LIBRARY_PATH=~/anaconda3/lib

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM