使用pipenv 时报'module' object is not callable' 问题解决

(albumy-lFPcTlgb) bash-3.2$ pipenv install --dev
Installing dependencies from Pipfile.lock (15e1b5)...
Traceback (most recent call last):▉▉▉▉▉ 0/30 — 00:00:00
  File "/Users/zou/anaconda3/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/cli.py", line 435, in install
    selective_upgrade=selective_upgrade,
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/core.py", line 1943, in do_install
    pypi_mirror=pypi_mirror,
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/core.py", line 1322, in do_init
    pypi_mirror=pypi_mirror,
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/core.py", line 807, in do_install_dependencies
    pypi_mirror=pypi_mirror,
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/core.py", line 1375, in pip_install
    package_name.split('--hash')[0].split('--trusted-host')[0]
  File "/Users/zou/anaconda3/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 704, in from_line
    line, extras = _strip_extras(line)
TypeError: 'module' object is not callable
检查Python 环境版本。 pipenv 版本 ~ pipenv --version pipenv, version 2018.7.1 pip 版本 ~ pip --version pip 18.1 from /Users/helix/anaconda3/lib/python3.6/site-packages/pip (python 3.6) python 版本 ~ python -V Python 3.6.3 :: Anaconda custom (64-bit) 参考此 issue, 原来是 pip 版本太高, pipenv 还不支持 18.1 版本,故需要把 pip 版本降级。 pip install 'pip==18.0' 再次运行 pipenv install > pipenv install Pipfile.lock (ca72e7) out of date, updating to (c2d5f0)... Locking [dev-packages] dependencies... Locking [packages] dependencies... Installing dependencies from Pipfile.lock (c2d5f0)... ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 58/58 — 00:02:05
凉葱落

凉葱落python开发工程师