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

ImportError related to Tweedledum for Macosx-arm64 #6742

Closed
JoelHBierman opened this issue Jul 14, 2021 · 1 comment
Closed

ImportError related to Tweedledum for Macosx-arm64 #6742

JoelHBierman opened this issue Jul 14, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@JoelHBierman
Copy link

Information

  • Qiskit Terra version: 0.18.0
  • Python version: 3.9.5
  • Operating system: MacOS 11.4

What is the current behavior?

Installing Terra 0.18.0 via published wheel file qiskit_terra-0.18.0-cp39-cp39-macosx_10_9_universal2.whl or building from source results in the following ImportError:

Traceback (most recent call last):
  File "/Users/joelbierman/Desktop/Qiskit ARM64/H2_Statevector_Convergence.py", line 3, in <module>
    from qiskit import Aer
  File "/Users/joelbierman/opt/anaconda3/envs/Qiskit_0280_ARM64/lib/python3.9/site-packages/qiskit/__init__.py", line 26, in <module>
    from qiskit.circuit import ClassicalRegister
  File "/Users/joelbierman/opt/anaconda3/envs/Qiskit_0280_ARM64/lib/python3.9/site-packages/qiskit/circuit/__init__.py", line 231, in <module>
    from .classicalfunction.types import Int1, Int2
  File "/Users/joelbierman/opt/anaconda3/envs/Qiskit_0280_ARM64/lib/python3.9/site-packages/qiskit/circuit/classicalfunction/__init__.py", line 98, in <module>
    from .classicalfunction import ClassicalFunction
  File "/Users/joelbierman/opt/anaconda3/envs/Qiskit_0280_ARM64/lib/python3.9/site-packages/qiskit/circuit/classicalfunction/classicalfunction.py", line 18, in <module>
    from tweedledum.classical import simulate
  File "/Users/joelbierman/opt/anaconda3/envs/Qiskit_0280_ARM64/lib/python3.9/site-packages/tweedledum/__init__.py", line 5, in <module>
    from ._tweedledum import *
ImportError: dlopen(/Users/joelbierman/opt/anaconda3/envs/Qiskit_0280_ARM64/lib/python3.9/site-packages/tweedledum/_tweedledum.cpython-39-darwin.so, 2): no suitable image found.  Did find:
        /Users/joelbierman/opt/anaconda3/envs/Qiskit_0280_ARM64/lib/python3.9/site-packages/tweedledum/_tweedledum.cpython-39-darwin.so: mach-o, but wrong architecture
        /Users/joelbierman/opt/anaconda3/envs/Qiskit_0280_ARM64/lib/python3.9/site-packages/tweedledum/_tweedledum.cpython-39-darwin.so: mach-o, but wrong architecture

Steps to reproduce the problem

Install Terra either via pip or build from source native to macosx-arm64 and run code with packages in Terra.

What is the expected behavior?

No ImportError.

Suggested solutions

Building Tweedledum from source in a conda environment as described in Qiskit/qiskit-aer#1286 with the openmp fix seems to resolve this issue. Given that this issue is similar to the ImportError issue with Aer, it seems that it's likely a version issue with either Tweedledum or openmp.

@JoelHBierman JoelHBierman added the bug Something isn't working label Jul 14, 2021
@willemrc
Copy link

Had the same error with my qiskit upgrade from 0.27.0 to 0.28.0 probably by updating terra (to 0.18.0?). The upgrade installed tweedledum 1.1.0 which failed as described. pip install tweedledum also resulted in a non importable tweedledum package on my M1, using Miniforge.
pip install tweedledum==1.0.0 (not meeting terra 0.18.0 requirements) installed an importable tweedledum (didn't test qiskit). Building from source indeed worked to get a tweedledum 1.1.0, e.g. by pip install tweedledum --no-binary :all:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants