简体   繁体   中英

Is there a way to install Qutip on apple m1 macbook?

I bought a new apple m1 macbook pro. I installed python and other basic packages like numpy, scikit-learn and matplotlib though miniforge. When I tried installing qutip through conda it shows no such package exists on the osx-arm64 channel.

Is there a way to install the x86-64 version of Qutip through rosetta 2?

In short, yes. QuTip can be installed using rosetta. It is, however, not free of complications. I found myself in the same situation, with a new M1 mac.

In my case, I had to create a new installation of miniforge (THE x86_64 VERSION) and download every package (matplotlib, cython, numpy, scipy, jupyter and qutip). QuTiP could be found because I was using the standard channels instead of the new arm64 channel. In order to be able to import qutip some additional steps have to be taken. If one tries to import qutip a couple of errors appear, to which the solution has been given in https://github.com/qutip/qutip/issues/1396#issuecomment-759733240 .

Basically, you first need to install ipython. The following line worked for me: conda install -c anaconda ipython . Secondly, you have to find the hardware_info.py document in your qutip files. In my case it was in /diego/miniforge3/lib/python3.8/site-packages/qutip/hardware_info.py . Once found, comment the following lines: results.update({'cpu_freq': int(float(os.popen('sysctl -n machdep.cpu.brand_string') .readlines()[0].split('@')[1][:-4])*1000)})

With that done, I have a fully operational installation of jupyter notebook with qutip. Addressing the situation described in the question, I don't know if it is possible to download qutip from the regular x86_64 channels while having installed miniforge with the arm64 installer. Maybe someone who knows more than me can add further information about it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM