Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23305

Prevent Anaconda base environment being used or modified by other applications

$
0
0

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 is not supposed to be ever used, 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 the only program which can change or activate base environment, and to prevent external IDE's detecting it at all (or at least modifying).

I had cases of undesired activation and modification by QtCreator and PyCharm (selecting default env fixes for some time, but eventually fails on env deletion).

To reproduce using PyCharm (similar for both 2021 and 2024):

  • install Navigator and PyCharm, create 2nd dev environment
  • open PyCharm without project, in the settings add dev and delete base in case if it gets detected or added, set <No Interpreter> as default
  • open in PyCharm empty folder with any *.py file; this is expected to trigger undesired detection with notification

Python * has been configured as a project interpreter

Specifically for PyCharm, setting default env mostly solves the problem, but sometimes still drops back.

Tried to dig conda, especially auto_activate_base: false in .condarc and default_env= in anaconda-navigator.ini, seems tried to modify somehow Anaconda3\Scripts\activate.bat, tried to remove conda from PATH, but still no luck and possibly missed something.

Any general solution which will be solid for any program?


Viewing all articles
Browse latest Browse all 23305

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>