Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda-build install causes havoc with non-base environment installs! #3813

Closed
dwr-psandhu opened this issue Nov 17, 2019 · 5 comments
Closed
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@dwr-psandhu
Copy link

dwr-psandhu commented Nov 17, 2019

Actual Behavior

Installing conda-build from a "non-base" environment causes havoc with active environments

conda create -n py37 python=3.7
conda activate py37
conda install -n py37 -c conda-forge conda-build

Here is conda info right after the install

(py37) C:\Users\TestConda>conda info

     active environment : base
    active env location : C:\Users\TestConda\Miniconda3\envs\py37
            shell level : 2
       user config file : C:\Users\TestConda\.condarc
 populated config files : C:\Users\TestConda\Miniconda3\envs\py37\.condarc
          conda version : 4.7.12
    conda-build version : 3.18.11
         python version : 3.7.5.final.0
       virtual packages :
       base environment : C:\Users\TestConda\Miniconda3\envs\py37  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
                          https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : C:\Users\TestConda\Miniconda3\envs\py37\pkgs
                          C:\Users\TestConda\.conda\pkgs
                          C:\Users\TestConda\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\TestConda\Miniconda3\envs\py37\envs
                          C:\Users\TestConda\.conda\envs
                          C:\Users\TestConda\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.5 Windows/10 Windows/10.0.17763
          administrator : False
             netrc file : None
           offline mode : False

Expected Behavior

Installing conda-build should respect the current activated environment.

The conda-build package should be installed in the named environment and not switch to base environment.

Steps to Reproduce

conda create -n py37 python=3.7
conda activate py37
conda install -n py37 -c conda-forge conda-build
Output of conda info
(py37) C:\Users\TestConda>conda info

     active environment : base
    active env location : C:\Users\TestConda\Miniconda3\envs\py37
            shell level : 2
       user config file : C:\Users\TestConda\.condarc
 populated config files : C:\Users\TestConda\Miniconda3\envs\py37\.condarc
          conda version : 4.7.12
    conda-build version : 3.18.11
         python version : 3.7.5.final.0
       virtual packages :
       base environment : C:\Users\TestConda\Miniconda3\envs\py37  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
                          https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : C:\Users\TestConda\Miniconda3\envs\py37\pkgs
                          C:\Users\TestConda\.conda\pkgs
                          C:\Users\TestConda\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\TestConda\Miniconda3\envs\py37\envs
                          C:\Users\TestConda\.conda\envs
                          C:\Users\TestConda\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.5 Windows/10 Windows/10.0.17763
          administrator : False
             netrc file : None
           offline mode : False

Workaround

Stay in base when installing into named environment
while in base environment do the install as below

conda activate base
# stay in base environment but install into py37 environment
conda install -n py37 -c defaults -c conda-forge conda-build

References issue

Conda Issue 9445

@chrisjbillington
Copy link

Is it actually conda-build itself that causes the problem, or might it be that conda gets installed to the environment by virtue of being a dependency of conda-build?

@chrisjbillington
Copy link

chrisjbillington commented Feb 3, 2021

Some clarification on the conda-build project would be good - is conda-build intended to be able to run from a non-base environment?

Since it depends on conda, it installs conda to whatever environment it is run from, which I would have thought is pretty non-kosher, and seems to lead to issues like this.

If conda itself is not supposed to be installed in non-base environemnts, and yet conda-build depends on it, I wonder if an appropriate solution is to split the conda package into e.g. conda and libconda, the former containing the CLI entry points and depending on the latter, which would contain the actual Python libraries used by conda-build.

If indeed conda-build is not supposed to be installed in non-base environments, then it should put (links to) its executables in $CONDABIN (or whatever the directory is where conda's executables are) so that when installed in the base environment, it is still in the $PATH even when you have a different environment active.

@chrisjbillington
Copy link

chrisjbillington commented Nov 26, 2021

Another option might be for conda-build to vendor the python libraries from conda, rather than have conda as a dependency.

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Mar 15, 2023
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Apr 15, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to 🏁 Done in 🧭 Planning Apr 15, 2023
@chrisjbillington
Copy link

chrisjbillington commented Apr 15, 2023

It looks like a developer had added this issue to a list of issues that are to be looked at, perhaps it should reopened?

I believe this is still an issue, I might have a go at reproducing it and will comment confirming.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 14, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
Archived in project
Development

No branches or pull requests

2 participants