pyinstaller No module named pyinstaller

后端 未结 14 2074
日久生厌
日久生厌 2020-12-16 14:49

I have 2 python versions installed under my mac osx sierra: python 3.5 python 2.7

I installed pyinstaller under python3.5 with this command:

python3         


        
相关标签:
14条回答
  • 2020-12-16 15:29

    None of the solutions have worked for me so i tried to uninstall pyinstaller via the command

    py -m pip uninstall pyinstaller

    The last path they gave was a path to the script "pyinstaller.exe". So all I did was drag and drop and it worked!

    0 讨论(0)
  • 2020-12-16 15:30

    I had the same problem, turns out module names are CASE-SENSITIVE which I didn't know, so instead of cmd -

    python3.5 -m pyinstaller mypython35script.py
    

    you're supposed to run

    python3.5 -m PyInstaller mypython35script.py
    

    Turns out there was no issue with Installation as it showed

    Requirement already satisfied: pyinstaller in ./lib/python3.5/site-packages Requirement already satisfied: setuptools in ./lib/python3.5/site-packages (from pyinstaller)
    

    pip install searches for the module name in PyPi (Python Package Index) where case doesn't matter

    Please feel free to correct me or add comments as I am fairly new to Python and command line

    0 讨论(0)
  • 2020-12-16 15:31

    Finally, this version drops support for Python 2.7, which is end-of-life since January 2020.. The minimum required version is now Python 3.5. The last version supporting Python 2.7 was PyInstaller 3.6.

    pip install pyinstaller==3.6
    

    So if anybody using python 2.7 version, Just install pyinstaller3.6 version and run it will work fine.

    0 讨论(0)
  • 2020-12-16 15:32

    I had the same trouble, so I tried to do as @mounirboulwafa says.

    I had to downgrade pip from version 19 to 18.1 :
    pip install pip==18.1

    But I got this error again even during pip 18 install!

    So I readed console logs again and saw some lines about user, permission etc. And tried to start cmd as admin, and repeat install pyinstaller.

    It works!

    So typical thing surprisely resolved the sitation. Hope it helps somebody.

    0 讨论(0)
  • 2020-12-16 15:35

    PyInstaller is case sensitive when being executed from the python3 - m method. You need to run it as follows.


    python3 -m PyInstaller yourscript.py


    If you want directly execute from the terminal you need to install it as follows.


    python3 -m pip install pyinstaller or pip3 install pyinstaller


    Following that, you need to set your global python executable to python3.


    pyinstaller yourscript.py


    0 讨论(0)
  • 2020-12-16 15:37

    You should navigate into your scripts folder and open command window there (by clicking right mouse button while holding down shift key) and write in there:

    pyinstaller mypython35script.py
    

    If the script is in another location drag your script into the command window after typing pyinstaller. Hope this helps.

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