No Module Named Pyinstaller

Posted on

Join GitHub today. GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together. ImportError: No module named 'PyQt5.QtWebEngineWidgets' Failed to execute script run. No such so anywhere:($ pyinstaller --onedir -p lib/python3.5 run.spec.

  1. Importerror: No Module Named Numpy
  2. Importerror No Module Named Future
  3. Python Importerror No Module Named Requests

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

I installed pyinstaller under python3.5 with this command:

Importerror: No Module Named Numpy

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

Requirement already satisfied: pyinstaller in ./lib/python3.5/site-packagesRequirement 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:

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

why?What I'm doing wrong?

CheersD.

No module named pyinstaller
pempempempem

9 Answers

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

I had to downgrade pip from version 19 to 18.1 :

Importerror No Module Named Future

Then install PyInstaller :

.

As you see i managed to install it :.

After that you can upgrade your pip again :

mounirboulwafamounirboulwafa

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:

Guillaume LebretonGuillaume Lebreton

Right now the only way I found to make it works is to:navigate to:

/Library/Frameworks/Python.framework/Versions/3.5/bin

run pyinstaller mypython35script.py

cheersd.

psI still don't know why is not working in the way I described in my first post.

pempempempem

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 pip18.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.

Владислав СтадникВладислав Стадник

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:

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

Biswa_9937Biswa_9937

Rename your pyinstaller to pyinstaller35 and also rename your pyinstaller-script.py to pyinstaller35-script.py inside the scripts directory which is inside the python3.5 installation directory. Now add the scripts directory to the system path. Now you can run it as pyinstaller35 yourfile.py -F

sajeewaspsajeewasp

From Anaconda prompt the following works for me. Run the following command after navigating to the location of the module

V111V111

In my case I just opened cmd in Admin mode and re-ran the below cmd and it worked.

pip install pyinstaller

AnujAnuj

Python Importerror No Module Named Requests

Hardik PatelHardik Patel

Not the answer you're looking for? Browse other questions tagged pythonmacospyinstallermacos-sierra or ask your own question.

Join GitHub today

GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.

Sign up New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments

commented Jan 12, 2018

An ImportError occurs at runtime after bundling an application using the pyttsx3 library. The error occurs when the text-to-voice engine is initialized, not when the library is imported:

PyInstaller builds the executable without any issue and as such, the log file is empty.
I am not using any Python distribution, only the base libraries and manually installed third-party libraries.

Platform details:

Here is a link to a gist containing the steps to reproduce, a sample program, the spec file and the stack trace: https://gist.github.com/AlexPicaro/aac977ead73c48a1e8e0d0d35f1a4cab

commented Feb 1, 2018
edited

Pyinstaller doesn't bundle everything it should when compiling the file. Pyttsx has hooks setup for it and was fixed. Pyttsx3 was created to support Python 3.X, I would recommend using pyttsx, if you're using Python 2.X. I've been banging my head on this problem for a couple of months or so. I just haven't had the hours to devote to it to track it all down.

commented Feb 7, 2018

I see that you're already collecting the submodules, so that's not the issue. It seems that your issue here, is directly related to the issue I was having.

I fixed it by creating a new hook-pyttsx3.py file which essentially does the same thing as your collect_submodules statement in your spec file.

Then, I also commented out all lines in the pyi_rth_win32comgenpy.py file. Should be located in the rthooks folder. C:UsersYourUserNameAppDataLocalProgramsPythonYourPythonFolderLibsite-packagesPyinstallerloaderrthooks
(Alternatively, you can just move the file and / or delete it.)

I'm guessing the pyi_rth_win32comgenpy.py hook is messing up something for you too.

Author

commented Feb 8, 2018

Hey sorry I didn't respond to your first comment! The message got lost in my inbox. I tried that last solution you posted, and that solved my problem. Thanks a bunch!

I'm still having issues though, so I'll try pyttsx instead.

commented Feb 9, 2018

What issue are you having?

Author

commented Feb 10, 2018

Different import error, but I really don't know what to make of this one. Here's the stack trace:

commented Feb 12, 2018

Did you try commenting out all of the lines in the file /site-packages/pyinstaller/loader/rthooks/pyi_rth_win32comgenpy.py ?

pyi_rth_win32comgenpy.py file commented out:

Author

commented Feb 12, 2018

I did.

Pyinstaller

commented Feb 13, 2018

Try uncommenting these two lines in the pyi_rth_win32comgenpy.py file:

Author

commented Feb 14, 2018

I get the same stack trace as before.

commented Feb 16, 2018
edited

I noticed in your gist, that you have wine settings setup in your spec file.

You may be having issues with wine + pyinstaller. Python 2.7 + pyttsx3 + Win10 + Pyinstaller works with the pyttsx3 hook.

The pyi_rth_win32comgenpy.py file doesn't seem to have any effect on Python 2.7 + pyttsx3. Uncommented or commented out, a pyttsx3 test doesn't throw any errors when compiled with pyinstaller.

The pyi_rth_win32comgenpy.py file breaks a simple command line example with Python 3.4 or Python 3.6 + pyttsx3. Creating a check to see, if the python version is >= 3.0 to skip everything in the file for a Python 3.X install works for me.

It seems that at least something in the pyi_rth_win32comgenpy.py file helps with your Python2.X + pyttsx3 + wine build, but there's still something more that's not working right.

Pyinstaller no module named publisher

referenced this issue Feb 19, 2018

Open

fixed / workaround for pyttsx3 test won't work once compiled with pyinstaller #3268

Member

commented Jan 7, 2019

No reaction for several months, assume this is solved. Otherwise please try PyInstaller v3.4 and the current development version.

commented Jan 20, 2019
edited

Not solve it yet...

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment