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

Creating environment with some pip arguments (which are not supported in requirements.txt) broken in 4.4+ #7290

Open
1 of 2 tasks
mkobit opened this issue May 14, 2018 · 7 comments
Labels
stale::recovered [bot] recovered after being marked as stale

Comments

@mkobit
Copy link

mkobit commented May 14, 2018

Broken in #3969 , specifically ebd0f1a

First breakage is that the lines used to just be "appended" and supplied to pip, so something like

name: "myenv"
dependencies:
- "python=3.6"
- "pip=10.0.1"
- "requests=2.18.4"
- pip:
  - "--index-url"
  - "https://corp.repo/pypi-internal/"
  - "pyyaml==3.11"

worked. Now, it would produce something like pip: error: --index-url option requires an argument due to the changes mentioned above. To work now, it is now required to be "--index-url https://corp.repo/pypi-internal"

Second breakage is that arguments supported by pip CLI are not supported by the requirements.txt file format, so arguments like:

name: "myenv"
dependencies:
- "python=3.6"
- "pip=10.0.1"
- "requests=2.18.4"
- pip:
  - "pyyaml==3.11"
  - "--retries"
  - 3
  - "--timeout"
  - 60

worked. With the changes mentioned above, other options like --proxy, --trusted-host, etc. (from here) cannot be used.

I'm submitting a...

  • bug report
  • feature request

Current Behavior

Installing of pip fails due to unsupported options

Steps to Reproduce

cat << EOF > /tmp/myenv.yaml
name: "myenv"
dependencies:
- "python=3.6"
- "pip=10.0.1"
- "requests=2.18.4"
- pip:
  - "--retries 3"
  - "--timeout 60"
EOF
conda create --prefix /tmp/myenv --yes
conda env update --prune --prefix /tmp/myenv --file /tmp/myenv.yaml

Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.1
  latest version: 4.5.3

Please update conda by running

    $ conda update -n base conda



Downloading and Extracting Packages
pip 10.0.1################################################################################################################################################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Usage: pip [options]

Invalid requirement: --retries 3
pip: error: no such option: --retries

Expected Behavior

Using pip arguments that are supported by pip but not in a requirements.txt should continue to be successful.

Environment Information

`conda info`

     active environment : None
       user config file : /home/mkobit/.condarc
 populated config files : 
          conda version : 4.5.1
    conda-build version : not installed
         python version : 3.6.5.final.0
       base environment : /home/mkobit/Workspace/code-lab/miniconda  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/linux-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /home/mkobit/Workspace/code-lab/miniconda/pkgs
                          /home/mkobit/.conda/pkgs
       envs directories : /home/mkobit/Workspace/code-lab/miniconda/envs
                          /home/mkobit/.conda/envs
               platform : linux-64
             user-agent : conda/4.5.1 requests/2.18.4 CPython/3.6.5 Linux/4.13.0-41-generic ubuntu/16.04 glibc/2.23
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

`conda config --show-sources`


`conda list --show-channel-urls`

# packages in environment at /home/mkobit/code-lab/miniconda:
#
# Name                    Version                   Build  Channel
asn1crypto                0.24.0                   py36_0    defaults
ca-certificates           2018.03.07                    0    defaults
certifi                   2018.4.16                py36_0    defaults
cffi                      1.11.5           py36h9745a5d_0    defaults
chardet                   3.0.4            py36h0f667ec_1    defaults
conda                     4.5.1                    py36_0    defaults
conda-env                 2.6.0                h36134e3_1    defaults
cryptography              2.2.2            py36h14c3975_0    defaults
idna                      2.6              py36h82fb2a8_1    defaults
libedit                   3.1                  heed3624_0    defaults
libffi                    3.2.1                hd88cf55_4    defaults
libgcc-ng                 7.2.0                hdf63c60_3    defaults
libstdcxx-ng              7.2.0                hdf63c60_3    defaults
ncurses                   6.0                  h9df7e31_2    defaults
openssl                   1.0.2o               h20670df_0    defaults
pip                       9.0.3                    py36_0    defaults
pycosat                   0.6.3            py36h0a5515d_0    defaults
pycparser                 2.18             py36hf9f622e_1    defaults
pyopenssl                 17.5.0           py36h20ba746_0    defaults
pysocks                   1.6.8                    py36_0    defaults
python                    3.6.5                hc3d631a_0    defaults
readline                  7.0                  ha6073c6_4    defaults
requests                  2.18.4           py36he2e5f8d_1    defaults
ruamel_yaml               0.15.35          py36h14c3975_1    defaults
setuptools                39.0.1                   py36_0    defaults
six                       1.11.0           py36h372c433_1    defaults
sqlite                    3.23.1               he433501_0    defaults
tk                        8.6.7                hc745277_3    defaults
urllib3                   1.22             py36hbe7ace6_0    defaults
wheel                     0.31.0                   py36_0    defaults
xz                        5.2.3                h55aa19d_2    defaults
yaml                      0.1.7                had09818_2    defaults
zlib                      1.2.11               ha838bed_2    defaults

@mkobit mkobit changed the title Creating environment with some pip arguments (not supported in requirements.txt) broken in 4.4+ Creating environment with some pip arguments (which are not supported in requirements.txt) broken in 4.4+ May 14, 2018
@sdvillal
Copy link
Contributor

Sorry for the breakage @mkobit.

I think we should first specify what can be done and what is to be expected to happen with pip dependencies declared in an environment definition, which hopefully would happen as a result of #7248. AFAIK there is not much documentation to this respect.

In the meantime, an extension that would hopefully get us back to support anything supported by pip in environment.yml files is outlined here: #6805 (comment). I think that is a similar but slightly more elegant and expressive solution than going back to interpret pip items as parameter lists.

What do you think? Should I open that PR, which would include documentation? As per @kalefranz comments I feel it is likely that it would not be taken into consideration any time soon.

@mkobit
Copy link
Author

mkobit commented May 17, 2018

I think we should first specify what can be done and what is to be expected to happen with pip dependencies declared in an environment definition, which hopefully would happen as a result of #7248. AFAIK there is not much documentation to this respect.

I think some documentation would definitely be helpful until #7248 is done. Right now, we manually generate this YAML file based on some our use cases for creating a consistent environment across different OS/systems and build environments without baking in too much information (e.g. prefix/name). https://conda.io/docs/user-guide/tasks/manage-environments.html#create-env-file-manually is lacking a little bit of information about the format, so maybe saying something like " pip entry must conform to https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format" to state the expectations now until #7248 is done.

In the meantime, an extension that would hopefully get us back to support anything supported by pip in environment.yml files is outlined here: #6805 (comment). I think that is a similar but slightly more elegant and expressive solution than going back to interpret pip items as parameter lists.

The extension would help us in the meantime, but I could see it being a potential usability problem due to the different syntax and also switch on/off functionality. It is up to you guys if you think that it would improve the experience. It looks like it would be a band-aid until #7248 is implemented.

What do you think? Should I open that PR, which would include documentation? As per @kalefranz comments I feel it is likely that it would not be taken into consideration any time soon.

I definitely would appreciate a little bit of documentation, even if all it says is "only supports options from pip requirements file".

Thanks for the quick follow up!

@kylebarron
Copy link

I seem to be having similar issues, however this breaks my pip installation without having any special arguments in the pip section of the environment.yml file.

Here's an offending yaml file:

name: 'temp_environment3'
channels:
    - conda-forge
dependencies:
    - jupyter==1.0.0
    - pip>=10.0.1
    - python=3.6
    - pip:
        - requests-html

So even so much as pip show pip doesn't work:

> pip show pip
Exception:
Traceback (most recent call last):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2862, in _dep_map
    return self.__dep_map
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2669, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString
    raise exc
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_internal/commands/show.py", line 43, in run
    results, list_files=options.files, verbose=options.verbose):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_internal/commands/show.py", line 133, in print_results
    pkg.project_name for pkg in pkg_resources.working_set
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_internal/commands/show.py", line 134, in <listcomp>
    if name in [required.name for required in pkg.requires()]
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2613, in requires
    dm = self._dep_map
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2864, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2874, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2935, in parse_requirements
    yield Requirement(line)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/medicare_utils/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2944, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Note that it does work correctly when I remove jupyter==1.0.0, so maybe the issue is with Jupyter?

Install log:

Solving environment: ...working... done
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... dbus post-link :: /etc/machine-id not found ..
dbus post-link :: .. using /proc/sys/kernel/random/boot_id

Enabling notebook extension jupyter-js-widgets/extension...
      - Validating: �[32mOK�[0m

done
Collecting requests-html (from -r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/d6/bb/54d8db5ac95f34b035b68747d765aadcbbd78687b029b41b39d2a3728f35/requests_html-0.9.0-py2.py3-none-any.whl
Collecting w3lib (from requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/37/94/40c93ad0cadac0f8cb729e1668823c71532fd4a7361b141aec535acb68e3/w3lib-1.19.0-py2.py3-none-any.whl
Collecting bs4 (from requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
Collecting pyppeteer>=0.0.14 (from requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
Collecting fake-useragent (from requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
Requirement already satisfied: requests in /disk/homedirs/barronk-dua51929/.local/lib/python3.6/site-packages (from requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1)) (2.19.1)
Collecting parse (from requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
Collecting pyquery (from requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/09/c7/ce8c9c37ab8ff8337faad3335c088d60bed4a35a4bed33a64f0e64fbcf29/pyquery-1.4.0-py2.py3-none-any.whl
Requirement already satisfied: six>=1.4.1 in /disk/homedirs/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages (from w3lib->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1)) (1.11.0)
Requirement already satisfied: beautifulsoup4 in /disk/homedirs/barronk-dua51929/.local/lib/python3.6/site-packages (from bs4->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1)) (4.6.3)
Collecting pyee (from pyppeteer>=0.0.14->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/8e/06/10c18578e2d8b9cf9902f424f86d433c647ca55e82293100f53e6c0afab4/pyee-5.0.0-py2.py3-none-any.whl
Collecting websockets (from pyppeteer>=0.0.14->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/5c/fe/99aeaf97985585baefca8d56125ec828ef5549276324ec319b63a4da686d/websockets-6.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting tqdm (from pyppeteer>=0.0.14->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/79/43/19c9fee28110cd47f73e6bc596394337fe9f3e5825b4de402bbf30b3beb5/tqdm-4.26.0-py2.py3-none-any.whl
Collecting urllib3 (from pyppeteer>=0.0.14->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl
Collecting appdirs (from pyppeteer>=0.0.14->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl
Collecting idna<2.8,>=2.5 (from requests->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Requirement already satisfied: certifi>=2017.4.17 in /disk/homedirs/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages (from requests->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1)) (2018.8.24)
Collecting chardet<3.1.0,>=3.0.2 (from requests->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting cssselect>0.7.9 (from pyquery->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/7b/44/25b7283e50585f0b4156960691d951b05d061abf4a714078393e51929b30/cssselect-1.0.3-py2.py3-none-any.whl
Collecting lxml>=2.1 (from pyquery->requests-html->-r /disk/agedisk3/medicare.work/doyle-DUA51929/barronk-dua51929/tmp/condaenv.f81pjktf.requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/03/a4/9eea8035fc7c7670e5eab97f34ff2ef0ddd78a491bf96df5accedb0e63f5/lxml-4.2.5-cp36-cp36m-manylinux1_x86_64.whl
Exception:
Traceback (most recent call last):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in _dep_map
    return self.__dep_map
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2663, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1632, in parseString
    raise exc
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3183, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 33), (line:1, col:34)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2949, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'; extra '"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 141, in main
    status = self.run(options, args)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 330, in run
    self._warn_about_conflicts(to_install)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 456, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 98, in check_install_conflicts
    package_set = create_package_set_from_installed()
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 41, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2607, in requires
    dm = self._dep_map
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2871, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2881, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2942, in parse_requirements
    yield Requirement(line)
  File "/homes/nber/barronk-dua51929/local/anaconda3/envs/temp_environment3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2951, in __init__
    raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'; extra '"

CondaValueError: pip returned an error

@bollard
Copy link

bollard commented Apr 1, 2019

Bump on the above. Trying to install a package via Pip hosted in nexus. To get that into an environment.yml I need to pass --extra-index-url and --trusted-host nexus to Pip

@basnijholt
Copy link
Contributor

To circumvent this issue (I want to use --ignore-installed) I now do (in CI):

      csplit -k environment.yml '/- pip:/' '{*}'
      mv xx00 environment_without_requirements_txt.yml
      conda env update --name base --file environment_without_requirements_txt.yml
      pip install --ignore-installed -r requirements.txt

@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

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 in the latest version of Conda

  2. Comment that the issue is still reproducible and include:

  • What version of Conda you reproduced the issue on
  • What OS and version you reproduced the issue on
  • What steps you followed to reproduce the issue
  1. It would also be helpful to have the output of the following commands available:
  • conda info
  • conda config --show-sources
  • conda list --show-channel-urls

NOTE: If this issue was closed prematurely, please leave a comment and we will gladly reopen the issue.

In case this issue was originally about a project that is covered by the Anaconda issue tracker (e.g. Anaconda, Miniconda, packages built by Anaconda, Inc. like Anaconda Navigator etc), please reopen the issue there again.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Nov 21, 2021
@flipphillips
Copy link

I am trying to create an environment using a requirements.txt that I think used to work, but is now crashing again with a -e editable flag, throwing an error:

CondaValueError: could not parse '-e ./depthai_sdk' in: requirements.txt

from https://github.com/luxonis/depthai . The requirements.txt there is a little complicated, full of fun pip syntax, including the -e you see above. I think this is related, possibly, to this breakage.

@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale::recovered [bot] recovered after being marked as stale
Projects
Status: 🆕 New
Development

No branches or pull requests

6 participants