Open anedumla opened 3 months ago
Hi @anedumla , thanks for reporting. I got this working on my Windows station: Win11 with Python 3.11 and Rust 1.79.
From the error message it seems that you may have a Rust setup or installation issue, or a corrupt cargo registry.
You may want to try to run cargo add windows-sys
in some dummy Rust project and build it to add the windows_sys
crate. Or try with a newer Rust maybe? I hope these will help.
Eli and/or Almudena - are you able to get any success with Rust 1.70 as well? It should be possible to build with Rust 1.70 on Windows since that's our MSRV, so if it only works with 1.79, we ought to work out why and add any workarounds to the building documentation.
Then I tried with 1.79
and adding the windows-sys
crate manually (didn't work with a dummy project) but it fails finding a lot of dependecies such as hashbrown
, ndarray
, num-complex
, etc.
Hmm, thanks. That error message definitely is indicating a problem with our minimum Rust version on Windows. The other errors about not being able find hashbrown
and so on are much much weirder, and are probably something local on your machine - Eli's suggestion above about cache clearing (and making sure you've got an active internet connection, just in case it dropped temporarily...) are all I'd have off the top of my head to try.
Eli and/or Almudena - are you able to get any success with Rust 1.70 as well?
I confirm I can install Qiskit with Rust 1.70.
Environment
main
commit hash65f709d21612bd38d5f8ae0c8d700892cbec9289
What is happening?
The following error appears when trying to install qiskit on a clean environment in Windows (
pip install qiskit
works fine).I tried both with
rustc 1.70.0
andrustc 1.76.0
, restarting the laptop, creating a new environtment, etc... but nothing works.Error message:
Running `C:\Users\7G5075848\.rustup\toolchains\1.76.0-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name build_script_build --edition=2018 C:\Users\7G5075848\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ahash-0.7.8\./build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off -C metadata=5d010ffdd32ed948 -C extra-filename=-5d010ffdd32ed948 --out-dir C:\Users\7G5075848\Box\python_libs\qiskit\target\release\build\ahash-5d010ffdd32ed948 -L dependency=C:\Users\7G5075848\Box\python_libs\qiskit\target\release\deps --extern version_check=C:\Users\7G5075848\Box\python_libs\qiskit\target\release\deps\libversion_check-f28a83bbd8d04604.rlib --cap-lints allow` error[E0463]: can't find crate for `windows_sys` --> C:\Users\7G5075848\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is-terminal-0.4.12\src\lib.rs:48:5 | 48 | use windows_sys::Win32::Foundation::HANDLE; | ^^^^^^^^^^^ can't find crate error[E0463]: can't find crate for `windows_sys` --> C:\Users\7G5075848\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is-terminal-0.4.12\src\lib.rs:115:9 | 115 | use windows_sys::Win32::System::Console::GetConsoleMode; | ^^^^^^^^^^^ can't find crate error[E0463]: can't find crate for `windows_sys` --> C:\Users\7G5075848\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is-terminal-0.4.12\src\lib.rs:140:9 | 140 | use windows_sys::Win32::{ | ^^^^^^^^^^^ can't find crate For more information about this error, try `rustc --explain E0463`. error: could not compile `is-terminal` (lib) due to 3 previous errors Caused by: process didn't exit successfully: `C:\Users\7G5075848\.rustup\toolchains\1.76.0-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name is_terminal --edition=2018 C:\Users\7G5075848\.cargo\registry\src\index.crates.io-6f17d22bba15001f\is-terminal-0.4.12\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto -C codegen-units=1 -C metadata=88503cfc54377e33 -C extra-filename=-88503cfc54377e33 --out-dir C:\Users\7G5075848\Box\python_libs\qiskit\target\release\deps -L dependency=C:\Users\7G5075848\Box\python_libs\qiskit\target\release\deps --extern windows_sys=C:\Users\7G5075848\Box\python_libs\qiskit\target\release\deps\libwindows_sys-f5d9125ec2f94eb1.rmeta --cap-lints allow -L native=C:\Users\7G5075848\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.6\lib` (exit code: 1) warning: build failed, waiting for other jobs to finish... error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path crates\pyext\Cargo.toml --release -v --features 'pyo3/extension-module cache_pygates pyo3/abi3-py38' --crate-type cdylib --` failed with code 101 error: subprocess-exited-with-error × Building wheel for qiskit (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: 'C:\Users\7G5075848\Box\python_libs\qiskit\venv\Scripts\python.exe' 'C:\Users\7G5075848\Box\python_libs\qiskit\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py' build_wheel 'C:\Users\7G5075~1\AppData\Local\Temp\tmpgosyforh' cwd: C:\Users\7G5075848\Box\python_libs\qiskit Building wheel for qiskit (pyproject.toml) ... error ERROR: Failed building wheel for qiskit Failed to build qiskit ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (qiskit) ### How can we reproduce the issue? Windows OS, clone qiskit github, then `pip install -v .` ### What should happen? Qiskit should get installed. ### Any suggestions? _No response_