zhuminjie / OpenSeesPy

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

seems to fail on an M1 Mac. #89

Open fmckenna opened 2 years ago

fmckenna commented 2 years ago

OpenseesPY__m1

Stevan!

mhscott commented 2 years ago

Switch to linux or windows

firai commented 2 years ago

Not a Mac user, but try installing Homebrew through a Rosetta terminal, and then install x86-64 Python through that?

firai commented 2 years ago

Also, you should use Python 3.9. Opspy seems to have dependency issues on 3.10 (i.e. the maintainers have locked the requires to 3.9).

doub1emint commented 1 year ago

Hi, fmckenna Did you solve this problem? Recently, I encounter the same problem as you. Do you have any suggestions for this problem?

hiroakikawamura commented 1 year ago

I met same issue.

*****/site-packages/openseespymac/opensees.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')),

Biaggio74 commented 1 year ago

Similar issue here, computer spec: Chip: Apple M2 Pro Memory: 16GB MacOS: 13.0

(apienv) projects/shm-api (BI-469)  % pip install openseespy
Requirement already satisfied: openseespy in ./apienv/lib/python3.9/site-packages (3.3.0.1.1)
Requirement already satisfied: openseespymac>=3.3.0.1 in ./apienv/lib/python3.9/site-packages (from openseespy) (3.4.0.2)
(apienv) projects/shm-api (BI-469)  % python
Python 3.9.1 (default, Mar 23 2023, 20:56:44) 
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import openseespy.opensees as ops
Traceback (most recent call last):
  File "/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespy/opensees/__init__.py", line 27, in <module>
    from openseespymac.opensees import *
ImportError: dlopen(/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespymac/opensees.so, 0x0002): tried: '/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespymac/opensees.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespymac/opensees.so' (no such file), '/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespymac/opensees.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespy/opensees/__init__.py", line 30, in <module>
    raise RuntimeError('Failed to import openseespy on Mac.')
RuntimeError: Failed to import openseespy on Mac.
>>> import openseespy.opensees as ops
ChuandongXie commented 1 year ago

Similar issue here, computer spec: Chip: Apple M2 Pro Memory: 16GB MacOS: 13.0

(apienv) projects/shm-api (BI-469)  % pip install openseespy
Requirement already satisfied: openseespy in ./apienv/lib/python3.9/site-packages (3.3.0.1.1)
Requirement already satisfied: openseespymac>=3.3.0.1 in ./apienv/lib/python3.9/site-packages (from openseespy) (3.4.0.2)
(apienv) projects/shm-api (BI-469)  % python
Python 3.9.1 (default, Mar 23 2023, 20:56:44) 
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import openseespy.opensees as ops
Traceback (most recent call last):
  File "/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespy/opensees/__init__.py", line 27, in <module>
    from openseespymac.opensees import *
ImportError: dlopen(/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespymac/opensees.so, 0x0002): tried: '/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespymac/opensees.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespymac/opensees.so' (no such file), '/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespymac/opensees.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/******/projects/shm-api/apienv/lib/python3.9/site-packages/openseespy/opensees/__init__.py", line 30, in <module>
    raise RuntimeError('Failed to import openseespy on Mac.')
RuntimeError: Failed to import openseespy on Mac.
>>> import openseespy.opensees as ops

Same here.

burakai commented 1 year ago

Same issue with the M2 pro chipset. I wanted to try helping to a friend. But I can't even import the library. lol.

serkanhasanoglu commented 9 months ago

The problem was solved in my case after applying the steps below.

  1. Install Rosetta
  2. Create a Rosetta terminal
  3. Install X86 homebrew in the Rosetta terminal
  4. Create an alias for the X86 homebrew in /usr/local/bin/brew
  5. Use the X86 brew to install X86 python (ends up /usr/local/bin/python3)
  6. pip install
ihsanenginbal commented 9 months ago

You can solve this also via Miniconda, which then still allows using Spyder as IDE as normal. Please see: https://github.com/zhuminjie/OpenSeesPy/issues/128#issuecomment-1942717317