Gar*_*son 7 python linux ubuntu virtualenv windows-subsystem-for-linux
我在Windows Anniversary Edition Linux子系统(WSL)上使用Anaconda 4.1.1安装了Python 3.5.2,它或多或少嵌入了Ubuntu 14.04.5 LTS.
我使用以下方法安装了virtualenv:
pip install virtualenv
Run Code Online (Sandbox Code Playgroud)
然后我尝试在里面创建一个虚拟环境~/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
Run Code Online (Sandbox Code Playgroud)
很容易假设这只是一个WSL问题,但到目前为止其他所有工作都有效,而且我在Ubuntu上看到了类似的错误报告.知道问题是什么吗?
rll*_*rll 20
我没有遇到过同样的问题,或者试图复制WSL环境.但通常当其他库发生类似情况时,它很可能是一个配置不当的环境.你必须签出你的图书馆路径:
echo $LD_LIBRARY_PATH
Run Code Online (Sandbox Code Playgroud)
并确保保留的目录在libpython那里.如果不:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/the/py/lib/dir
Run Code Online (Sandbox Code Playgroud)
将最后一行添加到您的.bash_profile或.bashrc使其永久化.
| 归档时间: |
|
| 查看次数: |
6078 次 |
| 最近记录: |