question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no longer able to manage projects with `python<3.6`?

See original GitHub issue

Issue description

Since requiring python>=3.6, it seems pipenv can no longer manage projects using python<3.6.

Expected result

pipenv to continue to manage projects with python<3.6

Actual result

pipenv fails to resolve dependencies with SyntaxError: invalid syntax

Steps to replicate

$ pipenv install --two requests --verbose
Using python: 2
Path to python: /usr/bin/python2.7
Creating a virtualenv for this project...
Pipfile: /private/var/folders/wr/gcv7765n6v3118gtwtyr8x9r0000gn/T/tmp.YreZXAo6/Pipfile
Using /usr/bin/python2.7 (2.7.18) to create virtualenv...
⠴ Creating virtual environment...created virtual environment CPython2.7.18.final.0-64 in 288ms
  creator CPython2macOsFramework(dest=/Users/Branch/.local/share/virtualenvs/tmp.YreZXAo6-ZAbwaU-O, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/Branch/Library/Application Support/virtualenv)
    added seed packages: pip==20.3.4, setuptools==44.1.1, wheel==0.37.0
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /Users/Branch/.local/share/virtualenvs/tmp.YreZXAo6-ZAbwaU-O
Creating a Pipfile for this project...
Installing requests...
Installing package: requests
Writing supplied requirement line to temporary file: 'requests'
Installing 'requests'
⠙ Installing requests...$ /Users/Branch/.local/share/virtualenvs/tmp.YreZXAo6-ZAbwaU-O/bin/python -m pip install --verbose --upgrade --exists-action=i -r /var/folders/wr/gcv7765n6v3118gtwtyr8x9r0000gn/T/pipenv-7w4z_jj8-requirements/pipenv-qtiq5wf5-requirement.txt -i https://pypi.org/simple
Using source directory: '/Users/Branch/.local/share/virtualenvs/tmp.YreZXAo6-ZAbwaU-O/src'
Adding requests to Pipfile's [packages]...
✔ Installation Succeeded
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
  File "/Users/Branch/.local/share/pipx/venvs/pipenv/lib/python3.9/site-packages/pipenv/resolver.py", line 25
    path_options = [name, f"{name}.py"]
                                     ^
SyntaxError: invalid syntax
✘ Locking Failed!

$ pipenv --support

Pipenv version: '2021.11.9'

Pipenv location: '/Users/Branch/.local/share/pipx/venvs/pipenv/lib/python3.9/site-packages/pipenv'

Python location: '/Users/Branch/.local/share/pipx/venvs/pipenv/bin/python'

Python installations found:

  • 3.9.7: /usr/local/bin/python3
  • 3.9.7: /usr/local/bin/python3.9
  • 3.9.6: /Users/Branch/.local/share/pyenv/versions/3.9.6/bin/python3
  • 3.9.0: /Users/Branch/.local/share/pyenv/versions/3.9.0/bin/python3
  • 3.8.9: /usr/bin/python3
  • 3.8.9: /Users/Branch/.local/share/pyenv/versions/3.8.9/bin/python3
  • 3.7.9: /usr/local/bin/python3.7m
  • 3.7.9: /usr/local/bin/python3.7
  • 3.7.9: /Users/Branch/.local/share/pyenv/versions/3.7.9/bin/python3
  • 3.5.10: /Users/Branch/.local/share/pyenv/versions/3.5.10/bin/python3
  • 2.7.18: /usr/bin/python
  • 2.7.18: /usr/bin/python2
  • 2.7.18: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.9.7',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '21.1.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT '
                     '2021; root:xnu-8019.41.5~1/RELEASE_X86_64',
 'python_full_version': '3.9.7',
 'python_version': '3.9',
 'sys_platform': 'darwin'}

System environment variables:

  • ZDOTDIR
  • _tide_reset_to_color_dirs
  • SHELL
  • GEM_SPEC_CACHE
  • LANG
  • HOMEBREW_BUNDLE_FILE
  • XPC_FLAGS
  • GOPATH
  • NPM_CONFIG_INIT_MODULE
  • GRADLE_USER_HOME
  • PIPX_HOME
  • HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED
  • __CF_USER_TEXT_ENCODING
  • ITERM_SESSION_ID
  • AWS_ACCESS_KEY_ID
  • USER
  • JABBA_HOME
  • PATH
  • tide_rustc_icon
  • COLORTERM
  • tide_show_kubectl_on
  • XDG_DATA_HOME
  • XDG_CONFIG_HOME
  • TERM_SESSION_ID
  • PYTHONSTARTUP
  • BUNDLE_USER_PLUGIN
  • TERM_PROGRAM_VERSION
  • __CFBundleIdentifier
  • XDG_CACHE_HOME
  • HOMEBREW_BAT
  • XDG_STATE_HOME
  • COLORFGBG
  • NODE_REPL_HISTORY
  • HOME
  • SSH_AUTH_SOCK
  • fish_greeting
  • LC_TERMINAL_VERSION
  • LOGNAME
  • tide_show_gcloud_on
  • SHLVL
  • XDG_BIN_HOME
  • TERM_PROGRAM
  • DOCKER_CONFIG
  • GNUPGHOME
  • XDG_BIN_DIRS
  • NPM_CONFIG_PREFIX
  • ITERM_PROFILE
  • MAVEN_OPTS
  • GOBIN
  • EDITOR
  • LESSHISTFILE
  • _tide_prompt_and_frame_color
  • _tide_color_truncated_dirs
  • PYTHONDONTWRITEBYTECODE
  • NPM_CONFIG_CACHE
  • NPM_CONFIG_DEVDIR
  • MANPAGER
  • NPM_CONFIG_TMP
  • FNM_DIR
  • PSQLRC
  • NPM_CONFIG_USERCONFIG
  • XPC_SERVICE_NAME
  • PYENV_ROOT
  • TMPDIR
  • GEM_HOME
  • PWD
  • BUNDLE_USER_CACHE
  • tide_kubectl_icon
  • tide_direnv_denied_color
  • BUNDLE_USER_CONFIG
  • COMMAND_MODE
  • RUSTUP_HOME
  • ALL_REPOS_CONFIG_FILENAME
  • TERM
  • PSQL_HISTORY
  • LC_TERMINAL
  • CARGO_HOME
  • AWS_DEFAULT_REGION
  • NO_UPDATE_NOTIFIER
  • PIPX_DEFAULT_PYTHON
  • NPM_TOKEN
  • POETRY_VIRTUALENVS_IN_PROJECT
  • tide_direnv_bg_color
  • BW_SESSION
  • GIT_SSH_COMMAND
  • tide_node_icon
  • GITHUB_TOKEN
  • tide_show_pulsarctl_on
  • PIP_DISABLE_PIP_VERSION_CHECK
  • tide_transient_prompt
  • KUBECONFIG
  • PIP_REQUIRE_VIRTUALENV
  • tide_direnv_color
  • PAGER
  • _tide_location_color
  • tide_node_color
  • DIRENV_LOG_FORMAT
  • AWS_SECRET_ACCESS_KEY
  • TEXMFHOME
  • _tide_color_anchors
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/Branch/.local/share/cargo/bin:/Users/Branch/.local/share/npm/bin:/Users/Branch/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/TeX/texbin
  • SHELL: /usr/local/bin/fish
  • EDITOR: code --wait
  • LANG: en_US.UTF-8
  • PWD: /var/folders/wr/gcv7765n6v3118gtwtyr8x9r0000gn/T/tmp.YreZXAo6

Contents of Pipfile (‘/private/var/folders/wr/gcv7765n6v3118gtwtyr8x9r0000gn/T/tmp.YreZXAo6/Pipfile’):

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

[packages]
requests = "*"

[dev-packages]

[requires]
python_version = "2.7"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
branchvincentcommented, Nov 10, 2021

I see, I understand now. May I suggest documenting that more clearly in the release notes and README? I did search both before filing this issue. Apologies if I overlooked this.

In addition to the docs, I imagine pipenv --two should be removed and ideally pipenv install should refuse to select a python that it knowingly cannot manage (which is what led to my confusion here). Does that sound reasonable to you?

0reactions
frostmingcommented, Nov 10, 2021

Oh, pipenv drops support for Python < 3.6 on the recent release, as well as managing the environment for the old python versions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip3: bad interpreter: No such file or directory - Stack Overflow
The simplest thing to do is to just rm /usr/local/bin/pip3 . Then, assuming you want your Homebrew Python to be your default for...
Read more >
What's New In Python 3.6 — Python 3.11.1 documentation
asyncio. Starting with Python 3.6 the asyncio module is no longer provisional and its API is considered stable. Notable changes in the asyncio...
Read more >
How to PIP Install Requests Python Package - ActiveState
Try a faster and easier way to manage your Python dependencies. Use Python 3.9 by ActiveState and build your own runtime with the...
Read more >
Work with Python - UCSF Wynton HPC Cluster
Installing Python packages # ... It will not work. If you attempt to run this as-is on the cluster, you get lots of...
Read more >
Python Versions Management With pyenv - Sebastian Witowski
You could install different Python versions and use the python3.6 ... (without them, you won't be able to install new Python versions).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found