zhuminjie / OpenSeesPy

OpenSeesPy versions, doc, and pip
Other
157 stars 66 forks source link

Error importing compiled openseespy on Mac M2 #127

Closed Omar-A-M closed 5 months ago

Omar-A-M commented 5 months ago

I want to add a new material in opensees. I managed to compile opensees and openseespy. I used pip3 install openseespy and it works fine but when I change the opensees.so in the root directory with the new opensees.so I get the following error:

image

I tried also installing openseespy on python3.11 which is what I used to compile openseespy I still get the same error just different directory as shown bellow: image

Is there any solution for that?

Thanks in advance

zhuminjie commented 5 months ago

If you already compiled opensees.so, you can put it on your python path and import opensees as ops directly.

Omar-A-M commented 5 months ago

Hey zhuminjie, thank you for your quick response. But the issue is not closed so kindly open it again.

I added opensees.so to the python path but when I import opensees.so to my script as import openseespy.opensees it gives me the errors shown up.

If I put back the opensees.so I got from pip3 install openseespy then it works. Which is confusing as why the new opensees.so can't be imported the same way.

zhuminjie commented 5 months ago

I believe it’s because the current openseespymac is built on intel based mac os. Even if you replace the opensees.so, the dependencies shipped are still based on intel, which caused the errors. So I advised you to import opensees.so directly, which will link to dependencies on your machine.

We are working on the updates to the mac version to support arm64 based processors. Probably release in a couple months.

Omar-A-M commented 5 months ago

Thank you so much for your help.