tum-pbs / PhiFlow

A differentiable PDE solving framework for machine learning
MIT License
1.39k stars 189 forks source link

installation error in python 3.11 #139

Closed who-m4n closed 10 months ago

who-m4n commented 11 months ago

I have got the following error when I import phi after the installation:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 3508, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in import phi File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/phi/init.py", line 13, in from . import python_builder File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/phi/python_builder.py", line 37, in PythonBuilder.Register2(f, "") File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/phi/builder.py", line 321, in Register2 return cls.RegisterAt(2, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/phi/builder.py", line 274, in RegisterAt cls._RegisterAt(n, f, library_path, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/phi/builder.py", line 235, in _RegisterAt cls.RegisterMethod(method, library_path, alias=alias, original_name=original_name, doc=doc, wrapped=wrapped, explanation=explanation, method_type=method_type, explain=explain) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/phi/builder.py", line 194, in RegisterMethod cls._RegisterMethod(f, library_path, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/phi/builder.py", line 44, in _RegisterMethod fn_signature = utils.get_method_sig(f) ^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/phi/utils.py", line 77, in get_method_sig argspec = inspect.getfullargspec(method) ^^^^^^^^^^^^^^^^^^ AttributeError: module 'inspect' has no attribute 'getargspec'

who-m4n commented 11 months ago

I downgraded to Python 3.10 to solve this issue.

holl- commented 11 months ago

Strange, I can run it on 3.11. What commands did you use to install it?

who-m4n commented 11 months ago

I used the instructions mentioned here.

Meanwhile, I'm using Macbook m1. Can it be the reason?

holl- commented 11 months ago

Could you run

pip uninstall phiflow phi
pip install phiflow==2.5.0

and try it again?