从Windows到Linux的conda环境 [英] conda environment from windows to linux
问题描述
我已经使用pycharm在Windows上开发了一个项目,我想在ubuntu服务器上进行部署.
I have developed a project on windows using pycharm and I want to deploy in on an ubuntu server.
我正在尝试使用以下命令创建 requirements.txt
:
I am trying to create a requirements.txt
using these commands:
conda list -e > requirements.txt
conda list > requirements.txt
取决于选项, requirements.txt
看起来像以下任何一种:
Depending on the options the requirements.txt
looks like any of these:
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: win-64
@EXPLICIT
https://repo.anaconda.com/pkgs/main/win-64/blas-1.0-mkl.tar.bz2
https://repo.anaconda.com/pkgs/main/win-64/ca-certificates-2018.03.07-0.tar.bz2
https://repo.anaconda.com/pkgs/main/win-64/icc_rt-2017.0.4-h97af966_0.tar.bz2
https://repo.anaconda.com/pkgs/main/win-64/intel-openmp-2018.0.3-0.tar.bz2
或者这个
# packages in environment at C:\ProgramData\Anaconda2\envs\myenvs:
#
# Name Version Build Channel
anyjson 0.3.3 py36h1110a06_1
arrow 0.12.1 py36_1
asn1crypto 0.24.0 py36_0
babel 2.6.0 py36_0
或者这个
name: myenv
channels:
- defaults
dependencies:
- anyjson=0.3.3=py36h1110a06_1
- arrow=0.12.1=py36_1
- asn1crypto=0.24.0=py36_0
- babel=2.6.0=py36_0
- blas=1.0=mkl
无论我怎么做,在某些情况下,由于软件包是针对Windows的,所以在ubuntu机器上都会出现错误:(/win-64/)
No matter how I try to do this I get errors on the ubuntu machine, in some cases because the package is for windows: (/win-64/)
https://repo.anaconda.com/pkgs/main/win-64/ca-certificates-2018.03.07-0.tar.bz2
我已经阅读了很多文档,但是我似乎无法获得想要的东西. Conda(Python)虚拟环境不可移植Windows到Linux
I have read a lot of documentation but I seem not to be able to get what I want. Conda (Python) Virtual Environment is not Portable from Windows to Linux
有解决方案吗?
推荐答案
默认情况下,conda会使用内部版本导出您的环境,但是内部版本可能是特定于平台的.
By default, conda will export your environment with builds, but builds can be platform-specific.
对我有用的解决方案是使用-no-build
标志:
A solution that worked for me is to use the --no-build
flag:
$ conda env export --no-build > environment.yml
希望这会有所帮助.
这篇关于从Windows到Linux的conda环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!