MacOS上的Pipenv问题"TypeError:'模块'对象不可调用" [英] Pipenv trouble on MacOS "TypeError: 'module' object is not callable"

查看:129
本文介绍了MacOS上的Pipenv问题"TypeError:'模块'对象不可调用"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始尝试获得可运行的pipenv,但是在我的Mac上,看来我的Python环境有些混乱.我在

I'm starting to try and get a working pipenv, however on my Mac, it is appears that my Python enviroment is a little screwed. I removed OS X python following this post , and installed both python2.7 and python3.7 using brew. But now when trying to use pipenv(2.7) to create a virtualenv, and pipfile, I keep getting an error about python 3.7, when locking pacakges:

$ pipenv --python=/usr/local/bin/python install pynetbox ipaddress
Virtualenv already exists!
Removing existing virtualenv...
Creating a virtualenv for this project...
Pipfile: /Users/daniel/scripts/netbox/Pipfile

...

adding ipaddress to Pipfile's [packages]...
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
c/lib/python3.7/site-packages/pipenv/utils.py", line 250, in actually_resolve_deps
    req = Requirement.from_line(dep)
  File "/usr/local/Cellar/pipenv/2018.7.1/libexec/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
/usr/local/Cellar/pipenv/2018.7.1/libexec/lib/python3.7/site-packages/pipenv/_compat.py:113: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/pc/hlxw3whn3cl1x3h45ll2m8gw0000gs/T/pipenv-TYWa8Y-requirements'>
  warnings.warn(warn_message, ResourceWarning)

我已经重新安装了PIP和python几次,也没有运气.任何想法将不胜感激.我确定python可能只是处于某种不良状态:(

I have reinstalled PIP, and python a few times, and no luck. Any ideas would be greatly appreciated. Im sure by python is probably just in some bad state :(

推荐答案

这是Pipenv中的错误,原因是它与最新版本的pip(18.1)一起使用:

This is a bug in pipenv caused by using it alongside the newest version of pip (18.1): https://github.com/pypa/pipenv/issues/2924. You need to downgrade pip — both inside and outside the pipenv environment — to version 18.0 in order for pipenv to work.

这篇关于MacOS上的Pipenv问题"TypeError:'模块'对象不可调用"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆