python虚拟环境和conda环境_Conda(Python)虚拟环境无法从Windows移植到Linux

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.

解决方案

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.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值