Closed achimmihca closed 1 year ago
Ok thanks for the info, will look into it.
I use PyCharm and it works with venv
and conda
.
I had this error, but i copied all the files out of the src folder into the root and all runs well
I had this error and fixed it by adding sys.path.append(“C:\\path\\to\\dir”)
to the UltraSinger.py
The suggested solutions are workarounds to the issue.
The proper solution would be to fix the imports by removing the 'src.' part.
I can create a PR this weekend
This should do it: e74c35ee965b5f19b70b579490f5841f6ca29d35
According to discord chat it works now
Now tests are broken 🙈
Question is where pytest is looking for modules
pyproject.toml
__init__.py
to mark module directoriesI suggest to look at a repo on GitHub that can be used as template.
@achimmihca thanks. pyproject.toml
does the trick for the tests.
__init__.py
is already in the CI
branch
I installed dependencies successfully and changed to the virtual environment.
But when I try to run the main file, then I get
Tried to start the code from
F:\Dev\Projects\GitHub\UltraSinger\src
and fromF:\Dev\Projects\GitHub\UltraSinger
but both fail.Looking at the code, I found that modules are referenced for example with
from src.modules.Audio.denoise
.Obviously this works for you, which I think is weird. VSCode also does not complain. But on Windows I have to remove the
src.
part from the import to make it work.It's been a while since I did stuff with Python, but in Dedo Mouse I also referenced modules relative to the root code file.
Here, the root code file is UltraSinger.py, which is already in the src folder. Thus, other modules and files need to be referenced from this folder such that
from src.modules.Audio.denoise
should be written asfrom from modules.Audio.denoise
.I tested this and when I replace all
from src.
withfrom
, then it works fine.Please, check if it still works for you when you remove
src.
from the imports.