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.

Running pipenv gives TypeError: 'module' object is not callable

See original GitHub issue
Issue description

I just installed pipenv on a pyenv installed Python 3.7.0 interpreter. Starting in a clean directory resulted in an exception.

Expected result

pipenv to not crash.

Actual result
$ pip install pipenv
Requirement already satisfied: pipenv in /Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages (2018.7.1)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages (from pipenv) (0.3.0)
Requirement already satisfied: pip>=9.0.1 in /Users/pradyunsg/Projects/pip/src (from pipenv) (18.1.dev0)
Requirement already satisfied: setuptools>=36.2.1 in /Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages (from pipenv) (39.0.1)
Requirement already satisfied: certifi in /Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages (from pipenv) (2018.8.24)
Requirement already satisfied: virtualenv in /Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages (from pipenv) (16.0.0)
$ pipenv --version
pipenv, version 2018.7.1
$ pipenv install django --verbose
Creating a Pipfile for this project...
Installing django...
⠋Installing 'django'
Traceback (most recent call last):
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/cli.py", line 435, in install
    selective_upgrade=selective_upgrade,
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/core.py", line 1971, in do_install
    pypi_mirror=pypi_mirror,
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/core.py", line 1375, in pip_install
    package_name.split('--hash')[0].split('--trusted-host')[0]
  File "/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 704, in from_line
    line, extras = _strip_extras(line)
TypeError: 'module' object is not callable
Steps to replicate
$ pipenv --support

Pipenv version: '2018.7.1'

Pipenv location: '/Users/pradyunsg/.pyenv/versions/3.7.0/lib/python3.7/site-packages/pipenv'

Python location: '/Users/pradyunsg/.pyenv/versions/3.7.0/bin/python3.7'

Other Python installations in PATH:

  • 2.7: /Users/pradyunsg/.pyenv/shims/python2.7

  • 2.7: /Users/pradyunsg/.pyenv/shims/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 2.7: /Users/pradyunsg/.pyenv/shims/python2.7

  • 3.4: /Users/pradyunsg/.pyenv/shims/python3.4m

  • 3.4: /Users/pradyunsg/.pyenv/shims/python3.4

  • 3.4: /Users/pradyunsg/.pyenv/shims/python3.4

  • 3.5: /Users/pradyunsg/.pyenv/shims/python3.5m

  • 3.5: /Users/pradyunsg/.pyenv/shims/python3.5

  • 3.5: /Users/pradyunsg/.pyenv/shims/python3.5

  • 3.6: /Users/pradyunsg/.pyenv/shims/python3.6m

  • 3.6: /Users/pradyunsg/.pyenv/shims/python3.6

  • 3.6: /Users/pradyunsg/.pyenv/shims/python3.6

  • 3.7: /Users/pradyunsg/.pyenv/versions/3.7.0/bin/python3.7m

  • 3.7: /Users/pradyunsg/.pyenv/versions/3.7.0/bin/python3.7

  • 3.7: /Users/pradyunsg/.pyenv/shims/python3.7

  • 3.7: /usr/local/bin/python3.7

  • 3.7: /Users/pradyunsg/.pyenv/shims/python3.7

  • 3.7.0: /Users/pradyunsg/.pyenv/versions/3.7.0/bin/python

  • 3.7.0: /Users/pradyunsg/.pyenv/shims/python

  • 2.7.15: /usr/local/bin/python

  • 2.7.10: /usr/bin/python

  • 3.7.0: /Users/pradyunsg/.pyenv/shims/python

  • 2.7.15: /Users/pradyunsg/.pyenv/shims/python2

  • 2.7.15: /usr/local/bin/python2

  • 2.7.15: /Users/pradyunsg/.pyenv/shims/python2

  • 3.7.0: /Users/pradyunsg/.pyenv/versions/3.7.0/bin/python3

  • 3.7.0: /Users/pradyunsg/.pyenv/shims/python3

  • 3.7.0: /usr/local/bin/python3

  • 3.7.0: /Users/pradyunsg/.pyenv/shims/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '17.7.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT '
                     '2018; root:xnu-4570.71.2~1/RELEASE_X86_64',
 'python_full_version': '3.7.0',
 'python_version': '3.7',
 'sys_platform': 'darwin'}

System environment variables:

  • RBENV_VERSION
  • TERM_PROGRAM
  • VIRTUALENVWRAPPER_SCRIPT
  • PYENV_ROOT
  • TERM
  • SHELL
  • ZPLUG_LOADFILE
  • TMPDIR
  • Apple_PubSub_Socket_Render
  • TERM_PROGRAM_VERSION
  • FPATH
  • PYENV_VERSION
  • DEFAULT_RBENV
  • ZPLUG_USE_CACHE
  • USER
  • ZPLUG_ERROR_LOG
  • ZPLUG_PROTOCOL
  • SSH_AUTH_SOCK
  • PYENV_DIR
  • __CF_USER_TEXT_ENCODING
  • VIRTUAL_ENV_DISABLE_PROMPT
  • _ZPLUG_VERSION
  • _ZPLUG_PREZTO
  • PERIOD
  • _ZPLUG_AWKPATH
  • VIRTUALENVWRAPPER_PYTHON
  • PATH
  • PYENV_VIRTUALENVWRAPPER_PYENV_VERSION
  • PWD
  • LANG
  • PYENV_HOOK_PATH
  • _ZPLUG_CONFIG_SUBSHELL
  • XPC_FLAGS
  • _ZPLUG_OHMYZSH
  • ZPLUG_BIN
  • VIRTUALENVWRAPPER_VIRTUALENV
  • _ZPLUG_URL
  • RBENV_SHELL
  • HISTIGNORE
  • HISTCONTROL
  • XPC_SERVICE_NAME
  • GPG_TTY
  • ZPLUG_CACHE_DIR
  • SHLVL
  • PYENV_SHELL
  • HOME
  • _VIRTUALENVWRAPPER_API
  • ZPLUG_THREADS
  • ZPLUG_REPOS
  • LOGNAME
  • VIRTUALENVWRAPPER_VIRTUALENV_CLONE
  • ZPLUG_FILTER
  • ZPLUG_HOME
  • ZPLUG_ROOT
  • SECURITYSESSIONID
  • VIRTUALENVWRAPPER_LAZY_SCRIPT
  • HISTFILE
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/pradyunsg/.pyenv/versions/3.7.0/bin:/usr/local/Cellar/pyenv/1.2.7/libexec:/Users/pradyunsg/.rbenv/shims:/Users/pradyunsg/.pyenv/shims:/usr/local/Cellar/zplug/2.4.2/bin:/usr/local/opt/zplug/bin:/Users/pradyunsg/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/pradyunsg/.rbenv/shims:/Users/pradyunsg/.pyenv/shims:/Applications/Visual Studio Code.app/Contents/Resources/app/bin
  • SHELL: /usr/local/bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /Users/pradyunsg/Projects/csi-18/polling

Contents of Pipfile (‘/Users/pradyunsg/Projects/csi-18/polling/Pipfile’):

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

[packages]
django = "*"

[dev-packages]

[requires]
python_version = "3.7"

Contents of Pipfile.lock (‘/Users/pradyunsg/Projects/csi-18/polling/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "627ef89f247ecee27e9ef0dabe116108d09c47abf171c900a8817befa64f9dd2"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "django": {
            "hashes": [
                "sha256:04f2e423f2e60943c02bd2959174b844f7d1bcd19eabb7f8e4282999958021fd",
                "sha256:e1cc1cd6b658aa4e052f5f2b148bfda08091d7c3558529708342e37e4e33f72c"
            ],
            "index": "pypi",
            "version": "==2.1.1"
        },
        "pytz": {
            "hashes": [
                "sha256:a061aa0a9e06881eb8b3b2b43f05b9439d6583c206d0a6c340ff72a7b6669053",
                "sha256:ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277"
            ],
            "version": "==2018.5"
        }
    },
    "develop": {}
}

Issue Analytics

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

github_iconTop GitHub Comments

72reactions
matthewkumarcommented, Oct 5, 2018

This is a workaround for locking the pip version to 18.0

pip install pipenv
pipenv run pip install pip==18.0
pipenv install
43reactions
jasjukaitiscommented, Oct 5, 2018

pip 18.1 was released several minutes ago and now pipenv doesn’t work for me too, so I had to pin pip to 18.0 as a quick workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipenv on Windows: 'module' object is not callable
I'm having trouble using Pipenv on my Windows 10 machine. Initially, I got a timeout error while trying to run pipenv install <module>...
Read more >
Common Pipenv Errors and How to Solve Them: Why Won't it ...
Pipenv looks for the package you specify, whether it exists or not. You see the following errors and many more in the terminal...
Read more >
Full Text Bug Listing - Red Hat Bugzilla
Actual results: pipenv graph --json Traceback (most recent call last): File ... extras = _strip_extras(line) TypeError: 'module' object is not callable.
Read more >
TypeError: 'NoneType' object is not callable CircleCI
I'm trying to make this bit of code in my config.yml file work through CircleCI: cd backend pip install pipenv pipenv install. When...
Read more >
'mul' object is not callable | The AI Search Engine You Control
TypeError : module object is not callable [Python Error Solved] ... Please run $ pipenv --support , and paste the results here. Don't...
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