title: On Apple M1, grpc/Google-Api Import Error:
body: <p><strong>Situation:</strong></p>
  <p>I'm trying to set up my SQLAlchemy database and run it locally. I use the google api for its vision module, so I can analyze text off of pictures.</p>
  <p>Currently I had to switch from an old 2013 macbook to a new 2020 macbook with the m1 chip.  I try to run my local environment but receive the following error.</p>
  <p><strong>ERROR:</strong></p>
  <pre><code>File &quot;/Users/gabriel/Desktop/PROJECT_NAME/src/main.py&quot;, line 3, in &lt;module&gt;
      import actions
    File &quot;/Users/gabriel/Desktop/PROJECT_NAME/src/actions.py&quot;, line 3, in &lt;module&gt;
      import utils
    File &quot;/Users/gabriel/Desktop/PROJECT_NAME/src/utils.py&quot;, line 5, in &lt;module&gt;
      import google.cloud.vision_v1 as vision
    File &quot;/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/google/cloud/vision_v1/__init__.py&quot;, line 20, in &lt;module&gt;
      from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient
    File &quot;/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/google/cloud/vision_v1/services/image_annotator/__init__.py&quot;, line 16, in &lt;module&gt;
      from .client import ImageAnnotatorClient
    File &quot;/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/google/cloud/vision_v1/services/image_annotator/client.py&quot;, line 25, in &lt;module&gt;
      from google.api_core import gapic_v1  # type: ignore
    File &quot;/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/google/api_core/gapic_v1/__init__.py&quot;, line 16, in &lt;module&gt;
      from google.api_core.gapic_v1 import config
    File &quot;/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/google/api_core/gapic_v1/config.py&quot;, line 23, in &lt;module&gt;
      import grpc
    File &quot;/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/grpc/__init__.py&quot;, line 22, in &lt;module&gt;
      from grpc import _compression
    File &quot;/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/grpc/_compression.py&quot;, line 15, in &lt;module&gt;
      from grpc._cython import cygrpc
  ImportError: dlopen(/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): tried: '/Users/gabriel/.local/share/virtualenvs/PROJECT_NAME/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/cygrpc.cpython-310-darwin.so' (no such file)
  </code></pre>
  <p><strong>Hypothesis:</strong></p>
  <p>I believe it does have to do with trying to get the universal binary version in my dependencies, but at this point, I have no idea how link them correctly or if I even have the right package.</p>
  <p><strong>Specs:</strong></p>
  <ul>
  <li><p>OS: Mac OS Monterey 12.0.1 (21A559)</p>
  </li>
  <li><p>Computer: MacBook Pro (13-inch, M1, 2020)</p>
  </li>
  <li><p>IDE: VSCode</p>
  </li>
  </ul>
  <p>Dependencies:</p>
  <ul>
  <li><p>Python: &quot;3.10.0&quot;</p>
  </li>
  <li><p>grpcio: &quot;1.41.1&quot;</p>
  </li>
  <li><p>sqlalchemy: &quot;1.4.26&quot;</p>
  </li>
  </ul>
  <p><strong>Tried Solutions:</strong></p>
  <ul>
  <li><p>Ran without grpcio dependency, worked.</p>
  </li>
  <li><p>Originally ran database on two non-m1 chip macbooks, did not have this error.</p>
  </li>
  <li><p>Uninstalled and reinstalled grpcio without cache.</p>
  </li>
  <li><p>Deleted my local environment and recreated it</p>
  </li>
  </ul>