Streamlit not installing - incompatible architecture

I am trying to use Streamlit for the first time, but it gives me this error. Not sure how to fix it - I read other people’s post about it but nothing seems to work. If anyone has any idea on how to fix this - please let me know. I have tried using it on my Terminal Rosetta but still no change. This could be due to the my Macbook M1 perhaps? Would really appreciate any help.

Hey @mich,

Thanks for sharing your question! Please edit your post to include the full text of the error message (rather than a screenshot) and a code snippet/link to your GitHub repo so we can reproduce the error and help you find a solution.

1 Like

This is the error message I get when I type streamlit hello - I just want to get streamlit running first. I used this github repo - this is just a data scraping notebook, and shouldn’t cause any issues. GitHub - mjtv128/Forecasting-passenger-demand

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/streamlit", line 5, in <module>
    from streamlit.cli import main
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/streamlit/cli.py", line 27, in <module>
    import streamlit.bootstrap as bootstrap
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/streamlit/bootstrap.py", line 29, in <module>
    from streamlit.server.Server import Server
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/streamlit/server/Server.py", line 41, in <module>
    from streamlit.components.v1.components import ComponentRegistry
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/streamlit/components/v1/__init__.py", line 17, in <module>
    from .components import declare_component as declare_component
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/streamlit/components/v1/components.py", line 29, in <module>
    from streamlit.elements import arrow_table
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/streamlit/elements/arrow_table.py", line 16, in <module>
    import pandas as pd
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module>
    from pandas.compat import is_numpy_dev as _is_numpy_dev
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module>
    from pandas.compat.numpy import (
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module>
    from pandas.util.version import Version
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module>
    from pandas.util._decorators import (  # noqa:F401
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module>
    from pandas._libs.properties import cache_readonly  # noqa:F401
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/_libs/interval.cpython-39-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/_libs/interval.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/interval.cpython-39-darwin.so' (no such file)

I suspect it has to do the chip architecture as I have the m1 macbooko but not sure the workaround to this issue. Any help woudl be great as I would like to try Streamlit for my data science projects

Hi Caroline,

Thanks for replying - I just replied to you on the Streamlit post - please let me know if you can find the solution to this.

Best,
Michelle

The problem almost certainly has nothing to do with streamlit.
An Apple M1 has an ARM architecture, so you have to install the right Python distribution or the right 3rd party libraries. The error message says quite clearly that the wrong architecture (x64 instead of arm64) is installed for pandas.
So the question would rather be, how and where did you install Python or the 3rd party Python libraries on your M1 in the first place?
But I can’t help you much there, because I don’t use Apple products…

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.