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 fails creation of environment from yaml file #10251

Closed
ViHammer opened this issue Sep 23, 2020 · 2 comments
Closed

Conda fails creation of environment from yaml file #10251

ViHammer opened this issue Sep 23, 2020 · 2 comments
Labels
locked [bot] locked due to inactivity

Comments

@ViHammer
Copy link

Summary

I created an environment, and then exported it to a YAML file. If I then try to create a new environment from this YAML file, Pip fails. The originally created environment works and can be used.
note: file extension of attached file was changed to .txt as I couldnt upload a .yml file.

step by step

creation of environment as described here: https://github.com/Magdoll/cDNA_Cupcake/wiki/Cupcake:-supporting-scripts-for-Iso-Seq-after-clustering-step#collapse

export PATH="/home/anacondaPy37/bin:$PATH"
conda -V
conda update conda
conda create -n anaCogent python=3.7 anaconda
export PATH="/home/anacondaPy37/bin:$PATH"
conda activate anaCogent

$ source activate anaCogent
(anaCogent)$ git clone https://github.com/Magdoll/cDNA_Cupcake.git
(anaCogent)$ cd cDNA_Cupcake
(anaCogent)$ python setup.py build
(anaCogent$ python setup.py install

exporting environment to YAML file

conda env export --name anaCogent > anaCogentOri.yml

creating a new environment from this YAML file

conda env create --file anaCogentOri.yml

this then results in the following Error

Pip subprocess error:
ERROR: Could not find a version that satisfies the requirement cupcake==12.4.0 (from -r /mnt/SRV018/users/ahhammv1/7test/workflow/condaenv.7bfgnkj5.requireme nts.txt (line 3)) (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4)
ERROR: No matching distribution found for cupcake==12.4.0 (from -r /mnt/SRV018/users/ahhammv1/7test/workflow/condaenv.7bfgnkj5.requirements.txt (line 3))
fa iled

CondaEnvException: Pip failed

Potential causes

Pip tries installing a different package than the one wanted, namely cupcake instead of cDNA_cupcake.

anaCogentOri.yml.txt

@chenghlee
Copy link
Contributor

The upstream developers of cDNA_Cupcake gave their package the same name as an existing PyPI package. Because of how Python packaging works, conda is unable to distinguish between a package you pip installed from PyPI and a package you installed using python setup.py install; as such, conda (rightly) assumes that any Python package that did not come from a conda channel came from PyPI:

cDNA_Cupcake $ conda list
# packages in environment at $HOME/.miniconda3-x86_64/envs/gh-test:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
biopython                 1.78                     pypi_0    pypi
blas                      1.0                         mkl    defaults
bx-python                 0.8.9                    pypi_0    pypi
ca-certificates           2020.7.22                     0    defaults
certifi                   2020.6.20                py37_0    defaults
cupcake                   13.0.0                   pypi_0    pypi
cython                    0.29.21          py37he6710b0_0    defaults
intel-openmp              2020.2                      254    defaults
joblib                    0.16.0                   pypi_0    pypi
ld_impl_linux-64          2.33.1               h53a641e_7    defaults
libedit                   3.1.20191231         h14c3975_1    defaults
libffi                    3.3                  he6710b0_2    defaults
libgcc-ng                 9.1.0                hdf63c60_0    defaults
libstdcxx-ng              9.1.0                hdf63c60_0    defaults
mkl                       2020.2                      256    defaults
mkl-service               2.3.0            py37he904b0f_0    defaults
mkl_fft                   1.2.0            py37h23d657b_0    defaults
mkl_random                1.1.1            py37h0573a6f_0    defaults
ncurses                   6.2                  he6710b0_1    defaults
numpy                     1.19.1           py37hbc911f0_0    defaults
numpy-base                1.19.1           py37hfa32c7d_0    defaults
openssl                   1.1.1h               h7b6447c_0    defaults
pip                       20.2.2                   py37_0    defaults
pysam                     0.16.0.1                 pypi_0    pypi
python                    3.7.9                h7579374_0    defaults
readline                  8.0                  h7b6447c_0    defaults
scikit-learn              0.23.2                   pypi_0    pypi
scipy                     1.5.2                    pypi_0    pypi
setuptools                49.6.0                   py37_1    defaults
six                       1.15.0                     py_0    defaults
sklearn                   0.0                      pypi_0    pypi
sqlite                    3.33.0               h62c20be_0    defaults
threadpoolctl             2.1.0                    pypi_0    pypi
tk                        8.6.10               hbc83047_0    defaults
wheel                     0.35.1                     py_0    defaults
xz                        5.2.5                h7b6447c_0    defaults
zlib                      1.2.11               h7b6447c_3    defaults

When you ran conda env export, conda recorded cupcake as having originated from PyPI. When you ran conda env create, conda attempted to install the PyPI cupcake package and failed because no such version (13.0.0) exists (and even if it had succeeded, it would have been the wrong software).

This is the expected behavior from conda (and pretty much any other Python package management tool). To fix this, you will need to contact the authors of cDNA_Cupcake to:

  • Resolve the name conflict
  • Publish to their package to PyPI and/or a conda channel.

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Oct 1, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

2 participants