Python Forum
Help with pyinstaller "No module named"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with pyinstaller "No module named"
#10
It work when i test,i use virtual environment always when troubleshoot Pyinstaller.
# Make 
G:\div_code
λ python -m venv router_env

# Cd in
G:\div_code
λ cd router_env\

# Activate
G:\div_code\router_env
λ G:\div_code\router_env\Scripts\activate.bat

# Install
(router_env) G:\div_code\router_env
λ pip install pyinstaller RouterOS-api
.....
Installing collected packages: pywin32-ctypes, altgraph, six, pyinstaller-hooks-contrib, pefile, RouterOS-api, pyinstaller
Successfully installed RouterOS-api-0.17.0 altgraph-0.17.3 pefile-2023.2.7 pyinstaller-5.12.0
pyinstaller-hooks-contrib-2023.3 pywin32-ctypes-0.2.0 six-1.16.0
Test code:
# router.py
import routeros_api

connection = routeros_api.RouterOsApiPool('IP', username='admin', password='')
print(connection.username)
input('Press Enter to exit')
Build:
(router_env) G:\div_code\router_env
λ pyinstaller --onefile route.py
500 INFO: PyInstaller: 5.12.0
500 INFO: Python: 3.11.3
572 INFO: Platform: Windows-10-10.0.19045-SP0
.....
16020 INFO: Building EXE from EXE-00.toc completed successfully.
When run router.exe it print admin,so it work and find module routeros_api,
if not i would have gotten same error message as you get.
buran likes this post
Reply


Messages In This Thread
RE: Help with pyinstaller "No module named" - by snippsat - Jun-15-2023, 12:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 1,160 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 24,522 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 3,029 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,655 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,735 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,513 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 1,153 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,107 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  ModuleNotFoundError: No module named 'omsdk.sdkproto' donvito7 4 1,995 Oct-20-2022, 02:56 PM
Last Post: deanhystad
  ModuleNotFoundError: No module named '_struct' when starting pip3 yuhuihu 0 2,981 May-05-2022, 04:41 AM
Last Post: yuhuihu

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020