What's the difference between virtual environment and existing interpreter in PyCharm?

Answered

I opened PyCharm for the first time, and I see an option to choose 'New environment using: Virtualenv / Conda' or 'Existing interpreter'.

So:

1) What's the difference between the 2?

2) What's the difference between Virtualenv and Conda?

 

Thanks!

3 comments

Hello,

1.Pycharm detects existing python environments on your system and shows them in the Existing Environment| Interpreter drop-down list. If your existing environment is not detected automatically, you could press cogwheel and navigate to its path manually.

For more info please check https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html and feel free to ask any questions.

2. Please check https://conda.io/docs/user-guide/install/download.html. To know more about conda environments please take a look at https://conda.io/docs/user-guide/concepts.html#conda-environments.

 

-2

Sorry I don't understand. I have 3 options: Virtualenv / Conda / Existing Interpreter. In Virtualenv and Existing Interpreter I can choose the Python.exe file in Anaconda's directory (I have Anconda 3 installed). So what's the difference here? And if I choose Conda environment with the same Python version, does it make this choice any different?

The code runs successfully in all 3 options... So I don't understand what's the difference and what's the best choice for me.

Thanks

1

> In Virtualenv and Existing Interpreter I can choose the Python.exe file in Anaconda's directory (I have Anconda 3 installed). So what's the difference here?

Difference is that if you use virtualenv for the project and add/remove packages it affects only virtual environment. If you use Existing Interpreter then  all changes will affect system wide interpreter and these changes will be available in all projects that use that interpreter

> And if I choose Conda environment with the same Python version, does it make this choice any different?

When you create conda interpterer it asks for base interpreter it will use to create environment. Generally it checks for packages that should be imported in new environment.

Long story short:

Existing interpreter  - all changes are system wide

Conda/Virtual interpreter - uses selected interpreter as initial source, but creates independent copy which could be modified fot project needs.

 

 

 

1

Please sign in to leave a comment.