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

pipenv doesn't understand some version markers #1790

Closed
asherf opened this issue Mar 19, 2018 · 9 comments
Closed

pipenv doesn't understand some version markers #1790

asherf opened this issue Mar 19, 2018 · 9 comments

Comments

@asherf
Copy link
Contributor

asherf commented Mar 19, 2018

Pipenv fails to parse some python version markers
given this Pipfile:


[[source]]
name = "pypi"
verify_ssl = true
url = "https://pypi.python.org/simple"

[packages]

[dev-packages]
coverage = "*"

[requires]
python_version = "3.5"

when running pipenv internally runs resolver.py it fails because it is unable to properly parse the version markers of the coverage packages.
so given that Pipfile if I run pipenv lock it crashes (exit code 1) because resolver.py fails

here is part of the output from running pipenv lock --verbose

                         ROUND 16
Current constraints:
  coverage==4.5.1

Finding the best candidates:
  found candidate coverage==4.5.1 (constraint was ==4.5.1)

Finding secondary dependencies:

New dependencies found in this round:
Removed dependencies in this round:
  removing ['coverage', '==4.5.1', '[]']
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 16: not stable

INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): pypi.python.org
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment
INFO:notpip.req.req_set:Collecting coverage==4.5.1
INFO:pip9.download:File was already downloaded /home/afoa/.cache/pipenv/wheels/coverage-4.5.1-cp35-cp35m-manylinux1_x86_64.whl
WARNING:notpip.req.req_set:Ignoring coverage: markers 'python_version == ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,<4"' don't match your environment

environment:


Pipenv version: `'11.8.3'`

Pipenv location: `'/usr/local/lib/python3.5/dist-packages/pipenv'`

Python location: `'/usr/bin/python3'`

Other Python installations in `PATH`:

  - `2.7`: `/usr/bin/python2.7`
  - `2.7`: `/usr/bin/python2.7`
  - `3.5`: `/usr/bin/python3.5m`
  - `3.5`: `/usr/bin/python3.5`

  - `2.7.12`: `/usr/bin/python`
  - `2.7.12`: `/usr/bin/python2`
  - `3.5.2`: `/usr/bin/python3`

PEP 508 Information:


{'implementation_name': 'cpython',
 'implementation_version': '3.5.2',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.4.0-1050-aws',
 'platform_system': 'Linux',
 'platform_version': '#59-Ubuntu SMP Tue Jan 30 19:57:10 UTC 2018',
 'python_full_version': '3.5.2',
 'python_version': '3.5',
 'sys_platform': 'linux'}


System environment variables:

  - `XDG_SESSION_ID`
  - `BYOBU_DARK`
  - `BYOBU_PREFIX`
  - `BYOBU_READLINK`
  - `BYOBU_ACCENT`
  - `BYOBU_BACKEND`
  - `SSH_CONNECTION`
  - `SSH_AUTH_SOCK`
  - `PYTHONUNBUFFERED`
  - `BYOBU_SED`
  - `BYOBU_HIGHLIGHT`
  - `BYOBU_WINDOW_NAME`
  - `BYOBU_TTY`
  - `BYOBU_CONFIG_DIR`
  - `XDG_RUNTIME_DIR`
  - `NO_NPM_FEEDBACK`
  - `LANG`
  - `TMUX`
  - `OLDPWD`
  - `_`
  - `EVENT_NOEPOLL`
  - `PYTHONDONTWRITEBYTECODE`
  - `MAIL`
  - `LOGNAME`
  - `BYOBU_CHARMAP`
  - `GOPATH`
  - `SHLVL`
  - `BYOBU_TIME`
  - `NO_FANMGMT_CLEAN`
  - `FB_USER_ID`
  - `BYOBU_LIGHT`
  - `PS1`
  - `GOBIN`
  - `TERM`
  - `SSH_TTY`
  - `DEVLOCAL`
  - `BYOBU_PAGER`
  - `NO_VE_FEEDBACK`
  - `PIP_PYTHON_PATH`
  - `PATH`
  - `HOME`
  - `BYOBU_ULIMIT`
  - `BYOBU_RUN_DIR`
  - `PWD`
  - `TMUX_PANE`
  - `BYOBU_DISTRO`
  - `BYOBU_DATE`
  - `SHELL`
  - `USER`
  - `SSH_CLIENT`
  - `BYOBU_PYTHON`

Pipenv–specific environment variables:


Debug–specific environment variables:

  - `PATH`: `/home/afoa/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin:/opt/go/bin`
  - `SHELL`: `/bin/bash`
  - `LANG`: `en_US.UTF-8`
  - `PWD`: `/home/afoa/projects/test`


---------------------------

Contents of `Pipfile` ('/home/afoa/projects/test/Pipfile'):

toml
[[source]]
name = "pypi"
verify_ssl = true
url = "https://pypi.python.org/simple"

[packages]

[dev-packages]
coverage = "*"

[requires]
python_version = "3.5"


</details>

I tried to debug the issue, the code responsible for parsing the version markers is running under notpip

@uranusjr
Copy link
Member

Did you manage to find what notpip thinks your environment (the one not matching the markers) is?

@asherf
Copy link
Contributor Author

asherf commented Mar 19, 2018

it is either the evaluation logic not handling this marker properly. or the logic that parses the markers (loaded from the coverage package) doesn't parse it correctly.
basically, it tries to use the equals operator and the rhs of the expression is >=2.6
so it fails because the comparison being made is basically "3.5" == ">=2.6"

@techalchemy
Copy link
Member

@asherf I've typically seen errors pop up like this when there are conflicts between the installation path of pipenv and python (e.g. /usr/bin and /usr/local/bin) where the latter doesn't have the former on its search path. Does it work if you invoke with python3 -m pipenv install?

@asherf
Copy link
Contributor Author

asherf commented Mar 20, 2018

/usr/local/bin/pipenv
pnw-dev-afoa~/projects/test:yoyoma$ which python3
/usr/bin/python3

yep. that seems to be the case.
running it like you suggested (w/ lock not install pipenv command) yields the same result.
however, I don't see a python interpreter in /usr/local/bin/

@techalchemy
Copy link
Member

No there wouldn't be, can you run pipenv lock --clear --verbose or pipenv-resolver --clear --verbose coverage? If you're still having an issue I'd recommend uninstalling pipenv and installing it in user isolation from master: python3 -m pip uninstall pipenv && python3 -m pip install --user --no-cache-dir --ignore-installed -e git+https://github.com/pypa/pipenv.git#egg=pipenv and then make sure you have ~/.local/bin on your $PATH: export PATH="$HOME/.local/bin:$PATH" and see if you

@asherf
Copy link
Contributor Author

asherf commented Mar 20, 2018

@techalchemy sounds good. I'll try that.

@techalchemy
Copy link
Member

Sorry for the trouble & thanks for jumping through these hoops!

@asherf
Copy link
Contributor Author

asherf commented Mar 20, 2018

@techalchemy the solution you suggested solved the problem...
so feel free to close this issue... it is still weird to me that in certain scenarios the package markers are not parsed correctly... but then again... python packaging 🤷‍♂️
https://twitter.com/kennethreitz/status/973702528989908992

@techalchemy
Copy link
Member

@asherf we actually had a bug in our resolver (fixed in #1808) which I suspect was the culprit here 👍 thanks for your help!

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

3 participants