Pipenv on Windows: 'module' object is not callable

帅比萌擦擦* 提交于 2020-07-23 08:00:50

问题


I'm having trouble using Pipenv on my Windows 10 machine. Initially, I got a timeout error while trying to run pipenv install <module> and following this answer, I disabled Windows Defender.

That got rid of the timeout error and it then seems to successfully install the package at ~/.virtualenvs but I get an error when it comes to creating Pipfile.lock:

Adding flask to Pipfile's [packages]...
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
File "C:\Users\Edgar\AppData\Roaming\Python\Python36\site-packages\pipenv\utils.py", line 402, in resolve_deps
    req_dir=req_dir
File "C:\Users\Edgar\AppData\Roaming\Python\Python36\site-packages\pipenv\utils.py", line 250, in actually_resolve_deps
    req = Requirement.from_line(dep)
File "C:\Users\Edgar\AppData\Roaming\Python\Python36\site-packages\pipenv\vendor\requirementslib\models\requirements.py", line 704, in from_line
    line, extras = _strip_extras(line)
TypeError: 'module' object is not callable

I've tried installing requests and flask, with the same results.

  • python: Python 3.6.4 :: Anaconda, Inc.
  • pip: pip 18.0 from c:\users\edgar\anaconda3\lib\site-packages\pip (python 3.6)
  • pipenv: pipenv, version 2018.7.1

Any clues as to what is the problem/solution?


回答1:


I recommend you to update your pipenv version by using

>>> python -m pip install --upgrade pip 

>>> pip install --upgrade pipenv

And then try to install your module again

>>> pipenv install <module_name>



回答2:


Finally solved it. This is current issue, with a workaround for Windows:

pipenv run python -m pip install -U pip==18.0




回答3:


I got the same problem . It looks like problem happen with pip18.1 . However, you are using pip 18.0 . By the way, I solved by these commands . You can try it.

pipenv run pip install pip==18.0 pipenv install

Reference: https://github.com/pypa/pipenv/issues/2924



来源:https://stackoverflow.com/questions/52711988/pipenv-on-windows-module-object-is-not-callable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!