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.

ImportError: No module named req_install

See original GitHub issue
Issue description

Fail to execute pipenv install. No Pipfile.lock is created. I tried v2018.7.1 and v2018.6.25, both of them don’t work. But v2018.05.18 works, it’s weird.

  • pipenv v2018.6.25
  • pip 10.0.1
  • python 2.7.6
Actual result
> pipenv install --verbose
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
using sources: [{u'url': u'https://pypi.org/simple', u'verify_ssl': True, u'name': u'pypi'}]

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pipenv/resolver.py", line 87, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/resolver.py", line 76, in main
    system=system,
  File "/usr/local/lib/python2.7/dist-packages/pipenv/resolver.py", line 63, in resolve
    allow_global=system,
  File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 402, in resolve_deps
    req_dir=req_dir
  File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 232, in actually_resolve_deps
    from .vendor.requirementslib import Requirement
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/__init__.py", line 6, in <module>
    from .models import Requirement, Lockfile, Pipfile
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/models/__init__.py", line 8, in <module>
    from .requirements import Requirement
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/models/requirements.py", line 14, in <module>
    from .markers import PipenvMarkers
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/models/markers.py", line 6, in <module>
    from .utils import validate_markers, filter_none
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/models/utils.py", line 7, in <module>
    from .._compat import Link
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/_compat.py", line 41, in <module>
    InstallRequirement = do_import("req.req_install", "InstallRequirement")
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/requirementslib/_compat.py", line 35, in do_import
    _tmp = importlib.import_module(pip9)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named req_install
/usr/local/lib/python2.7/dist-packages/pipenv/_compat.py:113: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-j_DPd2-requirements'>
  warnings.warn(warn_message, ResourceWarning)

/usr/local/lib/python2.7/dist-packages/pipenv/_compat.py:113: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-jPQFk0-requirements'>
  warnings.warn(warn_message, ResourceWarning)
Steps to replicate

My Pipfile:

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

[dev-packages]

[packages]
ujson = "==1.35"
bottle = "==0.11.6"
pymongo = "==2.8.0"
mongoengine = "==0.8.7"
"html2text" = "==3.200.3"
requests = {version = "==2.13.0", extras = ["security"]}
gmail = "==0.5"
lxml = "==4.1.0"
"beautifulsoup4" = "==4.3.2"
imgutil = ">=0.1.2"
celery = "==3.1.25"
flower = "==0.9.1"
facebook-sdk = "==2.0.0"
"pbkdf2" = "==1.3"
interactor = "==0.1.2"
retrying = "==1.3.3"
futures = "==3.1.1"
libthumbor = "==1.3.2"
"boto3" = "==1.4.4"
humanize = "==0.5.1"
"html5lib" = "==0.9999999"
contexttimer = "==0.3.3"
filetype = "==1.0.0"
Pillow = "==2.7.0"
Fabric = "==1.8.1"
"Jinja2" = "==2.7.3"
youtube_dl = "==2018.7.4"
autolink_py = "==0.2.0"

[requires]
python_version = "2.7"

$ pipenv --support

Pipenv version: '2018.7.1'

Pipenv location: '/usr/local/lib/python2.7/dist-packages/pipenv'

Python location: '/usr/bin/python'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.4: /usr/bin/python3.4m

  • 3.4: /usr/bin/python3.4

  • 2.7.6: /usr/bin/python

  • 2.7.6: /usr/bin/python2

  • 3.4.3: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '3.13.0-151-generic',
 'platform_system': 'Linux',
 'platform_version': '#201-Ubuntu SMP Wed May 30 14:22:13 UTC 2018',
 'python_full_version': '2.7.6',
 'python_version': '2.7',
 'sys_platform': 'linux2'}

System environment variables:

  • GOPATH
  • WINDOWID
  • LS_COLORS
  • LC_NUMERIC
  • GNOME_DESKTOP_SESSION_ID
  • WINDOWPATH
  • XDG_CURRENT_DESKTOP
  • __fish_bin_dir
  • XDG_VTNR
  • QT_IM_MODULE
  • LOGNAME
  • USER
  • GNOME_KEYRING_CONTROL
  • LC_PAPER
  • HOME
  • DISPLAY
  • PATH
  • LANG
  • TERM
  • SHELL
  • QT_QPA_PLATFORMTHEME
  • SESSION_MANAGER
  • LC_MEASUREMENT
  • MANDATORY_PATH
  • CLUTTER_IM_MODULE
  • TEXTDOMAIN
  • QT4_IM_MODULE
  • COMPIZ_CONFIG_PROFILE
  • SESSION
  • __fish_sysconfdir
  • SESSIONTYPE
  • IM_CONFIG_PHASE
  • GPG_AGENT_INFO
  • LC_MONETARY
  • USERNAME
  • SHLVL
  • SSH_AUTH_SOCK
  • __fish_help_dir
  • XDG_RUNTIME_DIR
  • LC_IDENTIFICATION
  • LC_ADDRESS
  • SELINUX_INIT
  • COMPIZ_BIN_PATH
  • DESKTOP_SESSION
  • J2SDKDIR
  • GDMSESSION
  • XMODIFIERS
  • TEXTDOMAINDIR
  • PYTHONDONTWRITEBYTECODE
  • GNOME_KEYRING_PID
  • PIP_PYTHON_PATH
  • XDG_SESSION_ID
  • DBUS_SESSION_BUS_ADDRESS
  • GTK_MODULES
  • GTK_IM_MODULE
  • DERBY_HOME
  • JAVA_HOME
  • XDG_CONFIG_DIRS
  • DEFAULTS_PATH
  • VTE_VERSION
  • XDG_SEAT
  • __fish_datadir
  • GDM_LANG
  • LC_TELEPHONE
  • XAUTHORITY
  • INSTANCE
  • PWD
  • JOB
  • COLORTERM
  • LC_NAME
  • XDG_MENU_PREFIX
  • LC_TIME
  • J2REDIR
  • XDG_DATA_DIRS
  • UPSTART_SESSION

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/go/bin:/home/user/.autojump/bin:/home/user/.ndenv/shims:/home/user/.ndenv/bin:/home/user/projects/go_workspace/bin:/home/user/.rbenv/shims:/home/user/.rbenv/bin:/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
  • SHELL: /usr/bin/fish
  • LANG: en_US.UTF-8
  • PWD: /home/user/projects/test_pipenv

Contents of Pipfile (‘/home/user/projects/test_pipenv/Pipfile’):

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

[dev-packages]

[packages]
ujson = "==1.35"
bottle = "==0.11.6"
pymongo = "==2.8.0"
mongoengine = "==0.8.7"
"html2text" = "==3.200.3"
requests = {version = "==2.13.0", extras = ["security"]}
gmail = "==0.5"
lxml = "==4.1.0"
"beautifulsoup4" = "==4.3.2"
imgutil = ">=0.1.2"
celery = "==3.1.25"
flower = "==0.9.1"
facebook-sdk = "==2.0.0"
"pbkdf2" = "==1.3"
interactor = "==0.1.2"
retrying = "==1.3.3"
futures = "==3.1.1"
libthumbor = "==1.3.2"
"boto3" = "==1.4.4"
humanize = "==0.5.1"
"html5lib" = "==0.9999999"
contexttimer = "==0.3.3"
filetype = "==1.0.0"
Pillow = "==2.7.0"
Fabric = "==1.8.1"
"Jinja2" = "==2.7.3"
youtube_dl = "==2018.7.4"
autolink_py = "==0.2.0"

[requires]
python_version = "2.7"

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
uranusjrcommented, Jul 13, 2018

If you cannot upgrade the system Python, I would suggest installing Pipenv to a Python 3 installation instead. Pipenv has much fewer problems on Python 3.

0reactions
techalchemycommented, Oct 29, 2018

closing for now, we don’t really support 2.7.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named pip.req - python - Stack Overflow
This code reads a pip requirements.txt file and extracts the desired modules to install. Then setup.py actually installs the files. – hughdbrown.
Read more >
ImportError: No module named 'pip.req' · Issue #282 - GitHub
Flask-Ask is using pip.req module stuff which means you need pip <10.0.0 to install the packages.
Read more >
Bench install on Easy setup failing - NO pip.req
Hey Guys, I've been setting up ERPnext on Vultr VPS five six times now using the install.py script but now its failing see...
Read more >
ImportError: No module named 'XYZ' | by Yufeng
Module import problem. The error message was that the module cannot be found, so I tried to install the package via pip install,...
Read more >
[Fixed] ModuleNotFoundError: No module named 'pip' - Finxter
Quick Fix: Python raises the ImportError: No module named 'pip' when it cannot find the library pip . The most frequent source of...
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