How to properly use anaconda packages in Manjaro?

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 and boost-libs are required:
pamac install boost boost-libs

python -m venv ./venv
source venv/bin/activate
git clone https://github.com/weinbe58/QuSpin.git
cd QuSpin
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.

1 Like

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.

  1. Can I access the system python packages (e.g. python-gtts) within the virtual environment without installing them again with pip?
  2. What does CFLAGS do?
  3. 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 :wink: ), 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 pip.

In the virtual environment, everything is local, so no root or sudo needed. It would even be harmful to use them.

The 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).

  1. Yes. Activate with the command, then your code.

easy to found doc for python virtual environment :wink: 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 boost and/or boost-libs packages.

(pamac install boost boost-libs)

Edit: I could install the package with this and verified that at least the import of quspin works.

@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.