Windows系统PyCharm中配置Anaconda解释器遇阻求助
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\binand confirm you havelibssl-1_1-x64.dllandlibcrypto-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
.condarcfile (found inC:\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:
Create a Conda environment correctly
Open Anaconda Prompt (run as administrator) and run:conda create -n Ex_Files_TensorFlow python=3.7 -yThis creates an environment named
Ex_Files_TensorFlowwith Python 3.7. Activate it with:conda activate Ex_Files_TensorFlowThen install TensorFlow:
pip install tensorflowLink 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
OKto save your settings
- Open your project in PyCharm, go to
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 Interpreterwindow, selectConda Environment > New environment, specify the name and Python version, then clickOK—PyCharm will handle the setup automatically
内容的提问来源于stack exchange,提问作者Hel




