Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Failed to activate conda environment #2819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liuzhenghua
Copy link

Issue Description

An error ocurred while open the Terminal:

+ Failed to activate conda environment.
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (Failed:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

image
The actual reason for this error can be found in the logs:

2024-07-25 10:35:24,316 [1553431]   INFO - #c.j.p.packaging - System conda executable is not found
2024-07-25 10:35:24,316 [1553431]   WARN - #c.i.p.t.PyVirtualEnvTerminalCustomizer - Can't find null, will not activate conda

This is because the default installation location for conda is the local app data directory, but this directory is not in PyCharm's search path list. If the user changes the conda environment path, then PyCharm cannot find the conda path.

Issue Reproduction

  1. Install Miniconda3 on Windows.
  2. Verify the installation directory is %USERPROFILE%/AppData/Local/miniconda3.
  3. Modify the %USERPROFILE%/.condarc file to change the envs_dirs and pkgs_dirs:
envs_dirs:
  - D:\data\conda_envs
pkgs_dirs:
  - D:\data\conda_pkgs
  1. Use PyCharm to create a conda environment, and open the Terminal in PyCharm.

The default installation location for conda is the local app data directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants