In installing SquidASM one of the most common problems relate to installing Netsquid. Netsquid must be compiled per python version, operating system and chip architecture. For Linux users with an intel x86-64 architecture this is rarely noticeable, but macOSX users may struggle to find a version of Netsquid that they can install. This is due to the extra dependencies on major MacOSX version combined with Apple changing the chip architecture from intel x86-64 to M1 and then M2 chips.
If you have any trouble with installation feel free to ask your questions here or contribute to the knowledge base by posting your solutions!
We have collected some tips that may help those struggling to install Netsquid on macOSX:
One can look on the pypi server for Netsquid to find what wheel files are available, and switch to an appropriate python version.
Installing Netsquid on MacOS 12.x with Intel chips and python 3.8.
When installing on this machine I found that pip would only allow me to install Netsquid versions 1.0.7 and 0.8.7. This is an issue as to avoid a bug in SquidASM, we want to have at least squidASM>=1.1.2
We should be able to install Netsquid 1.1.6 as netsquid-1.1.6-cp38-cp38-macosx_11_0_x86_64.whl exists. On closer inspection of the succeeding installation, the wheel file downloaded would be of type: netsquid-1.0.7-cp38-cp38-macosx_10_15_x86_64.whl despite netsquid-1.0.7-cp38-cp38-macosx_11_0_x86_64.whl file existing.
Solution
We manually edit the python wheel file to allow us to install it.
Go to: https://pypi.netsquid.org/netsquid/ and download the correct wheel file (In this case netsquid-1.1.6-cp38-cp38-macosx_11_0_x86_64.whl )
Unzip the wheel file
Open the file named WHEEL inside netsquid-1.1.6.dist-info folder
Modify the field Tag from:
Tag: cp38-cp38-macosx_11_0_x86_64
to
Tag: cp38-cp38-macosx_10_15_x86_64
Run wheel pack . in the unziped wheel folder. It will produce a new wheel file in the same folder (You might need to install the wheel package first with pip install wheel)
install the package from the newly created wheel file (pip install netsquid-1.1.6-cp38-cp38-macosx_10_15_x86_64.whl )
Hello,
I’m having problems installing squidasm on an M1 mac (OS 13.4.1). When I do make install I get:
ERROR: Could not find a version that satisfies the requirement pydynaa<1.0,>=0.3 (from squidasm) (from versions: 0.0.1, 1.0.1, 1.0.2)
ERROR: No matching distribution found for pydynaa<1.0,>=0.3
make: *** [install] Error 1
I tried fetching an arm wheel file for pydinaa, however when I install it i run into other errors:
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cysignals
Running setup.py clean for cysignals
Failed to build cysignals
ERROR: Could not build wheels for cysignals, which is required to install pyproject.toml-based projects
Sorry to hear that you are experiencing issues.
As for the first error: “ERROR: Could not find a version that satisfies the requirement pydynaa<1.0,>=0.3”, we were in the process of relaxing the pydynaa requirements.
The pull request to resolve this has just been merged into the develop branch. Updating your squidasm package to the newest version using the command git pull inside the squidasm folder will fix this issue.
Sadly I do not think this will resolve the cysignals issue. I am aware of another user that experienced this issue before. I will contact this user and see if he can help.
HI Jsdj,
here’s what i get when i force the cysignal version in my virtual environment as you recommended:
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> cysignals
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
The good news is that I did solve the pydynaa issue by pulling the latest branch!
Hey Atom,
Sorry to hear that it is still not working out.
Moving forward there are two things that come into my mind to try:
Try out different versions of the cysignals and possibly pip. So try if cysignals 1.10.2, 1.9.x, etc. work. In installing Netsquid, we have found that it can depend on the pip version if you are allowed to install Netsquid. In that case it was using pip 21 that we could install and not with pip 23. (Not 21.0.0, but one of the newer 21.x.x version)
Build the package from source
In this case you will compile the source C\C++ code on your local machine.
To do this:
Clone the cysignals repository using: git clone git@github.com:sagemath/cysignals.git
Create a venv using python3 -m venv venv in the cysignals repo
Install the requirements using pip install -r requirements.txt
Build the package using make build
(It is not unlikely that in this step you might encounter some missing requirements for the compilation process. On Linux I was missing a python.h file that required sudo apt-get install python-dev. On MacOSX this went smoothly, but I suspect i installed some xcode tools at some point.)
Install it as a python package using pip install .
Either install it using the same venv as you use for squidASM now or make a wheel file out of it using python setup.py bdist_wheel that will create a wheel file in the dist directory that you can then use to install cysignals.
Hello @mvanhooft and @jsdj ,
thanks for your support. I’ve managed to complete the installation. One question though: when i run “make verify”, 2 tests fail. Is this the expected behaviour?
Below a log:
" drop_qubit = not keep_combined
if not isinstance(qubit, Qubit):
raise TypeError("The qubit given must be a qubit object")
E TypeError: The qubit given must be a qubit object
SEnv/lib/python3.8/site-packages/netsquid/qubits/qubitapi.py:471: TypeError
=========================== short test summary info ============================
FAILED tests/stack/test_two_nodes.py::TestTwoNodes::test_entangle_md - TypeError: The qubit given must be a qubit object
FAILED tests/stack/test_two_nodes.py::TestTwoNodes::test_entangle_md_with_wait - TypeError: The qubit given must be a qubit object
========================= 2 failed, 49 passed in 6.56s =========================
make: *** [tests] Error 1"
Looking forward to explore the squidasm potential in the next days!
This is a known bug on MacOS systems. We have solved this issue on the branch blueprint-integration-beta-0.0.2. Its impact is not critical, as long as you don’t use the create_measure() method of EPR sockets, but it would still be prudent to switch to blueprint-integration-beta-0.0.2 branch.
You can switch branches via: git checkout blueprint-integration-beta-0.0.2
After switching you do need to reinstall the package using: make install
EDIT:
The branch mentioned here does not exist anymore use git checkout b0.0.5 or, if they exist, the newest of the bx.x.x versions instead.