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

Use CONDA_PREFIX instead of CONDA_DEFAULT_ENV to set paths #10

Closed
lpinner opened this issue Aug 4, 2016 · 5 comments
Closed

Use CONDA_PREFIX instead of CONDA_DEFAULT_ENV to set paths #10

lpinner opened this issue Aug 4, 2016 · 5 comments

Comments

@lpinner
Copy link

lpinner commented Aug 4, 2016

In my conda environment CONDA_DEFAULT_ENV is a basename, not a full path so the scripts that exec-wrappers generated 1. do not use absolute paths and 2. are created relative to the directory that conda install -c gqmelo conda-wrappers=0.1.0 was called from.

In addition, the CONDA_PREFIX environment variable (which is an absolute path to the env dir) does not get set, so scripts that use it (I have some in activate.d and deactivate.d) do not work correctly.

A quick example:

C:\Temp\testwrappers>activate.bat py27

(py27) C:\Temp\testwrappers>dir /B

(py27) C:\Temp\testwrappers>set conda
CONDA_DEFAULT_ENV=py27
CONDA_ENVS_PATH=C:\conda
CONDA_PREFIX=C:\conda\py27
CONDA_PS1_BACKUP=$P$G

(py27) C:\Temp\testwrappers>conda install -c gqmelo conda-wrappers=0.1.0
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata .............
Solving package specifications: ..........

Package plan for installation in environment C:\conda\py27:

The following NEW packages will be INSTALLED:

conda-wrappers: 0.1.0-py27_0 gqmelo
exec-wrappers:  0.1.0-py27_0 gqmelo

Proceed ([y]/n)?

Linking packages ...
Creating wrappers from py27\Library\bin to py27\Scripts\wrappers\conda | 50%
Creating wrappers from py27\Scripts to py27\Scripts\wrappers\conda
Creating wrappers from py27 to py27\Scripts\wrappers\conda
[ COMPLETE ]|##################################################| 100%

(py27) C:\Temp\testwrappers>dir /B %CONDA_PREFIX%\Scripts\wrappers
File Not Found

(py27) C:\Temp\testwrappers>dir /B
py27

@gqmelo
Copy link
Owner

gqmelo commented Aug 4, 2016

Hi @lpinner, thanks for reporting it.

Could you tell me what version of conda you are using (conda list conda)?

I suppose it is a very old version as I never saw this CONDA_PREFIX variable.
Since I started using conda a lot has changed on activate/deactivate, but at least on Windows, CONDA_DEFAULT_ENV always pointed to the activated env absolute path

@gqmelo
Copy link
Owner

gqmelo commented Aug 4, 2016

Ok, actually you are probably using the last version.
Apparently they changed again the variables set by the activate script. They removed CONDA_ENV_PATH, changed CONDA_DEFAULT_ENV to be the name again, and introduced CONDA_PREFIX.

@lpinner
Copy link
Author

lpinner commented Aug 11, 2016

Hi @gqmelo

> conda list conda
# packages in environment at Miniconda3:
#
Using Anaconda Cloud api site https://api.anaconda.org
conda                     4.1.11                   py35_0
anaconda-client           1.5.0                    py35_0    conda-forge
conda-env                 2.5.2                    py35_0    conda-forge

@gqmelo
Copy link
Owner

gqmelo commented Aug 11, 2016

Thanks, I've found out that they changed the environment variables again. Please see my comment on #11

@gqmelo
Copy link
Owner

gqmelo commented Sep 29, 2016

Sorry for the delay, this have been fixed by 5e264b0 and already released in PyPI. It should be available in conda-forge soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants