Skip to content
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

Pip install fails due to numpy/PIL error #1142

Open
nhmasterolt opened this issue Aug 27, 2024 · 3 comments
Open

Pip install fails due to numpy/PIL error #1142

nhmasterolt opened this issue Aug 27, 2024 · 3 comments

Comments

@nhmasterolt
Copy link

Hello,

I just tried installing sfepy on windows 11 using various python versions from 3.7, 3.8, 3.9 and 3.12. However, all raised
"AttributeError: module 'numpy.typing' has no attribute 'NDArray'";
If I got it right, the issue lies in some sub-module taking a numpy version <1.20 while >1.20 is installed. Unfortunately, however, trying to install different numpy versions before installing sfepy does not resolve the issue, and my installation fails.

Best,

@rc
Copy link
Member

rc commented Aug 29, 2024

Hello, maybe try the installation in a fresh virtual environment, so that no version clashes occur. Are you using conda?

@nhmasterolt
Copy link
Author

nhmasterolt commented Sep 2, 2024

Hello, thanks for your answer.

I'm trying pip in a fresh venv.

As an alternative to installing from pypi directly, cloning the source code, version sfepy-release_2024.2, and install using pip install -e . I can successfully install, but running sfepy-test, I run into

ImportError while importing test module '\tests\test_dg_field.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Tools\Python\Python312\Lib\importlib_init_.py:90: in import_module
return bootstrap.gcd_import(name[level:], package, level)
sfepy\tests\test_dg_field.py:5: in
from sfepy.discrete.fem import FEDomain
sfepy\discrete_init
.py:9: in
from .variables import (Variables, Variable, FieldVariable, DGFieldVariable,
sfepy\discrete\variables.py:20: in
from sfepy.discrete.fem.lcbc_operators import LCBCOperators
sfepy\discrete\fem_init
.py:11: in
from .fields_base import Field
sfepy\discrete\fem\fields_base.py:26: in
from sfepy.discrete.fem.mappings import FEMapping
sfepy\discrete\fem\mappings.py:9: in
from sfepy.discrete.common.mappings import Mapping, PyCMapping
sfepy\discrete\common\mappings.py:7: in
from sfepy.discrete.common.extmods.cmapping import CMapping
E ModuleNotFoundError: No module named 'sfepy.discrete.common.extmods.cmapping'

@rc
Copy link
Member

rc commented Sep 9, 2024

Can you try just pip install ., i.e. no editable install?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants