pipenv: Running pipenv gives TypeError: 'module' object is not callable
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_VERSIONTERM_PROGRAMVIRTUALENVWRAPPER_SCRIPTPYENV_ROOTTERMSHELLZPLUG_LOADFILETMPDIRApple_PubSub_Socket_RenderTERM_PROGRAM_VERSIONFPATHPYENV_VERSIONDEFAULT_RBENVZPLUG_USE_CACHEUSERZPLUG_ERROR_LOGZPLUG_PROTOCOLSSH_AUTH_SOCKPYENV_DIR__CF_USER_TEXT_ENCODINGVIRTUAL_ENV_DISABLE_PROMPT_ZPLUG_VERSION_ZPLUG_PREZTOPERIOD_ZPLUG_AWKPATHVIRTUALENVWRAPPER_PYTHONPATHPYENV_VIRTUALENVWRAPPER_PYENV_VERSIONPWDLANGPYENV_HOOK_PATH_ZPLUG_CONFIG_SUBSHELLXPC_FLAGS_ZPLUG_OHMYZSHZPLUG_BINVIRTUALENVWRAPPER_VIRTUALENV_ZPLUG_URLRBENV_SHELLHISTIGNOREHISTCONTROLXPC_SERVICE_NAMEGPG_TTYZPLUG_CACHE_DIRSHLVLPYENV_SHELLHOME_VIRTUALENVWRAPPER_APIZPLUG_THREADSZPLUG_REPOSLOGNAMEVIRTUALENVWRAPPER_VIRTUALENV_CLONEZPLUG_FILTERZPLUG_HOMEZPLUG_ROOTSECURITYSESSIONIDVIRTUALENVWRAPPER_LAZY_SCRIPTHISTFILEPYTHONDONTWRITEBYTECODEPIP_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/binSHELL:/usr/local/bin/zshLANG:en_US.UTF-8PWD:/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": {}
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 27 (4 by maintainers)
This is a workaround for locking the pip version to 18.0
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.
The above didn’t quite work for me, what did was:
I’m having a similar problem. I’m trying to create a new environment, using python 3.6
The Pipfile has the following content
No Pipfile.lock was produced. But I’m able to use
pipenv shell.This affected me too on Python 3.6.
Upgrading pip and pipenv brings them to
18.1and2018.7.1and this combination results inTypeErrorrelated to_strip_extras.This issue should be re-opened or duplicated.Update: see #2924.For me i had to install not in the pipenv, i installed in my python specific version
python3.5 -m pip install pip=18.0 pipenv install
This workaround doesn’t work to me.
Hi Williams,
I did update of pip and pipenv:
So, I was to execute pipenv:
I’m having a similar problem python 3.7 Ubuntu 18.4, Windows 10