predict-idlab / plotly-resampler

Visualize large time series data with plotly.py
https://predict-idlab.github.io/plotly-resampler/latest
MIT License
990 stars 67 forks source link

[BUG] error proc_macro_span_shrink during pip installation #297

Closed NuxitBrain closed 4 months ago

NuxitBrain commented 4 months ago

Describe the bug :crayon:

A clear and concise description of what the bug is.

problem durinf the install of plotly-resampler

Reproducing the bug :mag:

Please provide steps & minimal viable code to reproduce the behavior. Giving this information makes it tremendously easier to work on your issue!

installing rust nightly 1.79 on windows 10 and set it at default do pip install plotly-resampler

Expected behavior :wrench:

Please give a clear and concise description of what you expected to happen.

get error during the installation :

  Building wheel for tsdownsample (pyproject.toml) ... error
  error: subprocess-exited-with-error
  × Building wheel for tsdownsample (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      Running `maturin pep517 build-wheel -i C:\Users\aneveu\AppData\Local\anaconda3\envs\analysedata\python.exe --compatibility off`
      📦 Including license file "C:\Users\aneveu\AppData\Local\Temp\pip-install-0ytx7n8t\tsdownsample_94853f2252bc42629c9d514fc398b78c\LICENSE"
      âš ï¸\x8f Warning: specify [package.metadata.maturin] name in Cargo.toml is deprecated, use module-name in [tool.maturin] section in pyproject.toml instead
      ðŸ\x8d¹ Building a mixed python/rust project
      🔗 Found pyo3 bindings
      ðŸ\x90\x8d Found CPython 3.12 at C:\Users\aneveu\AppData\Local\anaconda3\envs\analysedata\python.exe
      📡 Using build options bindings from pyproject.toml
         Compiling autocfg v1.1.0
         Compiling cfg-if v1.0.0
         Compiling target-lexicon v0.12.6
         Compiling crossbeam-utils v0.8.15
         Compiling scopeguard v1.1.0
         Compiling libm v0.2.6
         Compiling once_cell v1.17.1
         Compiling windows_x86_64_msvc v0.42.2
         Compiling proc-macro2 v1.0.56
         Compiling quote v1.0.26
         Compiling unicode-ident v1.0.8
         Compiling rayon-core v1.11.0
         Compiling syn v1.0.109
         Compiling num_cpus v1.15.0
         Compiling parking_lot_core v0.9.7
         Compiling libc v0.2.142
         Compiling either v1.8.1
         Compiling rawpointer v0.2.1
         Compiling memoffset v0.8.0
         Compiling num-traits v0.2.15
         Compiling crossbeam-epoch v0.9.14
         Compiling num-integer v0.1.45
         Compiling lock_api v0.4.9
         Compiling matrixmultiply v0.3.3
         Compiling windows-targets v0.42.2
         Compiling windows-sys v0.45.0
      error: could not compile `proc-macro2` (lib) due to 2 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" "--manifest-path" "C:\\Users\\aneveu\\AppData\\Local\\Temp\\pip-install-0ytx7n8t\\tsdownsample_94853f2252bc42629c9d514fc398b78c\\Cargo.toml" "--message-format" "json" "--lib"`
      error[E0635]: unknown feature `proc_macro_span_shrink`
        --> C:\Users\aneveu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.56\src\lib.rs:92:30
         |
      92 |     feature(proc_macro_span, proc_macro_span_shrink)
         |                              ^^^^^^^^^^^^^^^^^^^^^^

      error: aborting due to 1 previous error

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

      Error: command ['maturin', 'pep517', 'build-wheel', '-i', 'C:\\Users\\aneveu\\AppData\\Local\\anaconda3\\envs\\analysedata\\python.exe', '--compatibility', 'off'] 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 tsdownsample
Failed to build tsdownsample
ERROR: Could not build wheels for tsdownsample, which is required to install pyproject.toml-based projects

Screenshots :camera_flash:

If applicable, add screenshots to help explain your problem.

Environment information: (please complete the following information)

Additional context Add any other context about the problem here.

I'm not an expert in rust but seem that the version of proc-macro2 is not the good ...

NuxitBrain commented 4 months ago

OK ... After long try and retry, downgrade python to version 3.11.7 fix evrythink ( i mean, i able to install the package ) So maybe it a problem with the newer version of python ...

jonasvdd commented 4 months ago

Hello @NuxitBrain,

Thank you for your detailed report. It appears that the problem you encountered stems from tsdownsample not having support for python3.12 in version 0.1.2, which is indirectly related to plotly-resampler.

You should find that tsdownsample version 0.1.3 officially supports python3.12. You can refer to the release notes for more information.

I hope this resolution assists you. I'll be marking this issue as closed for now. If you have any further questions or issues, feel free to reopen it or start a new one.

Best regards, Jonas