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

Install errors on MacOS arm64 #582

Open
gregmacfarlane opened this issue Oct 23, 2024 · 4 comments
Open

Install errors on MacOS arm64 #582

gregmacfarlane opened this issue Oct 23, 2024 · 4 comments

Comments

@gregmacfarlane
Copy link

I am working on internal research, trying to use Aequilibrae to estimate travel time skim matrices.

Describe the bug

I created a new conda environment with only pip install aequilibrae running python 3.11 on MacOS. M1 processor, apple silicon. I already had libspatialite version 5.1 installed on the system.

Upon loading aequilibrae, we get this error, suggesting that the sparse matrix library is only available for intel architecture. Is this real?

from aequilibrae.project import Project
{
	"name": "ImportError",
	"message": "dlopen(/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/sparse_matrix.cpython-311-darwin.so, 0x0002): tried: '/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/sparse_matrix.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/sparse_matrix.cpython-311-darwin.so' (no such file), '/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/sparse_matrix.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))",
	"stack": "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mImportError\u001b[0m                               Traceback (most recent call last)\nCell \u001b[0;32mIn[1], line 5\u001b[0m\n\u001b[1;32m      3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpath\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m join\n\u001b[1;32m      4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtempfile\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m gettempdir\n\u001b[0;32m----> 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Project\n\u001b[1;32m      6\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mparameters\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Parameters\n\u001b[1;32m      7\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mfolium\u001b[39;00m\n\nFile \u001b[0;32m/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/__init__.py:7\u001b[0m\n\u001b[1;32m      5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mlog\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m logger, global_logger\n\u001b[1;32m      6\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mparameters\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Parameters\n\u001b[0;32m----> 7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdata\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Matrices\n\u001b[1;32m      8\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mlog\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Log\n\u001b[1;32m      9\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m matrix\n\nFile \u001b[0;32m/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/project/__init__.py:1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Project\n\u001b[1;32m      2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mabout\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m About\n\u001b[1;32m      3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mnetwork\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mnetwork\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Network\n\nFile \u001b[0;32m/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/project/project.py:11\u001b[0m\n\u001b[1;32m      9\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mparameters\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Parameters\n\u001b[1;32m     10\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mabout\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m About\n\u001b[0;32m---> 11\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdata\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Matrices\n\u001b[1;32m     12\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdatabase_connection\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m database_connection\n\u001b[1;32m     13\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcontext\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m activate_project, get_active_project\n\nFile \u001b[0;32m/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/project/data/__init__.py:1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmatrices\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Matrices\n\nFile \u001b[0;32m/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/project/data/matrices.py:6\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpath\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m isfile, join\n\u001b[1;32m      4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpandas\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mpd\u001b[39;00m\n\u001b[0;32m----> 6\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmatrix\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m AequilibraeMatrix\n\u001b[1;32m      7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdata\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmatrix_record\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m MatrixRecord\n\u001b[1;32m      8\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01maequilibrae\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproject\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtable_loader\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m TableLoader\n\nFile \u001b[0;32m/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/__init__.py:3\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01maequilibrae_matrix\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m AequilibraeMatrix, matrix_export_types\n\u001b[1;32m      2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01maequilibrae_data\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m AequilibraeData, data_export_types\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01msparse_matrix\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Sparse, COO\n\u001b[1;32m      4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcoo_demand\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m GeneralisedCOODemand\n\n\u001b[0;31mImportError\u001b[0m: dlopen(/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/sparse_matrix.cpython-311-darwin.so, 0x0002): tried: '/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/sparse_matrix.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/sparse_matrix.cpython-311-darwin.so' (no such file), '/opt/anaconda3/envs/aequilibrae/lib/python3.11/site-packages/aequilibrae/matrix/sparse_matrix.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))"
}

Desktop (please complete the following information):

  • OS: MacOS
  • Python version 3.11
  • Version 1.1.1

Additional context
My student has a similar issue, but his is with an improper character in the pyarrow package.

@gregmacfarlane
Copy link
Author

I have also tried to install the openmatrix library separately by installing pip install aequilibrae --no-deps and then using pip to install each dependency, and I get the same issue.

@pedrocamargo
Copy link
Contributor

Hey, @gregmacfarlane , None of us has a Mac with Apple silicon to test, so it isn't easy to be sure what's the problem.
I am tagging @Jake-Moss here so he can follow up on this this week.

In the meantime, you could try installing it from source (pip install --no-binary aequilibrae).

@Jake-Moss
Copy link
Contributor

Jake-Moss commented Oct 24, 2024

Installing with the no binary option should be the solution here. It will compile for your system, should only be a minute or two of build time.

Upon loading aequilibrae, we get this error, suggesting that the sparse matrix library is only available for intel architecture. Is this real?

We don't have packages built for Aarch64 Macs. I recall we've had build issues with it in the past. The sparse matrix module is likely just the first to be loaded

@pedrocamargo
Copy link
Contributor

@gregmacfarlane , did building it from source work?

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

3 participants