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 lock is failing due to pytest version errror #4023

Closed
kuwv opened this issue Nov 13, 2019 · 3 comments
Closed

Pipenv lock is failing due to pytest version errror #4023

kuwv opened this issue Nov 13, 2019 · 3 comments
Labels

Comments

@kuwv
Copy link

kuwv commented Nov 13, 2019

Issue description

Unable to create or update lock files due to pytest version issue.

Expected result

Should install packages without version conflicts.

Actual result

pipenv.patched.notpip._internal.exceptions.UnsupportedPythonVersion: pytest requires Python '>=3.5' but the running Python is 2.7.5
File "/home/user/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 85, in _main
    requirements_dir=requirements_dir,
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 69, in resolve
    req_dir=requirements_dir
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
    req_dir=req_dir,
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 274, in _resolve_one
    self.requires_python = check_dist_requires_python(dist, absorb=False)
  File "/home/user/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/utils/packaging.py", line 62, in check_dist_requires_python
    '.'.join(map(str, sys.version_info[:3])),)
pipenv.patched.notpip._internal.exceptions.UnsupportedPythonVersion: pytest requires Python '>=3.5' but the running Python is 2.7.5

Steps to replicate

pip install --user pipenv pytest==4.6
pipenv shell
pipenv install

$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: '/home/user/.local/lib/python2.7/site-packages/pipenv'

Python location: '/usr/bin/python2'

Python installations found:

  • 2.7.5: /home/user/.local/share/virtualenvs/jido.inventory-Y-_EA1m9/bin/python2
  • 2.7.5: /usr/bin/python

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '3.10.0-1062.4.1.el7.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Wed Sep 25 09:42:57 EDT 2019',
 'python_full_version': '2.7.5',
 'python_version': '2.7',
 'sys_platform': 'linux2'}

System environment variables:

  • GILT_REPO
  • PYTHONDONTWRITEBYTECODE
  • LESSOPEN
  • SSH_CLIENT
  • SELINUX_USE_CURRENT_RANGE
  • LOGNAME
  • USER
  • HOME
  • PATH
  • PS1
  • LANG
  • TERM
  • SHELL
  • SHLVL
  • HISTSIZE
  • MANPATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED
  • PIPENV_ACTIVE
  • XDG_RUNTIME_DIR
  • SSH_AUTH_SOCK
  • VIRTUAL_ENV
  • SELINUX_ROLE_REQUESTED
  • PIP_PYTHON_PATH
  • XDG_SESSION_ID
  • _
  • SSH_CONNECTION
  • SSH_TTY
  • HOSTNAME
  • SELINUX_LEVEL_REQUESTED
  • HISTCONTROL
  • PWD
  • PIP_SHIMS_BASE_MODULE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • MAIL
  • LS_COLORS

Pipenv–specific environment variables:

  • PIPENV_ACTIVE: 1

Debug–specific environment variables:

  • PATH: /home/user/.local/share/virtualenvs/org.inventory-Y-_EA1m9/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin:/home/user/.local/bin:/home/user/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/user/org.inventory
  • VIRTUAL_ENV: /home/user/.local/share/virtualenvs/org.inventory-Y-_EA1m9

Contents of Pipfile ('/home/user/org.inventory/Pipfile'):

[[source]]
name = "jido"
url = "https://nexus.example.com/repository/pypi-simple-release/simple"
verify_ssl = true

[dev-packages]
python-vagrant = "*"
molecule = "*"
docker = "*"
invoke = "*"
jinja2 = "*"

[packages]
ansible = "~=2.8"
nailgun = "*"
apypie = "*"
#pywinrm = ">=0.3.0"

[requires]
python_version = "2.7"
@imomaliev
Copy link
Contributor

Your pipenv installed in python 2.7. Use

[requires]
python_version = "3.5"

@kuwv kuwv closed this as completed Nov 19, 2019
@kuwv
Copy link
Author

kuwv commented Nov 19, 2019

RHEL 7 is python2.7 based and installing another python is not a solution but I guess this is going nowhere.

@imomaliev
Copy link
Contributor

imomaliev commented Nov 20, 2019

@kuwv You could use newer versions of python in your virtual environments. So this shouldn't be an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants