question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import error after pyinstaller

See original GitHub issue

I install keyboard from master code.

  File "my_code.py", line 4, in <module>
    import keyboard
  File "c:\miniconda3\envs\x86\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

    exec(bytecode, module.__dict__)
  File "site-packages\keyboard\__init__.py", line 126, in <module>
  File "importlib\__init__.py", line 109, in import_module
ImportError: No module named 'keyboard._winkeyboard'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bopprehcommented, Mar 26, 2018

Ah, so PyInstaller is probably parsing the source code to find imports. No, there’s no reason why we cannot go back. I’ll revert the change as soon as I get home.

Now I feel kinda stupid for doing that just to get 100% coverage. Oh well, living is learning.

0reactions
CrafterFlanceBOOMcommented, Dec 11, 2019

Hello, I got an error yesterday. I tried deleting the keyboard folder and then install it again with pip, but it does not even work still. I also got Visual Studio 2017 and I think that’s problem. Traceback:

C:\Users\brand\Desktop\VirusShooter>“Virus Shooter.py” Traceback (most recent call last): File “C:\Users\brand\Desktop\VirusShooter\Virus Shooter.py”, line 1, in <module> import keyboard ImportError: No module named keyboard

Read more comments on GitHub >

github_iconTop Results From Across the Web

Imported module not found in PyInstaller - Stack Overflow
I'm working in Windows, using PyInstaller to package a python file. But some error is occuring ...
Read more >
When Things Go Wrong — PyInstaller 5.7.0 documentation
If Analysis thinks it has found all the imports, but the app fails with an import error, the problem is a hidden import;...
Read more >
Pyinstaller: Module not found when running .exe when ...
This works find in PyCharm, but when I produce a Windows exe using PyInstaller it errors at runtime: .\pyinst_excel.exe Traceback (most recent call...
Read more >
Cv2 import error when I run executable file built by pyinstaller
Hi, I face an issue with import cv2 when I run executable file built by pyinstaller. I built executable file using pyinstaller inside...
Read more >
ImportError when running an executable from a python script ...
seems like pyinstaller cannot find 'blockgemv.c' and 'blockger.c' and you need to put them in correct place before you can get your script.exe ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found