pola-rs / polars

Dataframes powered by a multithreaded, vectorized query engine, written in Rust
https://docs.pola.rs
Other
29.98k stars 1.94k forks source link

Unable to pip install polars on windows #7171

Closed MichaelShoemaker closed 1 year ago

MichaelShoemaker commented 1 year ago

Polars version checks

Issue description

When running pip install polars the below error is generated. My rustc version is 1.67.1

Collecting polars
  Downloading polars-0.16.8.tar.gz (1.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 12.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: typing_extensions>=4.0.1 in c:\users\myuser\appdata\local\programs\python\python38-32\lib\site-packages (from polars) (4.4.0)Building wheels for collected packages: polars
  Building wheel for polars (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for polars (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [197 lines of output]
      Running `maturin pep517 build-wheel -i C:\Users\myuser\AppData\Local\Programs\Python\Python38-32\python.exe --compatibility off --target i686-pc-windows-msvc`
      ðŸ\x8d¹ Building a mixed python/rust project
      🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.7
      warning: C:\Users\myuser\AppData\Local\Temp\pip-install-4ble9g77\polars_72d43d7f326a48b7b7dcc6a19647980b\local_dependencies\polars-ops\Cargo.toml: dependency (memchr) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions
      warning: C:\Users\myuser\AppData\Local\Temp\pip-install-4ble9g77\polars_72d43d7f326a48b7b7dcc6a19647980b\local_dependencies\polars-ops\Cargo.toml: unused manifest key: dependencies.memchr.vlist_count
      warning: C:\Users\myuser\AppData\Local\Temp\pip-install-4ble9g77\polars_72d43d7f326a48b7b7dcc6a19647980b\local_dependencies\polars-sql\Cargo.toml: unused manifest key: target.cfg(not(target_os = "linux")).features
         Compiling autocfg v1.1.0
         Compiling proc-macro2 v1.0.51
         Compiling quote v1.0.23
         Compiling unicode-ident v1.0.6
         Compiling syn v1.0.107
         Compiling cfg-if v1.0.0
         Compiling version_check v0.9.4
         Compiling jobserver v0.1.25
         Compiling libc v0.2.139
         Compiling cc v1.0.79
         Compiling serde_derive v1.0.152
         Compiling libm v0.2.6
         Compiling uncased v0.9.7
         Compiling num-traits v0.2.15
         Compiling pkg-config v0.3.26
         Compiling winapi v0.3.9
         Compiling scopeguard v1.1.0
         Compiling num-integer v0.1.45
         Compiling serde v1.0.152
         Compiling siphasher v0.3.10
         Compiling phf_shared v0.11.1
         Compiling rand_core v0.6.4
         Compiling crossbeam-utils v0.8.14
         Compiling regex-syntax v0.6.28
         Compiling memoffset v0.7.1
         Compiling rand v0.8.5
         Compiling getrandom v0.2.8
         Compiling memchr v2.5.0
         Compiling static_assertions v1.1.0
         Compiling semver v1.0.16
         Compiling futures-core v0.3.26
         Compiling phf_generator v0.11.1
         Compiling regex v1.7.1
         Compiling phf_codegen v0.11.1
         Compiling phf v0.11.1
         Compiling crossbeam-epoch v0.9.13
         Compiling lexical-util v0.8.5
         Compiling indexmap v1.9.2
         Compiling slab v0.4.7
         Compiling windows_i686_msvc v0.42.1
         Compiling once_cell v1.17.1
         Compiling futures-channel v0.3.26
         Compiling parse-zoneinfo v0.3.0
         Compiling futures-task v0.3.26
         Compiling zstd-sys v2.0.7+zstd.1.5.4
         Compiling ahash v0.8.3
         Compiling pin-project-lite v0.2.9
         Compiling either v1.8.1
         Compiling rayon-core v1.10.2
         Compiling futures-util v0.3.26
         Compiling futures-sink v0.3.26
         Compiling crc32fast v1.3.2
         Compiling hashbrown v0.12.3
         Compiling log v0.4.17
         Compiling futures-macro v0.3.26
         Compiling crossbeam-deque v0.8.2
         Compiling crossbeam-channel v0.5.6
         Compiling itoa v1.0.5
         Compiling target-lexicon v0.12.6
         Compiling serde_json v1.0.93
         Compiling num_cpus v1.15.0
         Compiling pin-utils v0.1.0
         Compiling ryu v1.0.12
         Compiling futures-io v0.3.26
         Compiling windows-targets v0.42.1
         Compiling iana-time-zone v0.1.53
         Compiling lexical-write-integer v0.8.5
         Compiling lexical-parse-integer v0.8.6
         Compiling lz4-sys v1.9.4
         Compiling lock_api v0.4.9
         Compiling alloc-no-stdlib v2.0.4
         Compiling zstd-safe v5.0.2+zstd.1.5.2
         Compiling async-trait v0.1.64
         Compiling parking_lot_core v0.9.7
         Compiling snap v1.1.0
         Compiling lexical-parse-float v0.8.5
         Compiling lexical-write-float v0.8.5
         Compiling alloc-stdlib v0.2.2
         Compiling rayon v1.6.1
         Compiling chrono v0.4.23
         Compiling windows-sys v0.45.0
         Compiling chrono-tz-build v0.0.3
         Compiling smallvec v1.10.0
         Compiling futures-executor v0.3.26
         Compiling fallible-streaming-iterator v0.1.9
         Compiling adler v1.0.2
         Compiling rle-decode-fast v1.0.3
         Compiling libflate_lz77 v1.2.0
         Compiling miniz_oxide v0.6.2
         Compiling chrono-tz v0.6.3
         Compiling futures v0.3.26
         Compiling pyo3-build-config v0.18.1
         Compiling lexical-core v0.8.5
         Compiling brotli-decompressor v2.3.4
         Compiling async-stream-impl v0.3.4
         Compiling num-bigint v0.4.3
         Compiling crc-catalog v1.1.1
         Compiling array-init-cursor v0.2.0
         Compiling adler32 v1.2.0
         Compiling rustc_version v0.4.0
         Compiling async-stream v0.3.4
         Compiling parquet-format-safe v0.2.4
         Compiling brotli v3.3.4
         Compiling libflate v1.3.0
         Compiling arrow2 v0.16.0 (https://github.com/ritchie46/arrow2?branch=polars_2023-02-22#bbeb28ac)
         Compiling planus v0.3.1
         Compiling crc v2.1.0
         Compiling parking_lot v0.12.1
         Compiling hashbrown v0.13.2
         Compiling flate2 v1.0.25
      error: could not compile `hashbrown` due to 10 previous errors
      warning: build failed, waiting for other jobs to finish...
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit code: 101": `"cargo" "rustc" "--release" "--target" "i686-pc-windows-msvc" "--manifest-path" "C:\\Users\\myuser\\AppData\\Local\\Temp\\pip-install-4ble9g77\\polars_72d43d7f326a48b7b7dcc6a19647980b\\Cargo.toml" "--message-format" "json" "--lib"`
      ðŸ\x90\x8d Using CPython 3.8 at C:\Users\myuser\AppData\Local\Programs\Python\Python38-32\python.exe to generate to link bindings (With abi3, an interpreter is only required on windows)
      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:15:5
         |
      15 | /     feature(
      16 | |         test,
      17 | |         core_intrinsics,
      18 | |         dropck_eyepatch,
      ...  |
      25 | |         build_hasher_simple_hash_one
      26 | |     )
         | |_____^

      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:16:9
         |
      16 |         test,
         |         ^^^^

      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:17:9
         |
      17 |         core_intrinsics,
         |         ^^^^^^^^^^^^^^^

      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:20:9
         |
      20 |         extend_one,
         |         ^^^^^^^^^^

      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:21:9
         |
      21 |         allocator_api,
         |         ^^^^^^^^^^^^^

      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:22:9
         |
      22 |         slice_ptr_get,
         |         ^^^^^^^^^^^^^

      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:23:9
         |
      23 |         nonnull_slice_from_raw_parts,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:24:9
         |
      24 |         maybe_uninit_array_assume_init,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      error[E0554]: `#![feature]` may not be used on the stable release channel
        --> C:\Users\myuser\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.13.2\src\lib.rs:25:9
         |
      25 |         build_hasher_simple_hash_one
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      error: aborting due to 9 previous errors

      For more information about this error, try `rustc --explain E0554`.

      Error: command ['maturin', 'pep517', 'build-wheel', '-i', 'C:\\Users\\myuser\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe', '--compatibility', 'off', '--target', 'i686-pc-windows-msvc'] returned non-zero exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for polars
Failed to build polars
ERROR: Could not build wheels for polars, which is required to install pyproject.toml-based projects

Reproducible example

pip install polars

Expected behavior

I would expect polars to install without issue. I tried upgrading rustc, pip and installing maturin.

Installed versions

``` N/A ```
ghuls commented 1 year ago

Install rust nightly: nightly-2023-02-14

Precompiled binary wheels are only available for 64-bit Windows. so if you have a 64-bit Windows version, install the 64-bit python version first and then install Polars.

MichaelShoemaker commented 1 year ago

Worked like a charm! Just uninstalled the 32bit Python and installed 64bit. Started learning python about 6 years ago when there were a lot of quirks with the 64 bit version. Guess I had to change sometime. Thank you @ghuls !!!!