Python Forum
ModuleNotFoundError after publishing project
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError after publishing project
#1
So I'm pretty sure I followed the PyPI tutorial to a T. I have the entry point set for the __main__.py script's main method. The build process (setup.py sdist bdist_wheel) finished without errors. It even shows the 'missing modules' during the build. Yet when I install the module, it tells me

PS C:\Users\shu\Projects\bayscrape> bayscrape
Traceback (most recent call last):
  File "C:\Users\shu\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\shu\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\shu\AppData\Local\Programs\Python\Python39\Scripts\bayscrape.exe\__main__.py", line 4, in <module>
  File "C:\Users\shu\AppData\Local\Programs\Python\Python39\lib\site-packages\bayscr\__main__.py", line 5, in <module>
    from bsutils import get_input, output
ModuleNotFoundError: No module named 'bsutils'
The first line of code in __main__.py is from bsutils import get_input, output. Why isn't the bsutils module found when it's included during the setup process? I'm missing something small aren't I?
Reply
#2
SO I learned I had to reference the project name for each import in each file Dance so from bayscrape.bsutils import ... did the trick

topic can be closed thank you anyway!
Reply
#3
Thank you for sharing once you got the solution. Not everyone does so...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Publishing two boards side by side DJ_Qu 4 2,441 May-15-2019, 08:57 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

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