pip 和 conda environment.yml: +: 'NoneType' 和 'list' 不支持的操作数类型



我正在尝试在conda env中安装带有PIP的软件包。因此,我有一个environment.yml文件如下:

name: test-env
dependencies:
    - pip:
        - "git+https://github.com/choldgraf/download"

但是当我运行conda env update --file environment.yml时,我得到:

Using Anaconda API: https://api.anaconda.org
Fetching package metadata .............
Solving package specifications: An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:
# Here some configuration that I omit    
Traceback (most recent call last):
  File "/home/mathurin/anaconda3/lib/python3.5/site-packages/conda/exceptions.py", line 634, in conda_exception_handler
    return_value = func(*args, **kwargs)
  File "/home/mathurin/anaconda3/lib/python3.5/site-packages/conda_env/cli/main_update.py", line 106, in execute
    installer.install(prefix, specs, args, env, prune=args.prune)
  File "/home/mathurin/anaconda3/lib/python3.5/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'

但是,仅在我的Bash控制台中键入pip install git+https://github.com/choldgraf/download工作正常。我在做什么错?

编辑:我的第一个想法是更新Conda。我现在使用4.3.23版,尝试conda update conda产生:

# All requested packages already installed.
# packages in environment at ~/anaconda3:
#
conda                     4.3.23                   py35_0    conda-forge

我也有同样的问题。我找到了解决方案。您必须在配置中至少添加一个依赖关系(我不确定是否必须是PIP)。在我的配置中,我添加了pip=9.0.1=py35_1

name: myenv
channels:
- defaults
dependencies:
- pip=9.0.1=py35_1
- pip:
  - tqdm==4.19.5

所以我认为在您的情况下,这将是:

name: test-env
dependencies:
- pip=9.0.1=py35_1
- pip:
  - "git+https://github.com/choldgraf/download"

最新更新