You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Windows系统PyCharm中配置Anaconda解释器遇阻求助

Fixing Conda Interpreter Setup Issues in PyCharm

Let's break down each of your errors first, then walk through step-by-step solutions to get your Conda environment working smoothly in PyCharm:

1. Why anaconda.exe create fails

anaconda.exe is the launcher for the Anaconda Navigator GUI app—not the command-line tool for managing environments. You should always use conda.exe (located in C:\Logiciels\Anaconda3\Scripts\) for environment creation and package management tasks.

2. Fixing CondaHTTPError (SSL module unavailable)

This error typically comes from one of three root causes: missing SSL libraries in your Anaconda install, network/proxy blocks, or misconfigured Conda repositories. Here's how to resolve it:

  • Check SSL libraries: Navigate to C:\Logiciels\Anaconda3\Library\bin and confirm you have libssl-1_1-x64.dll and libcrypto-1_1-x64.dll. If they're missing, reinstall Anaconda with admin privileges, and make sure to check "Add Anaconda to my PATH environment variable" during setup.
  • Test with temporary SSL verification disable: Run this command in Anaconda Prompt (note: this is for testing only, not long-term use):
    conda config --set ssl_verify false
    
  • Switch to reliable domestic mirrors: Replace your .condarc file (found in C:\Users\hel\.condarc) with the following to use Tsinghua University's mirrors (faster and more stable for Chinese users):
    channels:
      - defaults
    show_channel_urls: true
    default_channels:
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
    custom_channels:
      conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
    

3. Why python.exe create fails

python.exe is for running Python scripts—it has no create command for environment setup. Stick with conda.exe for managing Conda environments.


Step-by-Step Guide to Add Conda Interpreter in PyCharm

Once you've fixed the Conda SSL issue, follow these steps to link your environment to PyCharm:

  1. Create a Conda environment correctly
    Open Anaconda Prompt (run as administrator) and run:

    conda create -n Ex_Files_TensorFlow python=3.7 -y
    

    This creates an environment named Ex_Files_TensorFlow with Python 3.7. Activate it with:

    conda activate Ex_Files_TensorFlow
    

    Then install TensorFlow:

    pip install tensorflow
    
  2. Link the environment to PyCharm

    • Open your project in PyCharm, go to File > Settings > Project: [Your Project Name] > Python Interpreter
    • Click the gear icon in the top-right corner and select Add
    • In the pop-up window, choose Conda Environment > Existing environment
    • Click the browse button next to "Interpreter" and navigate to C:\Logiciels\Anaconda3\envs\Ex_Files_TensorFlow\python.exe
    • Optional: Check "Make available to all projects" if you want to reuse this environment across multiple projects
    • Click OK to save your settings

Extra Troubleshooting Tips

  • Ensure both Anaconda and PyCharm are the same architecture (64-bit or 32-bit)—mixing them causes compatibility issues
  • Update PyCharm to the latest version to ensure full support for your Conda version
  • If command-line environment creation still fails, try creating it directly in PyCharm: In the Add Interpreter window, select Conda Environment > New environment, specify the name and Python version, then click OK—PyCharm will handle the setup automatically

内容的提问来源于stack exchange,提问作者Hel

火山引擎 最新活动