Closed yangfan256 closed 1 year ago
It is probably related to this, I have also previously had this issue if I did not install python3-dev: https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory
There are instructions there for different Linux distributions
Thanks for your reply! But I have checked the python3-dev and it is the newest version, so maybe there is another potential problem?
I'm not aware of another cause, sorry -- apologies if this is obvious (I don't know if you are experienced with Python), but is it possible that you have multiple versions of Python installed (i.e. Python 3.6 and Python 3.8, or Anaconda Python and 'normal' Python)? It may be that the python3-dev you installed is not actually for the Python executable you are using to try to install S4. These instructions are slightly outdated now (since new versions of Ubuntu come with Python 3.8 by default and Python 3.9 is now available), but here are all the steps I have used previously to set up my Python environment prior to installing S4:
https://rayflare.readthedocs.io/en/latest/Installation/python_install.html
Thanks for your suggestions and I have checked my python version. Yes, there are several versions for python3 and I am using python3.8, so I install the python3.8-dev and the problem get solved!
However, when I try to test if the module works well and run the PythonTest.py, the error shows that
AttributeError: partially initialized module 'S4' has no attribute 'New' (most likely due to a circular import)
and I do find that the attributes are not available after I import S4.
Sorry to bother again...
I found the S4 is too old for python, and the original author Victor Liu does not maintain the python extension himself. What S4 attracts me most is that it could deal with anisotropic dielectrics.
I'm not sure what the issue is, but it might be because you are trying to run things while the active working directory (for Python) is the directory where you downloaded S4? This way it might be trying to import from the S4 folder locally rather than from the compiled, installed version. So maybe trying copying the example to a different directory and running it there.
P.S. It is not in the current version, but I have been working on implementing anisotropic materials in RayFlare itself (the work I've done so far is in the anistropic_mat branch, in case it is of interest to you.
Thank you a lot! I guess you are right. Now the S4 can work in my server.
Hi there!
It's nice to see that you are maintaining S4 and extending it to python3. However, I meet an installation problem related with "#include Python.h". It seems the python.h file is missing. I have upgraded all the dependencies that you mentioned before the installation, but the problem occurs. The error information is as follows, after I commanded "make S4_pyext". Do you have any suggestions?
Thanks!