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

Installation instruction for M1 not working. #3264

Closed
1 task done
sunbc0120 opened this issue Sep 22, 2022 · 2 comments
Closed
1 task done

Installation instruction for M1 not working. #3264

sunbc0120 opened this issue Sep 22, 2022 · 2 comments

Comments

@sunbc0120
Copy link

Describe the bug
Installation instruction for M1 not working. mmh3 dependency has incompatible architecture.

Error message

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/var/folders/wg/c6yzw8y93gq6bvs2l_kd98jm0000gr/T/ipykernel_72582/1213873530.py in <cell line: 2>()
      1 import os
----> 2 from haystack.document_stores import ElasticsearchDocumentStore
      3 
      4 # Get the host where Elasticsearch is running, default to localhost
      5 host = os.environ.get("ELASTICSEARCH_HOST", "localhost")

~/Documents/QA/haystack/haystack/__init__.py in <module>
     18 import pandas as pd
     19 
---> 20 from haystack.schema import Document, Answer, Label, MultiLabel, Span, EvaluationResult
     21 from haystack.nodes.base import BaseComponent
     22 from haystack.pipelines.base import Pipeline

~/Documents/QA/haystack/haystack/schema.py in <module>
     18 from dataclasses import asdict, InitVar
     19 
---> 20 import mmh3
     21 import numpy as np
     22 import pandas as pd

ImportError: dlopen(/Users/xxx/opt/miniconda3/envs/m1/lib/python3.8/site-packages/mmh3.cpython-38-darwin.so, 0x0002): tried: '/Users/xxx/opt/miniconda3/envs/m1/lib/python3.8/site-packages/mmh3.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))

Expected behavior
Example code shall run without error after following installation instruction in doc.

Additional context
Add any other context about the problem here, like document types / preprocessing steps / settings of reader etc.

To Reproduce

from haystack.document_stores import ElasticsearchDocumentStore

# Get the host where Elasticsearch is running, default to localhost
host = os.environ.get("ELASTICSEARCH_HOST", "localhost")

FAQ Check

System:

  • OS: macOS 12.6
  • GPU/CPU: Apple M1 Pro
  • Haystack version (commit or version number): 1.10.0rc0
  • DocumentStore: ElasticSearch
  • Reader:
  • Retriever:
@masci
Copy link
Contributor

masci commented Sep 22, 2022

Hi @sunbc0120 thanks for reporting.

Installation instructions work for me (M1 Pro, macOS 12.5.1). I have a more recent version of Python but that shouldn't be the issue, did you try from a clean env? Also, can you try installing only mmh3 in a clean env to see if that's the problem?

@sunbc0120
Copy link
Author

Hi @sunbc0120 thanks for reporting.

Installation instructions work for me (M1 Pro, macOS 12.5.1). I have a more recent version of Python but that shouldn't be the issue, did you try from a clean env? Also, can you try installing only mmh3 in a clean env to see if that's the problem?

Hi, thanks for the response! It turns out pip installs x86_64.

I had to pip uninstall mmh3 then conda install mmh3, which picks it up from channel pkgs/main/osx-arm64.

Same thing happens with lxml in the next step.

Though later would run into problem described here: bastibe/python-soundfile#310, I would close this issue for now.

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

2 participants