Unexpected python paths in conda environment

This is expected behavior (see PEP 370) and partially why Anaconda recommended against user-level package installations. The site module is responsible for setting the sys.path when Python is initializing. The code in site.py specifically appends the user site prior to appending the prefix site, which is what leads to this prioritization. The motivation according to … Read more

conda environment has access to system modules, how to prevent?

In addition to what @VikashB mentioned, these can result from packages installed with pip install –user. As @TimRoberts alluded to in the comments, the site module, which populates the sys.path variable, searches paths like ~/.local/lib/python*/site-packages by default. Temporary Options One can disable the site module from loading such packages (see PEP 370), either by launching … Read more

PATH not updated correctly from conda activate in VSCode’s terminal

This behavior is explained in the VSCode docs: Why are there duplicate paths in the terminal’s $PATH environment variable and/or why are they reversed?# It sounds like VSCode will run your .zshrc twice in MacOS, conflicting with the conda-generated PATH variable definitions. There are two solutions listed in the link above. The one that works … Read more

Conda takes 20+ minutes to solve environment when package is already installed

A Common Problem: Suboptimal Channel Prioritization Anaconda distribution is designed and tested to use the anaconda channel (a subset of defaults) as its primary channel. Adding conda-forge in either a higher- (channel_priority: strict) or equal-priority (channel_priority: flexible) configuration opens up many of the packages to be sourced from Conda Forge instead, and this is where … Read more