ModuleNotFoundError: No module named 'qutip.cy'

59 views
Skip to first unread message

Lucas Rhode

unread,
Jan 20, 2025, 1:16:12 AM1/20/25
to QuTiP: Quantum Toolbox in Python

Hi everyone,

I'm encountering issues with QuTiP on my Windows system using Anaconda. When I attempt to run the following command:


python -c "from qutip.cy.spconvert import arr_coo2fast; print('Cython module loaded successfully')"

I get the following error:

ModuleNotFoundError: No module named 'qutip.cy'

What is the recommended versions of all the packages, including Python, Qutip, NumPy, SciPy, MatPlotLib for fresh install.

I tried to build from source using Visual Studio Build Tools as well.

Any help is highly appreciated.

Éric Giguère

unread,
Jan 20, 2025, 9:59:54 AM1/20/25
to QuTiP: Quantum Toolbox in Python
Which version of the code and documentation are you using? Are they matching?

`python -c "from qutip.cy.spconvert import arr_coo2fast; print('Cython module loaded successfully')"`
will not work with recent version of qutip.

To check that it's installed properly, you could run the tests:
`pytest qutip/qutip/tests`
you need pytest installed:
`pip install pytest pytest-rerunfailure`
or
`pip install qutip[test]`

Lucas Rhode

unread,
Jan 20, 2025, 12:50:57 PM1/20/25
to QuTiP: Quantum Toolbox in Python
Thanks so much for your help!

I am trying to install QuREBB: https://github.com/QuTech-Delft/QuREBB

And it depends on qutip.

This is the Pipfile from the QuREBB github:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
qutip = "*"
jupyterlab = "*"
matplotlib = "*"
tqdm = "*"
xarray = "*"
h5netcdf = "*"

[dev-packages]
black = "*"
pylint = "*"
isort = "*"

[requires]
python_version = "3.11"


In the pipfile.lock
It says this with regards to qutip:
"qutip": {
            "hashes": [
                "sha256:11b6b750e6d68d6b35a9f64576d00742fb0f7ea97f5e624bd01fe9fec0eb0c53",
                "sha256:193b96cd41a522f842bd9807c763e305d0e810fd6bedd5f486e8a5284d80ea26",
                "sha256:240c01a931fe22417fbc18864cb91b91c44fdf6e5b922386e3891752e2cf9740",
                "sha256:349dff8b40a0fc97ff2722c76e73f6141f9a5ffd44c0bf16d830b780a41d0dca",
                "sha256:36502a7883b8c87d42381aa7b8fb0b3450b3bed26924dfdad9e7829d33a2ced3",
                "sha256:4595d59c5cd22c88022897d3bdbdab191a9eb032ee2ae8fd88937b82d736435c",
                "sha256:4f08e5ffcffdae89e906fd579aa155e3b794d0eb7345ae4cfadb4b24a46a08d7",
                "sha256:695183bee518aee1c0915e7a0974a4305d128f06afc59b6e18a2127ef353138b",
                "sha256:700b4d1df10ed7cac8acd0b15da4bfb4506073d7bcdb46f9cc896da5b13ed0f5",
                "sha256:7141cf931b6f92397cd6738d082c46e082b26c066deb494a4b6b8f1f841b0aa8",
                "sha256:736a1b0f13bcf51fe9152478409d78a7608d9a7bb924238483df8a0df55c88fd",
                "sha256:79b2667a7ded59d05722c78bfd71054e63a7c0ceb8a4ec7426ece69cd125668c",
                "sha256:7a257fc52facddb25149c2fc03400fd219b893a9238fde46548d9e1430c16b2d",
                "sha256:8c4b7b9ad94b9edad32d290d0823af4e87daf123c5398925afd8f99f8c6a8fcb",
                "sha256:95587c1bd98084c6ca29c4d745048da39ed2431854dd1f12914c21aa47076e9c",
                "sha256:a0cc9883281ec89e38ac635adc4bb602d85ec49071628ee17d3bf2c14b5c11ac",
                "sha256:a0e513344872dfbd5728a5a1688671909fa4ebeb1d42f09bc896518ed880f82c",
                "sha256:acb9f827ea757faa193bf19e42269ed52da06efc38f966923ee6b793b28526f5",
                "sha256:b4ae6b823674328703f96ca1fec75260c773d3eea981f91eecaa71235c965ba3",
                "sha256:b9c16d9f5f7e61d8c0b904b498fa44d30ded6685d7fe28c3c19c57b9c0fc8fc9",
                "sha256:be905e4b3a0afbf53d3144b642391b0de8274123ea7febbee19e1ec1339c2c70",
                "sha256:cd223ff0f31cef3b08de9d898d959c65a4cd3ef05eec3cf91ee25431285d284d",
                "sha256:d0090d2543fcab58f966387b0553987971c75cc8b7fb269c354e68b023d87f18"
            ],
            "index": "pypi",
            "version": "==4.7.5"

Éric Giguère

unread,
Jan 20, 2025, 2:24:54 PM1/20/25
to QuTiP: Quantum Toolbox in Python
Are you sure the version of qutip you installed is 4.7.5?
The latest version on conda forge is 5.1.1 and will probably not work since there are some breaking changes between 4.x and 5.X.
In those, `qutip.cy` was moved elsewhere and it's content modified.
Reply all
Reply to author
Forward
0 new messages