ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 8.3 months ago (distributed domain, exempt) |
| History drop | FAIL | isNull(history_drop_reason) | tooold |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://github.com/conda/conda/issues/9392 |
| Last Crawled | 2025-08-07 19:53:39 (8 months ago) |
| First Indexed | not set |
| HTTP Status Code | 200 |
| Meta Title | PATH not set by conda activate · Issue #9392 · conda/conda |
| Meta Description | conda activate does not prepend the correct virtual environment to $PATH on Mac and Linux, therefore the system python takes precedence over the virtual environment one. How to observe the bug # Launching new shell (base) atcold@AlfMAC3 ... |
| Meta Canonical | null |
| Boilerpipe Text | conda activate does not prepend the correct virtual environment to $PATH on Mac and Linux, therefore the system python takes precedence over the virtual environment one. # Launching new shell
(base) atcold@AlfMAC3 ~
$ which python
/usr/local/bin/python # system python
(base) atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~
$ which python
/usr/local/bin/python # still system python! Workaround: run conda deactivate . # Launching new shell
(base) atcold@AlfMAC3 ~
$ conda deactivate
atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~
$ which python
/Users/atcold/opt/miniconda3/envs/PPUU/bin/python # virtual environment python
(PPUU) atcold@AlfMAC3 ~ Seems like (base) needs to be deactivated first.
Running conda config --set auto_activate_base false adds auto_activate_base: false to ~/.condarc , but the issue remains. # Launching new shell
atcold@AlfMAC3 ~
$ which python
/usr/local/bin/python # system python
atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~
$ which python
/usr/local/bin/python # still system python! The following line should be sufficient to identify the cause of this bug.
Namely, system python shadows the virtual environment one because conda activate does not prepend the virtual environment path to $PATH , but it inserts it in the middle. If conda deactivate is called, then the virtual environment path is correctly prepended to $PATH , which leads to the correct and expected behaviour, which has the virtual environment shadowing the system python. (base) atcold@AlfMAC3 ~ # conda path is inside $PATH
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Library/TeX/texbin:/opt/X11/bin:/Users/atcold/opt/miniconda3/bin:/Users/atcold/opt/miniconda3/condabin:/usr/local/miniconda3/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
(base) atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~ # PPUU virtual environment path is inside $PATH
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Library/TeX/texbin:/opt/X11/bin:/Users/atcold/opt/miniconda3/envs/PPUU/bin:/Users/atcold/opt/miniconda3/condabin:/usr/local/miniconda3/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
(PPUU) atcold@AlfMAC3 ~
$ conda deactivate
(base) atcold@AlfMAC3 ~
$ conda deactivate
atcold@AlfMAC3 ~
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Library/TeX/texbin:/opt/X11/bin:/Users/atcold/opt/miniconda3/condabin:/usr/local/miniconda3/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~ # finally, PPUU virtual environment path is in front of $PATH
$ echo $PATH
/Users/atcold/opt/miniconda3/envs/PPUU/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Library/TeX/texbin:/opt/X11/bin:/Users/atcold/opt/miniconda3/condabin:/usr/local/miniconda3/bin:/usr/local/cuda/bin:/usr/local/cuda/bin Adding conda deactivate to the end of ~/.profile or ~/.bashrc will have conda activate work as expected. The code added to ~/.profile is buggy (as can be seen here ). More precisely there are extra backslashes in \eval and \export . This bug has been verified on a Mac (Catalina) and on a Linux (CentOS 7). active environment : base
active env location : /Users/atcold/opt/miniconda3
shell level : 1
user config file : /Users/atcold/.condarc
populated config files : /Users/atcold/.condarc
conda version : 4.7.12
conda-build version : not installed
python version : 3.7.4.final.0
virtual packages :
base environment : /Users/atcold/opt/miniconda3 (writable)
channel URLs : https://conda.anaconda.org/pytorch/osx-64
https://conda.anaconda.org/pytorch/noarch
https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /Users/atcold/opt/miniconda3/pkgs
/Users/atcold/.conda/pkgs
envs directories : /Users/atcold/opt/miniconda3/envs
/Users/atcold/.conda/envs
platform : osx-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Darwin/19.0.0 OSX/10.15
UID:GID : 501:20
netrc file : None
offline mode : False active environment : base
active env location : /home/us441/vlad/miniconda3
shell level : 1
user config file : /home/us441/.condarc
populated config files :
conda version : 4.7.12
conda-build version : not installed
python version : 3.7.3.final.0
virtual packages :
base environment : /home/us441/vlad/miniconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/us441/vlad/miniconda3/pkgs
/home/us441/.conda/pkgs
envs directories : /home/us441/vlad/miniconda3/envs
/home/us441/.conda/envs
platform : linux-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.3 Linux/3.10.0-1062.1.2.el7.x86_64 centos/7.7.1908 glibc/2.17
UID:GID : 9007:9007
netrc file : None
offline mode : False |
| Markdown | [Skip to content](https://github.com/conda/conda/issues/9392#start-of-content)
## Navigation Menu
Toggle navigation
[Sign in](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fconda%2Fconda%2Fissues%2F9392)
Appearance settings
- Product
- [GitHub Copilot Write better code with AI](https://github.com/features/copilot)
- [GitHub Spark New Build and deploy intelligent apps](https://github.com/features/spark)
- [GitHub Models New Manage and compare prompts](https://github.com/features/models)
- [GitHub Advanced Security Find and fix vulnerabilities](https://github.com/security/advanced-security)
- [Actions Automate any workflow](https://github.com/features/actions)
- [Codespaces Instant dev environments](https://github.com/features/codespaces)
- [Issues Plan and track work](https://github.com/features/issues)
- [Code Review Manage code changes](https://github.com/features/code-review)
- [Discussions Collaborate outside of code](https://github.com/features/discussions)
- [Code Search Find more, search less](https://github.com/features/code-search)
Explore
- [Why GitHub](https://github.com/why-github)
- [All features](https://github.com/features)
- [Documentation](https://docs.github.com/)
- [GitHub Skills](https://skills.github.com/)
- [Blog](https://github.blog/)
- Solutions
By company size
- [Enterprises](https://github.com/enterprise)
- [Small and medium teams](https://github.com/team)
- [Startups](https://github.com/enterprise/startups)
- [Nonprofits](https://github.com/solutions/industry/nonprofits)
By use case
- [DevSecOps](https://github.com/solutions/use-case/devsecops)
- [DevOps](https://github.com/solutions/use-case/devops)
- [CI/CD](https://github.com/solutions/use-case/ci-cd)
- [View all use cases](https://github.com/solutions/use-case)
By industry
- [Healthcare](https://github.com/solutions/industry/healthcare)
- [Financial services](https://github.com/solutions/industry/financial-services)
- [Manufacturing](https://github.com/solutions/industry/manufacturing)
- [Government](https://github.com/solutions/industry/government)
- [View all industries](https://github.com/solutions/industry)
[View all solutions](https://github.com/solutions)
- Resources
Topics
- [AI](https://github.com/resources/articles/ai)
- [DevOps](https://github.com/resources/articles/devops)
- [Security](https://github.com/resources/articles/security)
- [Software Development](https://github.com/resources/articles/software-development)
- [View all](https://github.com/resources/articles)
Explore
- [Learning Pathways](https://resources.github.com/learn/pathways)
- [Events & Webinars](https://resources.github.com/)
- [Ebooks & Whitepapers](https://github.com/resources/whitepapers)
- [Customer Stories](https://github.com/customer-stories)
- [Partners](https://partner.github.com/)
- [Executive Insights](https://github.com/solutions/executive-insights)
- Open Source
- [GitHub Sponsors Fund open source developers](https://github.com/sponsors)
- [The ReadME Project GitHub community articles](https://github.com/readme)
Repositories
- [Topics](https://github.com/topics)
- [Trending](https://github.com/trending)
- [Collections](https://github.com/collections)
- Enterprise
- [Enterprise platform AI-powered developer platform](https://github.com/enterprise)
Available add-ons
- [GitHub Advanced Security Enterprise-grade security features](https://github.com/security/advanced-security)
- [Copilot for business Enterprise-grade AI features](https://github.com/features/copilot/copilot-business)
- [Premium Support Enterprise-grade 24/7 support](https://github.com/premium-support)
- [Pricing](https://github.com/pricing)
Search or jump to...
# Search code, repositories, users, issues, pull requests...
[Search syntax tips](https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax)
# Provide feedback
Cancel
Submit feedback
# Saved searches
## Use saved searches to filter your results more quickly
Cancel
Create saved search
[Sign in](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fconda%2Fconda%2Fissues%2F9392)
[Sign up](https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=conda%2Fconda)
Appearance settings
Resetting focus
You signed in with another tab or window. [Reload](https://github.com/conda/conda/issues/9392) to refresh your session. You signed out in another tab or window. [Reload](https://github.com/conda/conda/issues/9392) to refresh your session. You switched accounts on another tab or window. [Reload](https://github.com/conda/conda/issues/9392) to refresh your session.
Dismiss alert
{{ message }}
[conda](https://github.com/conda) / **[conda](https://github.com/conda/conda)** Public
- [Notifications](https://github.com/login?return_to=%2Fconda%2Fconda)
You must be signed in to change notification settings
- [Fork 1.9k](https://github.com/login?return_to=%2Fconda%2Fconda)
- [Star 7k](https://github.com/login?return_to=%2Fconda%2Fconda)
- [Code](https://github.com/conda/conda)
- [Issues 544](https://github.com/conda/conda/issues)
- [Pull requests 84](https://github.com/conda/conda/pulls)
- [Actions](https://github.com/conda/conda/actions)
- [Projects 5](https://github.com/conda/conda/projects)
- [Wiki](https://github.com/conda/conda/wiki)
- [Security](https://github.com/conda/conda/security)
[Uh oh\!](https://github.com/conda/conda/security)
[There was an error while loading.](https://github.com/conda/conda/security) [Please reload this page](https://github.com/conda/conda/issues/9392).
- [Insights](https://github.com/conda/conda/pulse)
Additional navigation options
- [Code](https://github.com/conda/conda)
- [Issues](https://github.com/conda/conda/issues)
- [Pull requests](https://github.com/conda/conda/pulls)
- [Actions](https://github.com/conda/conda/actions)
- [Projects](https://github.com/conda/conda/projects)
- [Wiki](https://github.com/conda/conda/wiki)
- [Security](https://github.com/conda/conda/security)
- [Insights](https://github.com/conda/conda/pulse)
# PATH not set by conda activate \#9392
[New issue](https://github.com/login?return_to=https://github.com/conda/conda/issues/9392)
Copy link
[New issue](https://github.com/login?return_to=https://github.com/conda/conda/issues/9392)
Copy link
Closed as not planned
Closed as not planned
[PATH not set by conda activate](https://github.com/conda/conda/issues/9392#top)
\#9392
Copy link
Labels
[clipertains to the CLI interface](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22cli%22)pertains to the CLI interface[locked\[bot\] locked due to inactivity](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22locked%22)\[bot\] locked due to inactivity[source::communitycatch-all for issues filed by community members](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22source%3A%3Acommunity%22)catch-all for issues filed by community members[type::supportneither a bug nor feature, is really just a user having questions or difficulty somewhere](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22type%3A%3Asupport%22)neither a bug nor feature, is really just a user having questions or difficulty somewhere
[](https://github.com/Atcold)
## Description
[](https://github.com/Atcold)
[Atcold](https://github.com/Atcold)
opened
[on Oct 30, 2019](https://github.com/conda/conda/issues/9392#issue-514911258)
· edited by [Atcold](https://github.com/Atcold)
Edits
Issue body actions
`conda activate` does not prepend the correct virtual environment to `$PATH` on Mac and Linux, therefore the system python takes precedence over the virtual environment one.
# How to observe the bug
```
# Launching new shell
(base) atcold@AlfMAC3 ~
$ which python
/usr/local/bin/python # system python
(base) atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~
$ which python
/usr/local/bin/python # still system python!
```
Workaround: run `conda deactivate`.
```
# Launching new shell
(base) atcold@AlfMAC3 ~
$ conda deactivate
atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~
$ which python
/Users/atcold/opt/miniconda3/envs/PPUU/bin/python # virtual environment python
(PPUU) atcold@AlfMAC3 ~
```
Seems like `(base)` needs to be deactivated first.
Running `conda config --set auto_activate_base false` adds `auto_activate_base: false` to `~/.condarc`, but the issue remains.
```
# Launching new shell
atcold@AlfMAC3 ~
$ which python
/usr/local/bin/python # system python
atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~
$ which python
/usr/local/bin/python # still system python!
```
# What is going on
The following line should be sufficient to identify the cause of this bug.
Namely, system python shadows the virtual environment one because `conda activate` does not prepend the virtual environment path to `$PATH`, but it inserts it in the middle.
If `conda deactivate` is called, then the virtual environment path is correctly prepended to`$PATH`, which leads to the correct and expected behaviour, which has the virtual environment shadowing the system python.
```
(base) atcold@AlfMAC3 ~ # conda path is inside $PATH
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Library/TeX/texbin:/opt/X11/bin:/Users/atcold/opt/miniconda3/bin:/Users/atcold/opt/miniconda3/condabin:/usr/local/miniconda3/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
(base) atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~ # PPUU virtual environment path is inside $PATH
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Library/TeX/texbin:/opt/X11/bin:/Users/atcold/opt/miniconda3/envs/PPUU/bin:/Users/atcold/opt/miniconda3/condabin:/usr/local/miniconda3/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
(PPUU) atcold@AlfMAC3 ~
$ conda deactivate
(base) atcold@AlfMAC3 ~
$ conda deactivate
atcold@AlfMAC3 ~
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Library/TeX/texbin:/opt/X11/bin:/Users/atcold/opt/miniconda3/condabin:/usr/local/miniconda3/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
atcold@AlfMAC3 ~
$ conda activate PPUU
(PPUU) atcold@AlfMAC3 ~ # finally, PPUU virtual environment path is in front of $PATH
$ echo $PATH
/Users/atcold/opt/miniconda3/envs/PPUU/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/Library/TeX/texbin:/opt/X11/bin:/Users/atcold/opt/miniconda3/condabin:/usr/local/miniconda3/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
```
# Hack to fix this bug
Adding `conda deactivate` to the end of `~/.profile` or `~/.bashrc` will have `conda activate` work as expected.
# Additional bug
The code added to `~/.profile` is buggy (as can be seen [here](https://github.com/conda/conda/issues/8535#issuecomment-486360313)). More precisely there are extra backslashes in `\eval` and `\export`.
# Conda info
This bug has been verified on a Mac (Catalina) and on a Linux (CentOS 7).
```
active environment : base
active env location : /Users/atcold/opt/miniconda3
shell level : 1
user config file : /Users/atcold/.condarc
populated config files : /Users/atcold/.condarc
conda version : 4.7.12
conda-build version : not installed
python version : 3.7.4.final.0
virtual packages :
base environment : /Users/atcold/opt/miniconda3 (writable)
channel URLs : https://conda.anaconda.org/pytorch/osx-64
https://conda.anaconda.org/pytorch/noarch
https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /Users/atcold/opt/miniconda3/pkgs
/Users/atcold/.conda/pkgs
envs directories : /Users/atcold/opt/miniconda3/envs
/Users/atcold/.conda/envs
platform : osx-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Darwin/19.0.0 OSX/10.15
UID:GID : 501:20
netrc file : None
offline mode : False
```
```
active environment : base
active env location : /home/us441/vlad/miniconda3
shell level : 1
user config file : /home/us441/.condarc
populated config files :
conda version : 4.7.12
conda-build version : not installed
python version : 3.7.3.final.0
virtual packages :
base environment : /home/us441/vlad/miniconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/us441/vlad/miniconda3/pkgs
/home/us441/.conda/pkgs
envs directories : /home/us441/vlad/miniconda3/envs
/home/us441/.conda/envs
platform : linux-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.3 Linux/3.10.0-1062.1.2.el7.x86_64 centos/7.7.1908 glibc/2.17
UID:GID : 9007:9007
netrc file : None
offline mode : False
```
👍React with 👍56
vladisai, felixlaumon, ktmud, ankur-gos, sheauren and 51 more
❤️React with ❤️1
Sfeng666
## Activity
[Next](https://github.com/conda/conda/issues/9392?timeline_page=1)
[](https://github.com/msarahan)
### msarahan commented on Oct 30, 2019
[](https://github.com/msarahan)
[msarahan](https://github.com/msarahan)
[on Oct 30, 2019](https://github.com/conda/conda/issues/9392#issuecomment-548074250)
Contributor
Please provide the info requested by the issue template. The conda version in particular is important.
👍React with 👍1
Atcold
[](https://github.com/Atcold)
### Atcold commented on Oct 30, 2019
[](https://github.com/Atcold)
[Atcold](https://github.com/Atcold)
[on Oct 30, 2019](https://github.com/conda/conda/issues/9392#issuecomment-548081218)
Author
[@msarahan](https://github.com/msarahan), added `conda info` for both Mac and Linux machines we're experiencing this issue.
Let me know if you need any further information.
[](https://github.com/msarahan)
### msarahan commented on Oct 31, 2019
[](https://github.com/msarahan)
[msarahan](https://github.com/msarahan)
[on Oct 31, 2019](https://github.com/conda/conda/issues/9392#issuecomment-548179771)
Contributor
Thanks. We'll try to look at this soon.
👍React with 👍3
Atcold, ankur-gos and nolanimage
[msarahan](https://github.com/msarahan)
added
[type::bugdescribes erroneous operation, use severity::\* to classify the type](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22type%3A%3Abug%22)describes erroneous operation, use severity::\* to classify the type
[on Oct 31, 2019](https://github.com/conda/conda/issues/9392#event-2758163378)
[](https://github.com/ndevenish)
### ndevenish commented on Feb 20, 2020
[](https://github.com/ndevenish)
[ndevenish](https://github.com/ndevenish)
[on Feb 20, 2020](https://github.com/conda/conda/issues/9392#issuecomment-589018987)
I have this issue also, conda 4.8.2. I want to use conda for python, but don't want it to be the default system python. My bashrc block is of the form:
```
# >>> conda initialize >>>
...
# <<< conda initialize <<<
export PATH=/my/custom/python/bin:$PATH
```
I've found that I can get the expected behaviour by stripping out the `conda initialize` block and replacing it with purely:
```
. "/path/to/working/modules/miniconda3/etc/profile.d/conda.sh"
```
With default `conda init` block in bashrc:
```
$ which python3
/my/custom/python/bin/python3
$ conda activate conda_base/
$ which python3
/my/custom/python/bin/python3
```
However with the stripped down `conda.sh` only:
```
$ which python3
/my/custom/python/bin/python3
$ conda activate conda_base/
$ which python3
/path/to/working/dist3/conda_base/bin/python3
```
`conda info`:
```
active environment : base
active env location : /path/to/working/modules/miniconda3
shell level : 1
user config file : /home/username/.condarc
populated config files : /home/username/.condarc
conda version : 4.8.2
conda-build version : not installed
python version : 3.7.4.final.0
virtual packages : __cuda=10.1
__glibc=2.17
base environment : /path/to/working/modules/miniconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /path/to/working/modules/miniconda3/pkgs
/home/username/.conda/pkgs
envs directories : /path/to/working/modules/miniconda3/envs
/home/username/.conda/envs
platform : linux-64
user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.4 Linux/3.10.0-1062.1.2.el7.x86_64 rhel/7.6 glibc/2.17
UID:GID : 1210865:1210865
netrc file : None
offline mode : False
```
👍React with 👍2
maddyonline and javadba
[](https://github.com/shoemakerdr)
### shoemakerdr commented on Apr 21, 2020
[](https://github.com/shoemakerdr)
[shoemakerdr](https://github.com/shoemakerdr)
[on Apr 21, 2020](https://github.com/conda/conda/issues/9392#issuecomment-617345019)
· edited by [shoemakerdr](https://github.com/shoemakerdr)
Edits
We ran into this problem at my job. We create static, versioned conda distributions rather than updating in place, so we've had issues with old conda dists to staying around in the path.
The way we've worked around it is by removing all previous conda dists from the path (most people probably won't have this issue unless they have multiple condas) and to put `unset CONDA_SHLVL` before the conda initialize block in our `.bashrc` files. This allows [this block of code from conda.sh](https://github.com/conda/conda/blob/master/conda/shell/etc/profile.d/conda.sh#L104) to set up the pathing properly. Note: one issue we've run into with this fix is if you re-source your .bashrc with an activated non-base conda environment, it'll reset it back to the base env, which may/may not be desirable behavior.
Not sure if this is the most effective solution. Maybe conda could provide a config setting like "always\_reset\_conda\_shell" in `.condarc`? I can submit a PR if that's something you think could be of value. It would certainly help us.
Thanks\!
👍React with 👍39
mattolenik, hujiayu, HYPJUDY, jerlich, jonashaag and 34 more
👎React with 👎2
SilverSulfide and diandianzd
🎉React with 🎉12
mattolenik, Atcold, hujiayu, jggatter, ShoufaChen and 7 more
🚀React with 🚀1
ShoufaChen
[](https://github.com/maximilianh)
### maximilianh commented on Apr 23, 2020
[](https://github.com/maximilianh)
[maximilianh](https://github.com/maximilianh)
[on Apr 23, 2020](https://github.com/conda/conda/issues/9392#issuecomment-618407664)
Thanks! unset CONDA\_SHLVL totally worked for me. I've been suffering from this for a while.
👍React with 👍16
shoemakerdr, mattolenik, dmontagu, hujiayu, jggatter and 11 more
🎉React with 🎉1
mattolenik
[](https://github.com/nikitakuklev)
### nikitakuklev commented on Apr 26, 2020
[](https://github.com/nikitakuklev)
[nikitakuklev](https://github.com/nikitakuklev)
[on Apr 26, 2020](https://github.com/conda/conda/issues/9392#issuecomment-619473691)
Seconded - good fix! Solved my somewhat related issues with byobu paths and conda environments.
👍React with 👍1
shoemakerdr
[](https://github.com/mattolenik)
### mattolenik commented on May 6, 2020
[](https://github.com/mattolenik)
[mattolenik](https://github.com/mattolenik)
[on May 6, 2020](https://github.com/conda/conda/issues/9392#issuecomment-624898972)
Also working for me, thank you [@shoemakerdr](https://github.com/shoemakerdr)\!
👍React with 👍1
shoemakerdr
[](https://github.com/Atcold)
### Atcold commented on May 7, 2020
[](https://github.com/Atcold)
[Atcold](https://github.com/Atcold)
[on May 7, 2020](https://github.com/conda/conda/issues/9392#issuecomment-625048061)
Author
[@msarahan](https://github.com/msarahan), what do you say?
[bernt-matthias](https://github.com/bernt-matthias)
mentioned this
[on Jun 15, 2020](https://github.com/conda/conda/issues/9392#event-1037852676)
- [disable activation of galaxy venv for jobs galaxyproject/galaxy\#9335](https://github.com/galaxyproject/galaxy/pull/9335)
[](https://github.com/dorianj)
### dorianj commented on Aug 6, 2020
[](https://github.com/dorianj)
[dorianj](https://github.com/dorianj)
[on Aug 6, 2020](https://github.com/conda/conda/issues/9392#issuecomment-670061971)
I'm seeing this on a default miniconda 4.8.2, adding `conda deactivate` to my `.zshenv` worked. I have no idea what about my configuration causes this bug to surface, my setup is pretty vanilla
[](https://github.com/Atcold)
### Atcold commented on Aug 8, 2020
[](https://github.com/Atcold)
[Atcold](https://github.com/Atcold)
[on Aug 8, 2020](https://github.com/conda/conda/issues/9392#issuecomment-670966836)
Author
[@msarahan](https://github.com/msarahan), any update?
👍React with 👍2
JaGarRod and mustafa-guler
[](https://github.com/aanousakis)
### aanousakis commented on Sep 22, 2020
[](https://github.com/aanousakis)
[aanousakis](https://github.com/aanousakis)
[on Sep 22, 2020](https://github.com/conda/conda/issues/9392#issuecomment-696897058)
I noticed that it works if i install a packet when i create the environment.
`antony@antony-fedora : ~/Workspace/tmp : which python`
`/usr/bin/python`
`antony@antony-fedora : ~/Workspace/tmp : conda create --name my_env`
`antony@antony-fedora : ~/Workspace/tmp : conda activate my_env`
`(my_env) antony@antony-fedora : ~/Workspace/tmp : which python`
`/usr/bin/python`
`(my_env) antony@antony-fedora : ~/Workspace/tmp : conda create --name my_env pip`
`(my_env) antony@antony-fedora : ~/Workspace/tmp : conda activate my_env`
`(my_env) antony@antony-fedora : ~/Workspace/tmp : which python`
`~/anaconda3/envs/my_env/bin/python`
👍React with 👍27
tazihad, ShuchitaBanthia, HimariO, mtdot, CharlesB2 and 22 more
😄React with 😄2
nick-brady and yongzx
🎉React with 🎉9
tazihad, ShuchitaBanthia, CharlesB2, amogh112, submagr and 4 more
❤️React with ❤️8
tazihad, CharlesB2, amogh112, submagr, rhimanshu909 and 3 more
🚀React with 🚀9
tazihad, CharlesB2, amogh112, submagr, rhimanshu909 and 4 more
👀React with 👀1
nick-brady
[](https://github.com/mufernando)
### mufernando commented on Sep 23, 2020
[](https://github.com/mufernando)
[mufernando](https://github.com/mufernando)
[on Sep 23, 2020](https://github.com/conda/conda/issues/9392#issuecomment-697997301)
This has been an issue for me with `conda 4.8.2`.
I confirmed this only happens when you create an environment without specifying any additional packages. Also, adding `conda deactivate` to the end of my `.zshenv` fixed it.
👍React with 👍4
JaGarRod, amogh112, kristopherjohnson and okeeffdp
### 30 remaining items
Load more
[kenodegard](https://github.com/kenodegard)
added this to
[🧭 Planning](https://github.com/orgs/conda/projects/2)
[on Oct 24, 2022](https://github.com/conda/conda/issues/9392#event-15230494395)
[kenodegard](https://github.com/kenodegard)
added
[type::supportneither a bug nor feature, is really just a user having questions or difficulty somewhere](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22type%3A%3Asupport%22)neither a bug nor feature, is really just a user having questions or difficulty somewhere
and removed
[type::bugdescribes erroneous operation, use severity::\* to classify the type](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22type%3A%3Abug%22)describes erroneous operation, use severity::\* to classify the type
[on Oct 25, 2022](https://github.com/conda/conda/issues/9392#event-7658740200)
[](https://github.com/kcarnold)
### kcarnold commented on Oct 25, 2022
[](https://github.com/kcarnold)
[kcarnold](https://github.com/kcarnold)
[on Oct 25, 2022](https://github.com/conda/conda/issues/9392#issuecomment-1290639602)
Two ideas:
1. `conda activate` could check PATH modifications and warn if anything was changed outside of its control.
2. `conda init` could be more proactive in preventing this in shell conf-files. At minimum, it could leave a note suggesting that modifications to `PATH` and similar variables not be placed after its block.
[](https://github.com/kenodegard)
### kenodegard commented on Oct 25, 2022
[](https://github.com/kenodegard)
[kenodegard](https://github.com/kenodegard)
[on Oct 25, 2022](https://github.com/conda/conda/issues/9392#issuecomment-1291041085)
Contributor
## TL;DR
Conda respects your `PATH` order and will not reorder anything upon activation/deactivation but instead finds the currently active environment and replaces it with the new environment.
**This is not a bug but expected behavior.**
Because of this, moving the conda initialization block to the bottom of your shell profile is the recommended solution (kudos to [@Tu-Zhenzhao](https://github.com/Tu-Zhenzhao) and [@kcarnold](https://github.com/kcarnold) for figuring this out).
## Discussion
Several other issues are being raised, which made this more confusing than necessary. I will attempt to answer all of the unique issues. If you continue to encounter problems, please open a new issue.
1. [@ndevenish](https://github.com/ndevenish) [PATH not set by conda activate \#9392 (comment)](https://github.com/conda/conda/issues/9392#issuecomment-589018987)
> I want to use conda for python, but don't want it to be the default system python.
You'd be better off preventing the base environment from being activated on startup:
```
conda config --set auto_activate_base false
```
That way, your default Python will be the system Python, and you can choose when to activate an environment and use a conda Python.
2. [@shoemakerdr](https://github.com/shoemakerdr) [@maximilianh](https://github.com/maximilianh) [@nikitakuklev](https://github.com/nikitakuklev) [@mattolenik](https://github.com/mattolenik) [PATH not set by conda activate \#9392 (comment)](https://github.com/conda/conda/issues/9392#issuecomment-617345019)
> put `unset CONDA_SHLVL` before the conda initialize block in our `.bashrc` files
Sounds like a sub-shelling issue. You probably have something like `export PATH="/usr/bin:$PATH"` in your shell profile that causes issues for sub-shells. I'd suggest adding proper fencing around these exports, e.g.:
```
[[ ":$PATH:" != *":/usr/bin:"* ]] && export PATH="/usr/bin:$PATH"
```
Adding `unset CONDA_SHLVL` anywhere else in your shell profile after the conda initialization block may appear to work but can lead to other issues. It makes conda think that no environment was previously activated, so when you activate another environment, it will simply prepend the new environment to the front of your `PATH`. In other words, both the new active environment and the `base` environment will be on your `PATH` simultaneously and can cause weird behaviors.
3. [@shoemakerdr](https://github.com/shoemakerdr) [PATH not set by conda activate \#9392 (comment)](https://github.com/conda/conda/issues/9392#issuecomment-617345019)
> Maybe conda could provide a config setting like "always\_reset\_conda\_shell" in .condarc?
Re-sourcing the shell profile problem is likely best solved by adding a conditional fence around the conda initialization block. If this is still something you'd find valuable, we'd greatly appreciate it if you could open a new issue and outline the problem and use case.
Additionally, multiuser setups have found value in using tools like TCL or LMOD (see [Document using `conda init` for TCL/LMOD \#11087](https://github.com/conda/conda/issues/11087)); you may find value in using this for multiconda setups as well for easier toggling between conda versions.
4. [@aanousakis](https://github.com/aanousakis) [@mufernando](https://github.com/mufernando) [@ShuchitaBanthia](https://github.com/ShuchitaBanthia) [PATH not set by conda activate \#9392 (comment)](https://github.com/conda/conda/issues/9392#issuecomment-696897058)
> I noticed that it works if i install a packet when i create the environment.
Correct. [@bernt-matthias](https://github.com/bernt-matthias) ([PATH not set by conda activate \#9392 (comment)](https://github.com/conda/conda/issues/9392#issuecomment-731220657)) and [@CharlesB2](https://github.com/CharlesB2) ([PATH not set by conda activate \#9392 (comment)](https://github.com/conda/conda/issues/9392#issuecomment-790476582)) are both spot on.
If you create a conda environment without specifying any packages, it will be an empty environment; not even Python will be installed. With an empty environment active, running `python` will use another version available on your `PATH` (most likely the system version).
5. For those who used the `conda deactivate` fix. This is effectively the same as the first answer above:
```
conda config --set auto_activate_base false
```
👍React with 👍4
bernt-matthias, jykr, psilabs-dev and AlexandraMocanu
🎉React with 🎉1
jykr
[kenodegard](https://github.com/kenodegard)
closed this as [not planned](https://github.com/conda/conda/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned)
[on Oct 25, 2022](https://github.com/conda/conda/issues/9392#event-7666631411)
[kenodegard](https://github.com/kenodegard)
moved this to Done in
[🧭 Planning](https://github.com/orgs/conda/projects/2)
[on Oct 25, 2022](https://github.com/conda/conda/issues/9392)
[sanderpick](https://github.com/sanderpick)
mentioned this
[on Jul 9, 2023](https://github.com/conda/conda/issues/9392#event-1299094726)
- [Bug report. Installation fail. pyannote/pyannote-audio\#1388](https://github.com/pyannote/pyannote-audio/issues/1388)
[](https://github.com/ThomasBourgeois)
### ThomasBourgeois commented on Aug 12, 2023
[](https://github.com/ThomasBourgeois)
[ThomasBourgeois](https://github.com/ThomasBourgeois)
[on Aug 12, 2023](https://github.com/conda/conda/issues/9392#issuecomment-1676119740)
Sorry guys,
How can you say this is expected behaviour when the environment seems to be activated (with it's name in parenthesis) and is in fact not?
Messed up an environment like this, installing packages somewhere I shouldn't have..
[bio-la](https://github.com/bio-la)
mentioned this
[on Aug 31, 2023](https://github.com/conda/conda/issues/9392#event-1312222742)
- [why sourcing the bashrc profile on cluster? cgat-developers/cgat-core\#172](https://github.com/cgat-developers/cgat-core/issues/172)
[leoisl](https://github.com/leoisl)
mentioned this
[on Nov 27, 2023](https://github.com/conda/conda/issues/9392#event-1334700084)
- [Plasnet integration PR series (2/n): refactor: adding CLI to 4 python scripts iqbal-lab-org/pling\#34](https://github.com/iqbal-lab-org/pling/pull/34)
[](https://github.com/kmahyyg)
### kmahyyg commented on Jan 14, 2024
[](https://github.com/kmahyyg)
[kmahyyg](https://github.com/kmahyyg)
[on Jan 14, 2024](https://github.com/conda/conda/issues/9392#issuecomment-1890903666)
· edited by [kmahyyg](https://github.com/kmahyyg)
Edits
Now in 2024, with fresh installation of miniconda on Mac OS via iTerm2, still suffers from this issue.
Now `conda initialization` code block is automatically placed on the bottom of `.zshrc` when installation.
Even I disabled auto-activate base on start, manually `conda activate another_env_instead_of_base` will NOT replace `python3` path.
However, `conda activate base` will replace `python3` path.
This is what happened:
```
❯ which python3
/usr/bin/python3
❯ conda env list
# conda environments:
#
base /Users/username_here/Developer/miniconda3
invguide /Users/username_here/Developer/miniconda3/envs/invguide
msftcloud /Users/username_here/Developer/miniconda3/envs/msftcloud
❯ conda activate msftcloud
❯ which python3
/usr/bin/python3
❯ conda activate base
❯ which python3
/Users/username_here/Developer/miniconda3/bin/python3
```
~~I read all above, but still can't figure out a solution. Could someone please help me?~~
- Update 1: If I activate `base` or `invguide` , the `python3` path is updated correctly. But with newly created `msftcloud`, this won't working. I created `msftcloud` using `conda create -n msftcloud`, it's weird.
- Update 2: Newly created conda environment does NOT contain any packages, it even does not inherit packages and python interpreter from `base`, so if you'd like to include `python3`, check: <https://stackoverflow.com/questions/43145667/anaconda-is-not-creating-full-environment> , and re-create environment using something like: `conda create -n msftcloud python=3.11`, then activate this newly created environment.
- Update 3: To permanently "solve" this issue: check
[PATH not set by conda activate \#9392 (comment)](https://github.com/conda/conda/issues/9392#issuecomment-790476582)
[larsoner](https://github.com/larsoner)
mentioned this
[on Jun 3, 2024](https://github.com/conda/conda/issues/9392#event-1393847341)
- [DOC/BLD: Build uses python3 from wrong env scipy/scipy\#20877](https://github.com/scipy/scipy/issues/20877)
[github-actions](https://github.com/apps/github-actions)
added
[locked\[bot\] locked due to inactivity](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22locked%22)\[bot\] locked due to inactivity
[on Aug 21, 2024](https://github.com/conda/conda/issues/9392#event-13954709585)
[github-actions](https://github.com/apps/github-actions)
locked as resolved and limited conversation to collaborators
[on Aug 21, 2024](https://github.com/conda/conda/issues/9392#event-13954709753)
[Sign up for free](https://github.com/signup?return_to=https://github.com/conda/conda/issues/9392) **to join this conversation on GitHub.** Already have an account? [Sign in to comment](https://github.com/login?return_to=https://github.com/conda/conda/issues/9392)
## Metadata
## Metadata
### Assignees
No one assigned
### Labels
[clipertains to the CLI interface](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22cli%22)pertains to the CLI interface[locked\[bot\] locked due to inactivity](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22locked%22)\[bot\] locked due to inactivity[source::communitycatch-all for issues filed by community members](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22source%3A%3Acommunity%22)catch-all for issues filed by community members[type::supportneither a bug nor feature, is really just a user having questions or difficulty somewhere](https://github.com/conda/conda/issues?q=state%3Aopen%20label%3A%22type%3A%3Asupport%22)neither a bug nor feature, is really just a user having questions or difficulty somewhere
### Type
No type
### Projects
[🧭 Planning](https://github.com/orgs/conda/projects/2)
Status
🏁 Done
Show more project fields
### Milestone
No milestone
### Relationships
None yet
### Development
Code with agent mode
Select code repository
No branches or pull requests
### Participants
[](https://github.com/kcarnold)[](https://github.com/msarahan)[](https://github.com/dorianj)[](https://github.com/maximilianh)[](https://github.com/CharlesB2)
\+23
## Issue actions
## Footer
© 2025 GitHub, Inc.
### Footer navigation
- [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
- [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
- [Security](https://github.com/security)
- [Status](https://www.githubstatus.com/)
- [Docs](https://docs.github.com/)
- [Contact](https://support.github.com/?tags=dotcom-footer)
- Manage cookies
- Do not share my personal information
You can’t perform that action at this time.
PATH not set by conda activate · Issue \#9392 · conda/conda |
| Readable Markdown | null |
| Shard | 174 (laksa) |
| Root Hash | 6325672905007345774 |
| Unparsed URL | com,github!/conda/conda/issues/9392 s443 |