Currently setup.cfg lists cupy as a dependency. This would make complete sense for an ordinary Python package, but cupy is really an umbrella package that is built for many different CUDA versions.
If cupy is not installed, conda handles this well and conda install cupy does the right thing.
However, pip install cupy without cupy already installed will always attempt to download the cupy source and built it, which is likely to fail with an obscure error message.
I think a friendlier user experience would be to remove cupy from setup.cfg and instead add something like:
try:
import cupy
del cupy
except ModuleNotFoundError:
raise ImportError(
"The qutip_cupy package depends on cupy, but cupy is not installed. Please"
" read the installation instructions for cupy at https://docs.cupy.dev/en/stable/install.html"
" and install the cupy package that matches your CUDA libraries."
)
to qutip_cupy.__init__ so that the user gets a helpful error message when they attempt to import qutip_cupy rather than an obscure error message when they attempt to install it.
Currently
setup.cfg
listscupy
as a dependency. This would make complete sense for an ordinary Python package, butcupy
is really an umbrella package that is built for many different CUDA versions.If
cupy
is not installed,conda
handles this well andconda install cupy
does the right thing.However,
pip install cupy
withoutcupy
already installed will always attempt to download thecupy
source and built it, which is likely to fail with an obscure error message.I think a friendlier user experience would be to remove
cupy
fromsetup.cfg
and instead add something like:to
qutip_cupy.__init__
so that the user gets a helpful error message when they attempt to importqutip_cupy
rather than an obscure error message when they attempt to install it.