How do I fix this python converting file into an app - still have not found a solution

437 Views Asked by At

This question is not a duplicate of this question, because I am trying to create an app.

I am currently following this tutorial, but when I try to run my app,

my command prompt prints out this error:

enter image description here

Why does this error happen and how can I solve it? I read through all the answers to the linked question, but none of them are pertinent to my problem.

Please anyone help me, I still haven't found a working solution; I am getting desperate!!!

Edit: I can't just install and uninstall pynput? Idk why it doesn't work because shouldn't pynput come with idle?

Version: 3.74 python idle, most updated version of pyinstaller

3

There are 3 best solutions below

3
On

The following might help you if you haven't tried them already:

  1. Update pip from the command line
  2. Unistall pyinstaller
  3. Re-install pyinstaller and try it again

If the above does not work, try running the following command in the command line. Make sure there are some print statements in your code to see if it works.

python monitoring_culmination_product.py

If you got a message saying "python is not recognised as an internal or external command" then python might have not been added as an environment path.Try this to fix the issue. You could always re-install python if things get difficult.(make sure you install the appropriate version 32-64bit)

If the command though executed without a problem. Try to use pyinstaller on another file to see if the problem has to make sure the problem has to do with pyinstaller. From a personal experience, pyinstaller can be unreliable at times so I put the following line in my projects just to make sure. It might help you too.

import pkg_resources.py2_warn

Disclaimer: Although it is not specified I assume that you are using Windows

3
On

You could try to use conda create to get an environment containing all the need dependencies (numpy, etc) and then use pyinstaller as explained in this discussion.

0
On

Please fall back to 1.6.8 version of pynput. pip install pynput==1.6.8

Ref : https://stackoverflow.com/a/63721929/14759065