Python `no module pip.__main__;` error when trying to install a module

后端 未结 4 1322

I am getting the following error on my Raspberry Pi: No module named pip__main__; \'pip\' is a package and cannot be directly executed

When I type in to

4条回答
  •  渐次进展
    2020-12-11 17:25

    pip is a standalone executable. If pip if in your path, you can just execute

    pip install mp3play
    

    If pip is not in your path, then you need to navigate to the directory where pip is located and then execute the above.

    If needed, add sudo to the command.

    The precise error you are encountered is due to pip being a package, but -m is used for executing modules.

    EDIT: pip also comes with several helpful alias functions that point to different Python installs. In general, pip points to your main Python install (the one you enter when simply executing python), pipV where V is a number such as 2 or 3 adds the install to your primary Python of version V (pip3 adds to your python3 environment). Finally there is pipV.S where V is the same as before and S is the subversion. For instance pip3.4 installs for Python 3.4.

提交回复
热议问题