如何在Windows上配置KDevelop环境指向Anaconda Python安装路径
Got it, let's get your KDevelop set up to use Anaconda's Python on Windows. Since you already have Anaconda's path configured in Windows system variables but KDevelop only lets you input variable names and values directly, here's a step-by-step solution:
How to Point KDevelop to Anaconda Python on Windows
Step 1: Locate Your Anaconda Python Path
First, find where your Anaconda installation lives. It’s usually in a path like:C:\Users\[YourUsername]\anaconda3 (the root folder) or C:\Users\[YourUsername]\anaconda3\python.exe (direct path to the executable). Jot this down—you’ll need it for the next steps.
Step 2: Configure KDevelop's Environment Variables
- Open KDevelop and navigate to your project’s Run Configuration (go to
Run > Configure Launches...in the top menu). - In the configuration window, switch to the Environment tab.
- You’ll see a list of existing environment variables. We need to adjust or add two key entries to prioritize Anaconda’s Python:
- Add/Modify the
PATHvariable: Set its value to your AnacondaScriptsdirectory + Anaconda root, followed by the systemPATH(to keep other system tools working). Example:C:\Users\[YourUsername]\anaconda3\Scripts;C:\Users\[YourUsername]\anaconda3;%PATH%This ensures KDevelop picks up Anaconda’s Python, pip, and related tools before any system-wide Python installations.
- (Optional but Recommended) Add
PYTHONPATH: Set its value to your AnacondaLib\site-packagesfolder if you want KDevelop to recognize packages installed via Anaconda. Example:C:\Users\[YourUsername]\anaconda3\Lib\site-packages
- Add/Modify the
Step 3: Verify the Setup
- Save your run configuration.
- Open KDevelop’s built-in terminal (
Tools > Terminal) and run this command:
If everything works, you’ll see the version number of your Anaconda Python instead of the system default.python --version
Quick Troubleshooting
- If KDevelop still uses system Python: Double-check that your Anaconda paths are listed before the system Python path in the
PATHvariable you set. - Ensure you’re modifying the environment variables for the correct run configuration (each project can have its own separate settings).
内容的提问来源于stack exchange,提问作者Cavein Muthama
相关产品推荐
相关产品推荐

