我正在使用pipenv
在Windows 10 X64上安装scrapy
:
pipenv shell
pipenv install scrapy
然后我在下面看到此错误:
(scrapy_demo-Nk7qjJjf) D:\PycharmProjects\scrapy_demo>pipenv install scrapy
Installing scrapy...
Traceback (most recent call last):
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\RussellXu\AppData\Local\Programs\Python\Python37\Scripts\pipenv.exe\__main__.py", line 9, in <module>
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\cli.py", line 435, in install
selective_upgrade=selective_upgrade,
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\core.py", line 1971, in do_install
pypi_mirror=pypi_mirror,
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\core.py", line 1375, in pip_install
package_name.split('--hash')[0].split('--trusted-host')[0]
File "c:\users\russellxu\appdata\local\programs\python\python37\lib\site-packages\pipenv\vendor\requirementslib\models\requirements.py", line 704, in from_line
line, extras = _strip_extras(line)
TypeError: 'module' object is not callable
那我为什么会收到此错误,我该如何解决?
答案 0 :(得分:0)
确保pipenv
已升级到最新版本。
如果升级失败,您可以尝试以下解决方法:https://github.com/pypa/pipenv/issues/2924#issuecomment-427351356
pip install pipenv
pipenv run pip install pip==18.0
pipenv install