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.

Module Not Found Error

See original GitHub issue

I’m trying to make an executable file out of the python code below:

import cobra
import _libsbml
print(1)

However, I keep receiving the error message ModuleNotFoundError: No module named '_libsbml'

Any ideas on how to solve this? The line “import _libsbml” was not in my original code. I added it while trying to solve this problem. I also added “_libsbml” on the “–hiddenimport” advanced field, but without results.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
rcolpocommented, Jun 12, 2020

Thank you. Adding the module location to --paths solved the problem. Thank you very much.

0reactions
brentvollebregtcommented, Jun 12, 2020

So adding --debug all to your command make this error occur when packaging the script? That’s odd.

Typically you need to use --hidden-import when not using the import keyword, but looking back at your original script, you were using it, so using --hidden-import probably won’t help - PyInstaller just can’t find the import.

Maybe if you can locate where the .py associated with the import is, you could add it’s location to --paths to tell PyInstaller to look there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: no module named Python Error [Fixed]
How to fix the ModuleNotFoundError in Python · 1. Make sure imported modules are installed · 2. Make sure modules are spelled correctly...
Read more >
How to Fix ModuleNotFoundError and ImportError
How to fix ModuleNotFoundError and ImportError? · first make sure you are using absolute imports · export the project's root directory to ...
Read more >
Python - Module Not Found - Stack Overflow
I got the error ModuleNotFoundError: No module named 'requests.adapters'; 'requests' is not a package. Turns out the file I created in the same...
Read more >
Python ModuleNotFoundError Solution - Career Karma
The ModuleNotFoundError is raised when Python cannot locate an error. The most common cause of this error is forgetting to install a module...
Read more >
Python Import Error (ModuleNotFoundError) - Finxter
Python's ImportError ( ModuleNotFoundError ) indicates that you tried to import a module that Python doesn't find. It can usually be eliminated by...
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