I need to use QuSpin in python. The official guide instructs to install it with Anaconda. This does not seem to be available as a package in PyPI.
This suggests not to use such manually installed python packages. Is there any way to install QuSpin “the Arch Way” (or Manjaro way)?
Is it possible to make a
python-quspin AUR from the anaconda package (I would be happy to maintain it, if someone helps me to write a PKGBUILD), as it is easily possible with packages in the PyPI ?
Also, I installed anaconda from the AUR. Is it safe to run it with sudo? Otherwise, is there any way to install anaconda packages without touching system python packages (e.g. something like
pip install --user packagename )
Why do they explicitly need Anaconda? I recommend using the system’s python package, create a virtual environment, don’t forget to activate it, and then install the requirements with pip.
However, apparently (and for god why?) they don’t publish the package in PyPI, so you have to install from source and also the dependencies. Fortunately, they have instructions:
There might be more system dependenices, at least
boost-libs are required:
pamac install boost boost-libs
python -m venv ./venv
git clone https://github.com/weinbe58/QuSpin.git
pip install scipy numpy cython joblib six dill gmpy2 numba numexpr
CFLAGS="" python setup.py install --default-compiler-flags --record install_file.txt
You can adjust the path to your virtual environment
./venv and also the
CFLAGS in the last line.
Probably because this is meant to be used in clusters where the users may not have root access, and Anaconda does everything for you. But I intend to use it in my personal computer to learn how to use it.
I have never used virtual environment so far, and have some questions.
- Can I access the system python packages (e.g. python-gtts) within the virtual environment without installing them again with pip?
- What does CFLAGS do?
- I don’t want to save my code inside the virtual environment directory. How do I call the python in virtual environment to run my code? Do I first activate the virtual environment and then run
python code.py ?
I don’t know anything about this package. It is most likely a research project, so in experience (and my own research projects ), the code structure, documentation, and installations are terrible.
You can’t access the system packages, that’s the purpose of the virtual environment, you have to install everything (again) but this time, directly with
In the virtual environment, everything is local, so no root or sudo needed. It would even be harmful to use them.
CFLAGS are for the compiler, I tried installing and it is still compiling but it complained that this variable was empty (again, bad code in research projects).
- Yes. Activate with the command, then your code.
easy to found doc for python virtual environment for exemple:
I tried to compile it with the --omp flag, and after ~30 minutes it showed compilation terminated with the error
/home/archisman/QuSpin/quspin/basis/basis_general/_basis_general_core/source/bits_info.h:5:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
5 | #include "boost/multiprecision/cpp_int.hpp"
It seems that as a workaround, I would have to install conda in the home directory (rather than from the AUR, which installs in opt, and is somewhat inconvenient). It is supposed to be self contained, and won’t affect system packages.
There is the following GitHub issue to publish it to pip, but it has not attracted much attention.
You probably need the
pamac install boost boost-libs)
Edit: I could install the package with this and verified that at least the import of
@mithrial Compilation did not terminate after installing boost (I already had boost-libs installed).
However, it is consuming all my 8 GB RAM.
Can you edit and combine the two posts into one? Then I would mark it as a solution.
Also, is there any simple way to turn the compiled python package into a .tar.zst, to be installed as a system package?
I can’t help with that, for me it compiled and I can import the library. However, I didn’t test any actual computations because I don’t even know for what the library is used for.
Yes, look at a few examples of PKGBUILD files in the AUR that provide third-party python packages (e.g. python-matplotlib-git), then you’ll build it and you’ll end up with an “installable” file for pacman.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.