简体   繁体   中英

Activating a Conda Enviroment in Pycharm

Probably an extremely trivial question. I created an environment in conda and now want to run a script in pycharm. what is the command line to activate said conda environment so that I can use work in it on pycharm?

By default, the command is source activate your_env_name

On Windows, it should be conda activate your_env_name instead

Step1: First know the path of python and conda that you want to use. If you don't know, you can get the path(s) on windows command prompt by:

>where conda

>where python

Step2: Press Ctrl+Alt+S to open the project Settings/Preferences and go to Project | Python Interpreter. Then click the gear icon and select Add. In the left-hand pane of the Add Python Interpreter dialog, select Conda Environment. Select Existing environment Click Select an interpreter and specify a paths to python and Conda executable (the paths you obtained in Step1).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM