Mac m1 "Illegal instruction: 4"

Hello, I’m a Perceval newbie. I’m running Python 3.9 on a Mac m1. I did a pip install perceval-quandela, and it installed fine, but then when I tried import perceval as pcvl, I get “Illegal instruction: 4”.
I also tried git clone and install, which didn’t complain.
The trouble occurs when I do ‘import perceval’.
I don’t see other posts on this since April. I’m wondering 1) if there’s a workaround; or 2) whether I need to try Perceval on a different system.

Hello @sploiber,

Perceval use an optimized library written in C++ (QuandeLibC) which is pre-compiled for each CPU architecture.
And it looks like you’re running a python for an intel chip.

If you’re using python from the official distribution (Python Releases for macOS | Python.org)
please make sure to use the ‘universal’ installer
and if you’re using anaconda, please make sure to use the ‘M1’ installer (Anaconda | Anaconda Distribution)

Hello @mario-valdivia. I got some help, and learned I needed an Anaconda for arm64, which had its own Python for arm64. I am past this first problem now - so I will go on to your examples. Thanks for your reply here.

1 Like

I recently ran into this same problem after trying to install with

pip install perceval-quandela

and again with


git clone https://github.com/quandela/Perceval

python setup.py install # [or 'develop' for developers]

Either method results in the following:

Python 3.9.17 (main, Jul  5 2023, 20:41:20) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import perceval
Illegal instruction (core dumped)

I am working in a conda environment on a virtual machine, running Ubuntu 20.04 (running on a windows machine). The computer architecture is x86. My pip version is pip 23.2.1. My python version is 3.9.

I tried


python setup.py build
python setup.py install

What should I try now? Also is there an uninstall option in the repo for the setup.py? I didn’t see one. Thank you!