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.

pipenv graph fails: No module named 'pipenv'

See original GitHub issue

Issue description

With the newest version of pipenv (2018.10.9), pipenv graph fails with the error message ModuleNotFoundError: No module named 'pipenv'

Expected result

I expected pipenv graph to output the dependency graph of the venv.

Actual result

$ pipenv graph

ERROR:  Traceback (most recent call last):
  File "c:\\python27\\lib\\site-packages\\pipenv\\vendor\\pipdeptree.py", line 16, in <module>
    from pipenv.vendor.pip_shims import get_installed_distributions, FrozenRequirement
ModuleNotFoundError: No module named 'pipenv'

Steps to replicate

  • Install version 2018.10.9 of pipenv.
  • Run pipenv graph

$ pipenv --support

Pipenv version: '2018.10.9'

Pipenv location: 'c:\\python27\\lib\\site-packages\\pipenv'

Python location: 'c:\\python27\\python.exe'

Python installations found:

  • 3.6.3: C:\Python36\python.exe
  • 2.7: C:\Python27\python.exe
  • 2.7: C:\Users\m.manhertz\.windows-build-tools\python27\python.exe
  • 2.7: C:\Users\m.manhertz\Envs\tpe\Scripts\python.exe
  • 3.7.0: C:\Python37\python.exe

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'nt',
 'platform_machine': 'AMD64',
 'platform_python_implementation': 'CPython',
 'platform_release': '10',
 'platform_system': 'Windows',
 'platform_version': '10.0.17134',
 'python_full_version': '2.7.12',
 'python_version': '2.7',
 'sys_platform': 'win32'}

System environment variables:

  • TMP
  • TPE_DB_PASSWORD
  • COMPUTERNAME
  • VS140COMNTOOLS
  • USERDOMAIN
  • TPE_DB_HOST
  • PSMODULEPATH
  • PYTHONDONTWRITEBYTECODE
  • COMMONPROGRAMFILES
  • PROCESSOR_IDENTIFIER
  • VBOX_MSI_INSTALL_PATH
  • PROGRAMFILES
  • PROCESSOR_REVISION
  • HOME
  • SYSTEMROOT
  • PROGRAMFILES(X86)
  • COMSPEC
  • DRIVERDATA
  • TERM
  • DJANGO_SETTINGS_MODULE
  • TEMP
  • ALLUSERSPROFILE
  • GITHUB_POSH_GIT
  • TVT
  • COMMONPROGRAMFILES(X86)
  • TPE_DB_NAME
  • PROCESSOR_ARCHITECTURE
  • PLINK_PROTOCOL
  • EDITOR
  • LOCALAPPDATA
  • GYP_MSVS_VERSION
  • HOMEPATH
  • USERDOMAIN_ROAMINGPROFILE
  • TPE_SECRET_KEY
  • ERLANG_HOME
  • USERNAME
  • WORKON_HOME
  • LOGONSERVER
  • SESSIONNAME
  • PROGRAMDATA
  • PYTHONPATH
  • ONEDRIVE
  • PATH
  • PIP_SHIMS_BASE_MODULE
  • TPE_DB_USER
  • AWE_DIR
  • PATHEXT
  • PIP_PYTHON_PATH
  • WINDIR
  • APPDATA
  • HOMEDRIVE
  • PROGRAMW6432
  • SYSTEMDRIVE
  • NUMBER_OF_PROCESSORS
  • USERDNSDOMAIN
  • PROCESSOR_LEVEL
  • VCTARGETSPATH
  • GETTEXTCLDRDIR
  • PYTHON_HOME
  • GITHUB_GIT
  • COMMONPROGRAMW6432
  • OS
  • PUBLIC
  • USERPROFILE

Pipenv???specific environment variables:

Debug???specific environment variables:

  • PATH: C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client\;C:\Python27\;C:\Python27\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;c:\Python27\;c:\Python27\Scripts;C:\Program Files\PostgreSQL\9.4\bin;C:\Program Files\PostgreSQL\9.4\lib;C:\Program Files\PostgreSQL\9.4\include;C:\Program Files\Redis\;C:\Program Files (x86)\PuTTY\;C:\HashiCorp\Vagrant\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\nodejs\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\System32\OpenSSH\;C:\Users\m.manhertz\AppData\Local\Microsoft\WindowsApps;C:\Users\m.manhertz\Documents\Tools;C:\Users\m.manhertz\AppData\Local\atom\bin;C:\Program Files\gettext-iconv\bin;C:\Program Files (x86)\Sophos\Sophos SSL VPN Client\bin;C:\Users\m.manhertz\AppData\Local\Microsoft\WindowsApps;C:\Users\m.manhertz\AppData\Roaming\npm;C:\Python36\Scripts\;C:\Program Files\PostgreSQL\9.6\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;;C:\Users\m.manhertz\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\cmd;C:\Users\m.manhertz\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\bin;C:\Users\m.manhertz\AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\share\git-tfs;C:\Users\m.manhertz\AppData\Local\GitHub\lfs-amd64_1.5.5;C:\Users\m.manhertz\AppData\Local\Apps\2.0\OOH24QXT.R8H\XWTJVPKY.DW1\gith..tion_317444273a93ac29_0003.0003_5794af8169eeff14;C:\Windows\Microsoft.NET\Framework\v4.0.30319\;c:\python27\lib\site-packages\pywin32_system32
  • EDITOR: GitPad

Contents of Pipfile (‘C:\Users\m.manhertz\Documents\GitHub\demo\Pipfile’):

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

[dev-packages]

[packages]

[requires]
python_version = "3.7"

Contents of Pipfile.lock (‘C:\Users\m.manhertz\Documents\GitHub\demo\Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "7e7ef69da7248742e869378f8421880cf8f0017f96d94d086813baa518a65489"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {}
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:40
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

26reactions
hamidfzmcommented, Oct 10, 2018

Why this issue is closed? pipenv still facing the same problem

16reactions
wjvcommented, Oct 9, 2018

It appears that pipenv has transitioned from calling certain functions that are part of the pip API directory, to calling them via a shim which is installed as a submodule of pipenv.

I’m assuming that certain aspects of pipenv’s functionality are actually run inside the project virtualenv, and that this includes pipenv graph.

The problem is that, whereas pip generally is installed in the project virtualenv, pipenv isn’t, and hence these imports fail. If you do a pipenv run python and try to do the import, it’ll fail.

A (nasty, temporary?) workaround is to install pipenv into the project virtualenv (i.e. pipenv install pipenv).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipenv installing a local package but getting ... - Stack Overflow
Pipenv installing a local package but getting "ModuleNotFoundError: No module named" · Ask Question. Asked 4 months ago. Modified 4 months ago.
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
No module named <module name>¶. This is usually a result of mixing Pipenv with system packages. We strongly recommend installing Pipenv in an...
Read more >
ModuleNotFoundError: No module named 'pipenv-setup'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pipenv-setup' How to remove the Modul.
Read more >
pipenv: ImportError: No module named 'virtualenv.seed ...
It's a conflict between two existing virtualenv installation. You might have installed latest version, however if in the same python you also ...
Read more >
pipenv Documentation - Read the Docs
Give you insight into your dependency graph (e.g. $ pipenv graph). ... File "<stdin>", line 1, in <module>. NameError: name 'python' is not...
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