pip is error,TypeError: __call__() takes exactly 2 arguments (1 given)

后端 未结 10 1072
执笔经年
执笔经年 2020-12-07 21:41

system

  • centos 7.2
  • Python 2.7.5

install

I install webhook

pip install webhook
### but hava error,then
yum in         


        
相关标签:
10条回答
  • 2020-12-07 21:53

    Actually, I had a problem that OS/system which means root, not sudo, has been the owner of the pip2 package. But after I had executed this command:

    sudo apt-get remove python-pip
    

    it worked like a charm.
    Noting, of course that I have a debian distribution.

    And then I used what Pedro suggested:

    sudo pip install setuptools==33.1.1
    
    0 讨论(0)
  • 2020-12-07 21:55

    Use the following command to upgrade pip, which has the bug fixed:

    python -m pip install --upgrade --force pip 
    

    It worked for me (centos 7, python 2.7).

    For more details: GitHub

    0 讨论(0)
  • 2020-12-07 21:59

    I ran into the same problem on a new virtualenv trying to install. I'm running python 2.7.11 and found the two commands belows solve the versioning problem with setuptools:

    This forces a pip upgrade, which has a fix for the bug, but doesn't reinstall setup tools, so I was still running on setuptools version 35.0.1

    python -m pip install --upgrade --force pip

    This sets setuptools to an older version.

    pip install setuptools==33.1.1

    After this, I successfully installed my requirements.

    0 讨论(0)
  • 2020-12-07 22:03

    UPDATE:

    Please see the solution lower in this thread by Pedro Werneck instead of this one. It's the correct way to solve the problem.


    Preface: I do not recommend this!

    This seems to work, but I have no idea what the consequences could be. This is cargo cult programming at its best! I'm only adding it here in case it can help someone in a bind.

    I made changes to the file requirements.py where the error occurred. For @hysg, that would be this file:

    /usr/lib/python2.7/site-packages/packaging/requirements.py
    

    On me on OS X, it's here:

    /Library/Python/2.7/site-packages/packaging/requirements.py
    

    I modified the the offending line by removing the parentheses for the call to MARKER_EXPR, as demonstrated below:

    #MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
    MARKER_EXPR = originalTextFor(MARKER_EXPR)("marker")
    

    And that worked.

    Again, please be careful! I don't know what I'm doing and this could potentially cause more harm than good.

    0 讨论(0)
  • 2020-12-07 22:04

    It worked for me too (centos 7, python 2.7).

    python -m pip install --upgrade --force pip 
    pip install setuptools==33.1.1
    
    0 讨论(0)
  • 2020-12-07 22:08

    This is what worked for me:

    pip install setuptools==33.1.1
    

    It downgraded setuptools from 35.0.1 to 33.1.1 and pyparsing 1.5.7 installed!

    0 讨论(0)
提交回复
热议问题