Open HelenLeeeeee opened 6 months ago
Add some information about the installation directory:
Can recreate the issue on Debian using the installation instructions given by the README.
______________________________________________ ERROR collecting openfast_toolbox/tools/tests/test_fatigue.py ______________________________________________
ImportError while importing test module '/home/bjarne/ida/projects/openfast_toolbox/openfast_toolbox/tools/tests/test_fatigue.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../miniconda3/envs/openfast_toolbox/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
openfast_toolbox/__init__.py:3: in <module>
from openfast_toolbox.common import *
E ModuleNotFoundError: No module named 'openfast_toolbox.common'
This seems to be a pytest/filepaths related issue, since importing openfast_toolbox from a python shell works just fine.
Can recreate the issue on Mac using the installation instructions given by the README. ` ======================================================================================== test session starts ======================================================================================== platform darwin -- Python 3.11.5, pytest-8.1.1, pluggy-1.4.0 rootdir: /Users/lucy/OpenFAST/openfast_toolbox plugins: anyio-4.3.0 collected 0 items / 36 errors
============================================================================================== ERRORS ===============================================================================================
__ ERROR collecting openfast_toolbox/aeroacoustics/tests/test_aa_tools.py _____
ImportError while importing test module '/Users/lucy/OpenFAST/openfast_toolbox/openfast_toolbox/aeroacoustics/tests/test_aa_tools.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.11/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
openfast_toolbox/init__.py:3: in
How to solve it? Thanks!
I encountered the same issue as you. May I ask if you have resolved this problem?
Dear all, After updating the conda version, there was a problem with the previous openfast_toolbox, so I re-installed it,during the re-installation,there are errors when pytest my package, the following is my installation process, I want to know what might be the problem?
Thanks,
I encountered the same issue as you. May I ask if you have resolved this problem?
It seems like the set of commands need to be different for anaconda. I'm not sure how to handle that at the moment. Any help is welcome.
I've updated the setup.py, which should make the pip install work (in #25).
pytest
will still fail for some reason, but python -m unittest discover
will work. I've updated the readme to reflect this.
If someone figures out how to make pytest work in anaconda, let me know...
For some reason, it seems that pytest
doesn't like the __init__.py
file in the root folder (https://stackoverflow.com/a/50400391). I removed ./__init__.py
(I kept all the other __init__.py
) locally and the tests are now passing. The exceptions are two hawc2 tests that I don't have time to check now but will get back to this later.
Maybe pytest
was trying to load ./__init__.py
instead of ./openfast_toolbox/__init__py
?
For some reason, it seems that
pytest
doesn't like the__init__.py
file in the root folder (https://stackoverflow.com/a/50400391). I removed./__init__.py
(I kept all the other__init__.py
) locally and the tests are now passing. The exceptions are two hawc2 tests that I don't have time to check now but will get back to this later.Maybe
pytest
was trying to load./__init__.py
instead of./openfast_toolbox/__init__py
?
Oh, why was there a __init__.py
file in the project's root to begin with? The actual Python package is in the openfast_toolbox
subdirectory, right?
Dear all, After updating the conda version, there was a problem with the previous openfast_toolbox, so I re-installed it,during the re-installation,there are errors when pytest my package, the following is my installation process, I want to know what might be the problem?
Thanks,