Conda (Python) Virtual Environment is not Portable from Windows to Linux

送分小仙女□ 提交于 2019-12-06 19:06:32

问题


On my Windows 10 machine, I created a virtual environment using the following command:

>conda env export > environment.yml 

I tried re-creating the virtual environment using the yml file on the Windows system and it worked fine. Then I transferred environment.yml to my Linux machine (Ubuntu 16.04.1) with the same version of conda and python and ran the following in the terminal:

$ conda env create -f environment.yml

I get the following error:

Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata .......
Solving package specifications: .
Error: Packages missing in current linux-64 channels:
- jpeg 8d vc14_0
- libpng 1.6.22 vc14_0
- libtiff 4.0.6 vc14_2
- mkl 11.3.3 1
- numpy 1.11.1 py35_1
- openssl 1.0.2h vc14_0
- pyqt 4.11.4 py35_7
- qt 4.8.7 vc14_9
- tk 8.5.18 vc14_0
- vs2015_runtime 14.0.25123 0
- zlib 1.2.8 vc14_3

Most of these packages are available in the linux repo of conda, but with a different flavor. For instance, if I remove vc14_0 from the line that contains the jpeg package in the yml file, that would work just fine. The package vs2015_runtime is not available in linux at all. Nothing gets returned when you run:

conda search vs2015_runtime". 

How can I export my virtual environment in a portable way when working cross-platform, so that all the packages can be installed in Linux as well?

Here is the content of my environment.yml.


回答1:


It looks like you are fetching packages compiled with Microsoft Visual C/C++ Compiler (the vc part of the name). Those packages won't be ABI compatible from Linux as you are trying to do. Simply target the packages that are not Windows-specific.



来源:https://stackoverflow.com/questions/39105596/conda-python-virtual-environment-is-not-portable-from-windows-to-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!