本文介绍了PyCharm终端无法激活conda环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows的默认位置为C:\ProgramData\Anaconda2\envs\myenv的地方有一个conda环境.另外,按照建议,conda脚本和可执行文件也不在%PATH%环境变量中.我在pycharm中打开了一个项目,并将python解释器指向C:\ProgramData\Anaconda2\envs\myenv\python.exepycharm似乎可以在python控制台,运行环境和调试模式下很好地与环境配合使用.

I have a conda environment at the default location for windows, which is C:\ProgramData\Anaconda2\envs\myenv. Also, as recommended, the conda scripts and executables are not in the %PATH% environment variable.I opened a project in pycharm and pointed the python interpreter toC:\ProgramData\Anaconda2\envs\myenv\python.exeand pycharm seems to work well with the environment in the python console, in the run environment, and in debug mode.

但是,在打开终端时,未激活环境(我确保已选中用于激活环境的复选框).需要明确的是-当我使用virtualenv做同样的事情时,终端会毫无问题地激活环境.

However, when opening the terminal the environment is not activated (I made sure that the checkbox for activating the environment is checked). To be clear - when I do the same thing with a virtualenv the terminal does activate the environment without a problem.

以下是我尝试过但未起作用的一些事情:

Here are a few things I tried and did not work:

  • 将激活脚本从anaconda文件夹复制到环境文件夹
  • 将激活脚本从anaconda文件夹复制到环境下的Scripts文件夹中
  • 从virtualenv复制了一个激活脚本(与激活环境相同的脚本)
  • 将anaconda文件夹添加到路径
  • Copied the activate script from the anaconda folder to the environment folder
  • Copied the activate script from the anaconda folder to the Scripts folder under the environment
  • Copied an activate script from the virtualenv (an identical one for which the environment is activated)
  • Added the anaconda folders to the path

这些都不起作用.终端打开后,我可以手动激活环境而不会出现问题,但是我如何自动做到呢?

None of these worked.I can manually activate the environment without a problem once the terminal is open, but how do I do it automatically?

推荐答案

这似乎是已知的问题.

这篇关于PyCharm终端无法激活conda环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 22:07