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

"Could not find a version that matches", but acceptable version listed #2046

Closed
wolph opened this issue Apr 24, 2018 · 9 comments
Closed

"Could not find a version that matches", but acceptable version listed #2046

wolph opened this issue Apr 24, 2018 · 9 comments

Comments

@wolph
Copy link

wolph commented Apr 24, 2018

Very similar to #1802 but there is a difference, I'm not using --pre. This issue is easily and consistently reproducible. I've tried on multiple systems.

Output from $ python -m pipenv.help:

$ python -m pipenv.help output

Pipenv version: '11.10.0'

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

Python location: '/usr/bin/python3.6'

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

  • 3.6: /usr/bin/python3.6m

  • 3.6: /usr/bin/python3.6

  • 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.6.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.4.0-119-generic',
 'platform_system': 'Linux',
 'platform_version': '#143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018',
 'python_full_version': '3.6.5',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • USER
  • LOGNAME
  • HOME
  • PATH
  • MAIL
  • SHELL
  • SSH_CLIENT
  • SSH_CONNECTION
  • SSH_TTY
  • TERM
  • DISPLAY
  • XDG_SESSION_ID
  • XDG_RUNTIME_DIR
  • LANG
  • LANGUAGE
  • SSH_AUTH_SOCK
  • SHLVL
  • PWD
  • OLDPWD
  • GOPATH
  • PYENV_ROOT
  • ANDROID_SDK
  • ANDROID_NDK
  • ROOT_DIR
  • TZ
  • PS1
  • ORIGINAL_PS1
  • RPS1
  • PYTHONSTARTUP
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIPENV_VENV_IN_PROJECT
  • SSH_AGENT_PID
  • LS_OPTIONS
  • GIT_MERGE_AUTOEDIT
  • WORKON_HOME
  • PROJECT_HOME
  • _VIRTUALENVWRAPPER_API
  • VIRTUALENVWRAPPER_SCRIPT
  • KEYTIMEOUT
  • LS_COLORS
  • CLICOLOR
  • LSCOLORS
  • EDITOR
  • HISTFILE
  • FZF_DEFAULT_COMMAND
  • FZF_DEFAULT_OPTS
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH
  • PYTHONUNBUFFERED

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: true

Debug–specific environment variables:

  • PATH: /usr/local/bin:test///go/bin:test///bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:~/bin:test///bin:test///.fzf/bin
  • SHELL: /bin/zsh
  • EDITOR: vim
  • LANG: en_US.UTF-8
  • PWD: test

Contents of Pipfile ('test///workspace/test/Pipfile'):

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

[packages]
eth-account = "*"

[dev-packages]

[requires]
python_version = "3.6"

Expected result

An environment with the package and dependencies installed

Actual result

Consistent warnings about not being able to find matching versions while valid versions are available.

Steps to replicate
# rm -rf ~/.cache Pipfile* .venv
# pipenv install eth-account
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Could not find a version that matches eth-keys<0.3.0,>=0.2.0b3
Tried: 0.1.0b1, 0.1.0b1, 0.1.0b2, 0.1.0b2, 0.1.0b3, 0.1.0b3, 0.1.0b4, 0.1.0b4, 0.2.0b1, 0.2.0b1, 0.2.0b2, 0.2.0b2, 0.2.0b3, 0.2.0b3
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Could not find a version that matches eth-keys<0.3.0,>=0.2.0b3
Tried: 0.1.0b1, 0.1.0b1, 0.1.0b2, 0.1.0b2, 0.1.0b3, 0.1.0b3, 0.1.0b4, 0.1.0b4, 0.2.0b1, 0.2.0b1, 0.2.0b2, 0.2.0b2, 0.2.0b3, 0.2.0b3

Actual output (1500 lines): install.log

@wolph
Copy link
Author

wolph commented Apr 24, 2018

I've done some automated testing and it appears that this broke after 10.0.0, for the time being I'll just run the old version to work around this issue

@techalchemy
Copy link
Member

I'm not using --pre

Could not find a version that matches eth-keys<0.3.0,>=0.2.0b3
Tried: 0.1.0b1, 0.1.0b1, 0.1.0b2, 0.1.0b2, 0.1.0b3, 0.1.0b3, 0.1.0b4, 0.1.0b4, 0.2.0b1, 0.2.0b1, 0.2.0b2, 0.2.0b2, 0.2.0b3, 0.2.0b3

So the valid versions that match this specifier are: 0.2.0b3

That's it.

According to pep 440 this (and anything that has a 'b' or an 'a' or whatever) is a 'prerelease'. So I'll go back to what I quoted before:

I'm not using --pre

Exactly. You're not using --pre. So pipenv will never assume that it's ok to install prereleases. Use --pre if you want to install prereleases.

@wolph
Copy link
Author

wolph commented Apr 24, 2018

That makes sense but in that case the warning should be different and specify that it's not considering the pre-releases.

@techalchemy Should I create a pull request that adds an extra line about the pre-releases? Something like this perhaps:

Could not find a version that matches eth-keys<0.3.0,>=0.2.0b3
Tried: 0.1.0, 0.1.1
Skipped pre-releases: 0.1.0b1, 0.1.0b1

@uranusjr
Copy link
Member

@wolph The suggested change makes sense to me. Go ahead.

@techalchemy
Copy link
Member

I already merged a change that handles this.

https://github.com/pypa/pipenv/pull/2021/files

@wolph
Copy link
Author

wolph commented Apr 24, 2018

Even with that fix I still think the current message is incorrect. It says "Tried: ..." when it actually doesn't even consider them.

I for one completely forgot about the b meaning pre-release and I'm probably not the only one.

@techalchemy
Copy link
Member

@wolph yes the current message is still incorrect, because it isn't released yet. I don't think we need to overcomplicate this messaging too much since if it didn't install anything, technically it didn't try anything. The fact of the matter is NOTHING matched your version specifiers, so literally everything was skipped including the prereleases.

@wolph
Copy link
Author

wolph commented Apr 24, 2018

I understand how the other fix might help a bit but I still think you'll get issues similar to this one because it's unclear why it's skipping them when they appear perfectly valid options.

Looking at the code I think the change could be fairly simple:

def __str__(self):
sorted_versions = sorted(c.version for c in self.candidates_tried)
lines = [
'Could not find a version that matches {}'.format(self.ireq),
'Tried: {}'.format(', '.join(str(version) for version in sorted_versions) or '(no version found at all)')
]
if sorted_versions:
lines.append('There are incompatible versions in the resolved dependencies.')
else:
lines.append('{} {} reachable?'.format(
'Were' if len(self.index_urls) > 1 else 'Was', ' or '.join(self.index_urls))
)
return '\n'.join(lines)

@techalchemy
Copy link
Member

There is a version evaluator that will tell you if it's a pre-release. I'd recommend PR'ing it up to pip-tools and then we can have @vphilippon review it there.

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