ProjectQ-Framework / ProjectQ

ProjectQ: An open source software framework for quantum computing
https://projectq.ch
Apache License 2.0
888 stars 274 forks source link

Python 3.9.12 on OSX #445

Open BoltzmannEntropy opened 2 years ago

BoltzmannEntropy commented 2 years ago

Python 3.9.12 (main, Apr 5 2022, 01:53:17) [Clang 12.0.0 ] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information.

from projectq import MainEngine zsh: illegal hardware instruction python

Takishima commented 2 years ago

Hmm... this is weird as Python 3.9 should be officially supported on Apple Silicon. I will try to adapt PR #444 to give you a possible workaround.

Takishima commented 2 years ago

Could you try the following using the branch on my fork that is used for PR #444 ?

PROJECTQ_NOINTRIN=1 python3 -m pip install projectq -v
BoltzmannEntropy commented 2 years ago

Thank you so much for the effort. There seems to be issues with the M1 chip, what I did was to uninstall conda and install: pyenv global 3.8.10

All the best,

Takishima commented 2 years ago

So that's your first issue: Python 3.8.X is not officially supported on Apple Silicon. Please try to install a more recent Python version and try again.

Takishima commented 2 years ago

Also try downloading the code from https://github.com/Takishima/ProjectQ/tree/feature/apple-mx-processors (you can either use Git or download the ZIP file; in the latter case, unzip it somewhere on your system and then simply do python3 -m pip install path/to/unpacked/

Takishima commented 2 years ago

Did you try the latest version? Did it help?

If not, this is probably related to the fact that Python 3.8 is not officially supported on Apple Silicon and there is little we can do for the compiled C++ code (since you're compiling the code on your machine locally anyway).

Perhaps if you could post the full log of executing python3 -m pip install projectq -v I could look a bit more into this issue.