Closed rickmcgeer closed 3 months ago
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. But I spent hours chasing this, and the directory naming was suggested for pip...so better feedback to the user would have helped. If I can think of a way to do that I'll file an enhancement request. Thanks and sorry to take your time on this one.
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 using