简体   繁体   English

如何在 Anaconda 中有两个不同的环境? (Python 3.7,1个32bit和1个64bit)

[英]How can I have two different environments within Anaconda? (both Python 3.7, one 32bit and one 64bit)

What I need我需要的

I require a 32bit conda environment, in addition to the current 64bit in my Anaconda distribution.除了我的 Anaconda 发行版中的当前 64 位之外,我还需要 32 位 conda 环境。

What I've tried我试过的

I've followed the step's within this answer .我已按照此答案中的步骤进行操作。 However set CONDA_FORCE_32BIT=1 did not work in my case, I've verified this by checking the bit version after build.但是set CONDA_FORCE_32BIT=1在我的情况下不起作用,我通过在构建后检查位版本来验证这一点。 Comments in the answer and other sources suggest that it may have been removed.答案和其他来源中的评论表明它可能已被删除。

I've also tried installing 32bit version Miniconda but I am having an issue changing environments because they both come under the same name (base) .我也尝试安装 32 位版本的Miniconda ,但我在更改环境时遇到了问题,因为它们都使用相同的名称(base)

Any suggestions will be helpful!任何建议都会有所帮助!

Thanks谢谢

You can specify the 32-bit channel manually using the --channel/-c flag when using conda create .您可以在使用conda create时使用--channel/-c标志手动指定 32 位通道。

You just need to supply the correct url for the channel and subdir you want to use.您只需为要使用的通道和子目录提供正确的 url。 The --override-channels flag prevents the 64-bit channels from being pulled in (shouldn't matter, but your never know). --override-channels标志可防止 64 位通道被拉入(没关系,但你永远不知道)。

conda create -n py32 python=3.7 -c https://repo.anaconda.com/pkgs/main/win-32 --override-channels
conda activate py32

In your case, I would recommend installing the 64-bit version of Anaconda or Miniconda, then create the 32-bit environment.在您的情况下,我建议安装 64 位版本的 Anaconda 或 Miniconda,然后创建 32 位环境。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM