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

Environment.yml without pip makes conda throw exception #4985

Closed
nehaljwani opened this issue Apr 2, 2017 · 2 comments
Closed

Environment.yml without pip makes conda throw exception #4985

nehaljwani opened this issue Apr 2, 2017 · 2 comments
Assignees
Labels
good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward locked [bot] locked due to inactivity severity::3 major; broken functionality with a workaround source::anaconda created by members of Anaconda, Inc. type::bug describes erroneous operation, use severity::* to classify the type

Comments

@nehaljwani
Copy link
Contributor

Create an environment.yml file with at least one pip package as dependency.

(root) [root@5099f186ec7f ~]# cat /tmp/batcave.yml           
name: justice_league
dependencies:
  - pip:
    - supermann==3.2.0

Now try to create an environment using this file:

(root) [root@5099f186ec7f ~]# conda env create -f /tmp/batcave.yml                                                                                                                                                 
Fetching package metadata .........
Solving package specifications: An unexpected error has occurred.

Current conda install:

               platform : linux-64
          conda version : 4.3.11
       conda is private : False
      conda-env version : 4.3.11
    conda-build version : not installed
         python version : 2.7.13.final.0
       requests version : 2.12.4
       root environment : /conda  (writable)
    default environment : /conda
       envs directories : /conda/envs
                          /root/.conda/envs
          package cache : /conda/pkgs
                          /root/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /root/.condarc
           offline mode : False
             user-agent : conda/4.3.11 requests/2.12.4 CPython/2.7.13 Linux/4.8.6-300.fc25.x86_64 CentOS/6.8 glibc/2.12
                UID:GID : 0:0

`$ /conda/bin/conda-env create -f /tmp/batcave.yml`

    Traceback (most recent call last):
      File "/conda/lib/python2.7/site-packages/conda/exceptions.py", line 616, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "/conda/lib/python2.7/site-packages/conda_env/cli/main_create.py", line 112, in execute
        installer.install(prefix, pkg_specs, args, env)
      File "/conda/lib/python2.7/site-packages/conda_env/installers/pip.py", line 8, in install
        pip_cmd = pip_args(prefix) + ['install', ] + specs
    TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

Delete the failed environment, add pip as a dependency and try again (which works):

(root) [root@5099f186ec7f ~]# conda env remove -yn justice_league                                                                                                                                                  

Remove all packages in environment /conda/envs/justice_league:

(root) [root@5099f186ec7f ~]# cat /tmp/batcave.yml                                                                                                                                                                 
name: justice_league
dependencies:
  - pip=9.0.1=py27_1
  - pip:
    - supermann==3.2.0
(root) [root@5099f186ec7f ~]# conda env create -f /tmp/batcave.yml                                                                                                                                                 
Fetching package metadata .........
Solving package specifications: .
openssl-1.0.2k 100% |###################################################################################################################################################################| Time: 0:00:00   3.36 MB/s
readline-6.2-2 100% |###################################################################################################################################################################| Time: 0:00:00   6.26 MB/s
sqlite-3.13.0- 100% |###################################################################################################################################################################| Time: 0:00:00   8.64 MB/s
tk-8.5.18-0.ta 100% |###################################################################################################################################################################| Time: 0:00:00  11.57 MB/s
zlib-1.2.8-3.t 100% |###################################################################################################################################################################| Time: 0:00:00  12.55 MB/s
python-2.7.13- 100% |###################################################################################################################################################################| Time: 0:00:01  11.06 MB/s
setuptools-27. 100% |###################################################################################################################################################################| Time: 0:00:00  11.93 MB/s
wheel-0.29.0-p 100% |###################################################################################################################################################################| Time: 0:00:00  15.31 MB/s
pip-9.0.1-py27 100% |###################################################################################################################################################################| Time: 0:00:00  10.68 MB/s
Collecting supermann==3.2.0
  Downloading supermann-3.2.0-py2-none-any.whl
Collecting click>=6.6 (from supermann==3.2.0)
  Downloading click-6.7-py2.py3-none-any.whl (71kB)
    100% |################################| 71kB 493kB/s 
Collecting psutil>=4.3.0 (from supermann==3.2.0)
  Downloading psutil-5.2.1.tar.gz (347kB)
    100% |################################| 348kB 679kB/s 
Collecting blinker>=1.1 (from supermann==3.2.0)
  Downloading blinker-1.4.tar.gz (111kB)
    100% |################################| 112kB 7.5MB/s 
Collecting riemann-client>=6.3.0 (from supermann==3.2.0)
  Downloading riemann_client-6.3.0-py2-none-any.whl
Collecting supervisor<4.0,>=3.0 (from supermann==3.2.0)
  Downloading supervisor-3.3.1.tar.gz (415kB)
    100% |################################| 419kB 3.5MB/s 
Collecting protobuf<4.0.0,>=2.3.0 (from riemann-client>=6.3.0->supermann==3.2.0)
  Using cached protobuf-3.2.0-cp27-cp27mu-manylinux1_x86_64.whl
Collecting meld3>=0.6.5 (from supervisor<4.0,>=3.0->supermann==3.2.0)
  Downloading meld3-1.0.2-py2.py3-none-any.whl
Collecting six>=1.9 (from protobuf<4.0.0,>=2.3.0->riemann-client>=6.3.0->supermann==3.2.0)
  Downloading six-1.10.0-py2.py3-none-any.whl

Expected:
Either throw an error stating that pip hasn't been specified as a dependency, or automatically add pip as dependency whenever any pip package has been specified in the env.yml file.

@kalefranz kalefranz added source::anaconda created by members of Anaconda, Inc. type::bug describes erroneous operation, use severity::* to classify the type labels May 8, 2017
@kalefranz kalefranz added the easy label May 16, 2017
@kalefranz kalefranz added the good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward label Oct 12, 2017
@kalefranz kalefranz added the severity::3 major; broken functionality with a workaround label Feb 28, 2018
@goanpeca
Copy link
Collaborator

goanpeca commented Jun 5, 2018

This does not seem to be an issue at the moment with 4.5.x series. Closing

@goanpeca goanpeca closed this as completed Jun 5, 2018
@goanpeca goanpeca self-assigned this Jun 5, 2018
@github-actions
Copy link

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 Sep 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward locked [bot] locked due to inactivity severity::3 major; broken functionality with a workaround source::anaconda created by members of Anaconda, Inc. type::bug describes erroneous operation, use severity::* to classify the type
Projects
None yet
Development

No branches or pull requests

3 participants