Python Forum
ModuleNotFoundError: No module named '...' - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: ModuleNotFoundError: No module named '...' (/thread-21654.html)



ModuleNotFoundError: No module named '...' - tlg265 - Oct-08-2019

Hello, I have two issues with this brand new project:

https://github.com/tlg-265/machinelearning.com-python

ISSUE 1:

when I run:

$ python scripts/train_model.py
I get:

Traceback (most recent call last):
  File "scripts/train_model.py", line 10, in <module>
    import machinelearningcom_python
ModuleNotFoundError: No module named 'machinelearningcom_python'
This is the line mentioned on the error above:

https://github.com/tlg-265/machinelearning.com-python/blob/master/scripts/train_model.py#L10

ISSUE 2:

If I add a small comment on the top of the file like:

[Image: image.png]

Then, when trying to commit (through miniconda) I get the following failure with isort hook:

(base) D:\machinelearning.com-python>git commit -m 'test'
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\anon/.cache\pre-commit\patch1570560215.
Trim Trailing Whitespace.................................................Passed
Check for added large files..............................................Passed
Check python ast.........................................................Passed
Check JSON...........................................(no files to check)Skipped
Check for merge conflicts................................................Passed
Check Xml............................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
Debug Statements (Python)................................................Passed
Fix End of Files.........................................................Passed
Fix requirements.txt.................................(no files to check)Skipped
Mixed line ending........................................................Passed
Flake8...................................................................Passed
isort....................................................................Failed
hookid: isort

Files were modified by this hook. Additional output:

Fixing D:\machinelearning.com-python\scripts\train_model.py

[INFO] Restored changes from C:\Users\anon/.cache\pre-commit\patch1570560215.
Any idea on how to solve these two issues?

Thanks!


RE: ModuleNotFoundError: No module named '...' - maxtimbo - Oct-09-2019

first error looks like a dependency issue. try installing the module using pip or searching for the module online. The second is a github thing. I use github desktop, so i'm not sure how to stage changes in the CLI before committing them, but I know you need to before you can commit any changes.