-
Notifications
You must be signed in to change notification settings - Fork 21
ModuleNotFoundError: No module named 'examplepy' #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Getting the same error, trying to run the tests with the unmodified repo. I'm new to packages, and was hoping to find a clear sample that I can run as is. |
Update @ 15 Jan 2024We can avoid the raw Read more: Original Post @ 12 Apr 2023Thought I'd drop a comment since I've been bashing my brain out over this for the last day: I've also run into the same issue, regarding being unable to directly import from the package name, and no tutorial or example project I've seen seems to have had it or address it. Given the file structure:
When running pytest:
It turned out that there were two issues at play:
Fixing TestsFor our tests, we need to add "src" to import sys
from pathlib import Path
sys.path.append(
str(Path(__file__).parent.parent.joinpath("src"))
) And now Fixing PyCharm
|
I downloaded the example package and tried to run test_module1.py. I got an error:
ModuleNotFoundError: No module named 'examplepy'
. I use VSCode on Windows 10, and the contents of vscode.env are as in the repository:Is it possible that VSCode ignores this file?
The text was updated successfully, but these errors were encountered: