我在 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
以使其永久化。
关于python - Anaconda Python virtualdev 在适用于 Linux 的 Windows 子系统 (Ubuntu 14.04) 上找不到 libpython3.5m.so.1.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39298681/