-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
pytest consistently raises ImportError #12532
Comments
It turns out that this was due to a confused path on my part, and pytest's default path. /workspaces was in the python path, so it looked for /workspaces/sdtp/sdtp_utils.py, when the module was /workspaces/sdtp/sdtp/sdtp_utils.py. Fixed by changing this to /workspaces/sdtp/sdtp_data/sdtp_utils.py and importing from sdtp_data. |
I'm running pytest with the command
$ tree
gives the following output: (irrelevant files and directories omitted for clarity)Pytest (run from the root directory) gives the following error:
However, from the same directory
No import error. The
rootdir
reported by pytest is correct, and the import failures are in a subdirectory which has an__init__.py
file.Here is the output of
pip list
:I'm running pytest 8.2.2, Python 3.11.4, under VSCode in a Docker container. /etc/debian_version is 11.7
The repo for the distribution is in https://github.com/engageLively/stdp. Running the given command in the root directory excites the error
pip list
from the virtual environment you are usingThe text was updated successfully, but these errors were encountered: