When using Anaconda to create and manage Python environments, noticed multiple cases when it was very easy to activate and damage Anaconda base environment by an accident.
This leads to Navigator update and functional corruptions, multiple GB base env which are unused, and also may lead to full reinstall which in some complex cases (for example, one package installs only with pip and another only with conda, but both required) may take hours to figure out correct versions for conflicting packages.
Would like Navigator to be only program which can change or activate base environment and to prevent external IDE’s detecting it at all (or at least modyfying).
PyCharm has specifically undesired detection: it adds base every time when you initialize or create new project with this message:
Python 3.x has been configured as a project interpreter
But I also had case of undesired activation and modification by QtCreator – it’s broader question.
To reproduce using PyCharm:
- install Navigator and PyCharm, create 2nd dev environment
- open PyCharm, it’s supposed to fluently detect both conda envs; add dev as default for new projects and delete base in case if it gets detected or added
- reopen PyCharm and initizlize any new .py file or create a new project; this is expected to trigger undesired detection
Tried to dig both programs, especially auto_activate_base: false
in .condaarc and default_env=
in anaconda-navigator.ini, seems tried to modify somehow Anaconda3Scriptsactivate.bat
, but possibly missed something.
Any general solution or at least detection block specifically for PyCharm?