pyinstaller No module named pyinstaller

39,711

Solution 1

Their package name have caps in it (not sure if it's very PEP8 tho..). This should work if you can't find the pyinstaller executable script:

python -m PyInstaller your_script.py 

Solution 2

I had same issue here, and i tried everything, but finally i found the solution :

enter image description here

I had to downgrade pip from version 19 to 18.1 :

pip install pip==18.1

Then install PyInstaller :

pip install pyinstaller

.

As you see i managed to install it : enter image description here .

After that you can upgrade your pip again :

python -m pip install --upgrade pip

Solution 3

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


Solution 4

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.

Solution 5

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.

Share:
39,711

Related videos on Youtube

pempem
Author by

pempem

I like to know more about programming

Updated on October 24, 2021

Comments

  • pempem
    pempem over 2 years

    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.5 -m pip install pyinstaller
    

    If I run again the same command I'm getting:

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

    That to me means that is is installed under python 3.5 and ready to be used.

    When I run this command:

    python3.5 -m pyinstaller mypython35script.py
    

    I'm getting: /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5: No module named pyinstaller

    why? What I'm doing wrong?

    Cheers D.

    • Sam Chats
      Sam Chats almost 7 years
      Have you tried just pyinstaller mypython35script.py?
    • pempem
      pempem almost 7 years
      yes but isn't working for me because if I do this it works using python2.7 not the 3.5 version that I need to run.
    • Algorithmic
      Algorithmic almost 7 years
      maybe remove Python3.5 from the PATH and then once you're done with pyinstaller, add it back? Just a thought
  • pempem
    pempem almost 7 years
    If I run that command is going to pick up the default OSX python version that I don't / can't use.
  • Dragon
    Dragon almost 7 years
    For python 2.7 you must be having a folder such as Python27. But for Python 3.5 you may be having a folder like Python35 (or Python35-32). In that folder you will find similar contents. Find in there the script folder then do the necessary operations. Nevertheless, if the exe is created once it doesn't really concern which python version it was used to make (as long as the dist folder is not messed up with)
  • Dragon
    Dragon almost 7 years
    In you question you mentioned the error as No module named pyinstaller which is because the pyinstaller module was not installed for the python 3.5 version.
  • mounirboulwafa
    mounirboulwafa over 5 years
    @Paolo i tried everything to fix it, and this is the only thing that worked for me.
  • Paolo
    Paolo over 5 years
    Fine, for this reason accept (sorry I said "check") your answer. To mark an answer as accepted, click on the check mark beside the answer to toggle it from greyed out to filled in (green). For StackOverflow stats it means one more successful answer on the platform.
  • 1UC1F3R616
    1UC1F3R616 almost 5 years
    This sounds funny but Today I was using using PyInstaller but forgot about it's correct import name and spend 20 minutes to figure it out then when finally I came here and saw my upvote. So Thankyou again @Guillaume
  • Zid
    Zid almost 5 years
    This overwrites the specfile
  • ANUP SAJJAN
    ANUP SAJJAN about 2 years
    wasted 3 hours on this error, thanks!!