pip no longer working after update error 'module' object is not callable

前端 未结 10 835
予麋鹿
予麋鹿 2020-11-28 04:31

After a pip update, pip has stopped working completely.

Z:\\>pip install matplotlib
Traceback (most recent call last):
  File \"c:\\program files\\python3         


        
相关标签:
10条回答
  • 2020-11-28 04:47

    Have the habit of installing any python packages with pip using python -m, say for installing numpy use below command:

    python -m pip install numpy

    In case if it errros out with the environment permission error append --user in the same command:

    python -m pip install numpy --user

    0 讨论(0)
  • 2020-11-28 04:48

    in one case, from your python file do this edit to your IMPORT

    --import [MODULE]
    ++from [MODULE_NAME] import [MODULE]
    
    0 讨论(0)
  • 2020-11-28 04:50

    This worked for me, uninstall pip 19.3.1 and replace with 19.0.3, error gone.

    python -m pip install pip==19.0.3 --user
    
    0 讨论(0)
  • 2020-11-28 04:52

    I cannot leave the comments yet, therefore I've decided to leave a link with an explanation why this can happen: https://github.com/pypa/pip/issues/5599

    If this is the case you can try to fix it by downgrading the pip version with the following command:

     python -m pip install pip==<previous version>
    
    0 讨论(0)
  • 2020-11-28 04:54

    I've had the same issue as you, and I solved it uninstalling pip and installing again.

    To uninstall: python -m pip uninstall pip

    To install, follow the instructions: https://www.liquidweb.com/kb/install-pip-windows/

    After that you will going to have a older but functional 19.0.3 version.

    0 讨论(0)
  • 2020-11-28 04:54

    If you do not wish to use the long command every time python -m pip install <package>, reinstall pip to the older version where this error wasn't there.

    python -m pip install pip==19.0.3
    

    Now you will be able to use pip install matplotlib or pip list normally.

    And whenever the bug is resolved, upgrade pip like you did before.

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