fusion-engineering / inline-python

Inline Python code directly in your Rust code
https://docs.rs/inline-python
BSD 2-Clause "Simplified" License
1.15k stars 37 forks source link

inline-python-macros not found on python 3.11 #63

Open gauteh opened 1 year ago

gauteh commented 1 year ago

The error below appears when I use python=3.11, but not when using 3.10. Python installed via mamba + conda-forge.

❯ cat environment.yml
name: acoustics
channels:
  - conda-forge
dependencies:
  - python=3.10
  - matplotlib
  - numpy

Regards, Gaute


Hi,

I am currently getting an error:

error[E0463]: can't find crate for `inline_python_macros`
   --> /home/gauteh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/inline-python-0.12.0/src/lib.rs:138:9
    |
138 | pub use inline_python_macros::python;
    |         ^^^^^^^^^^^^^^^^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error: could not compile `inline-python` (lib) due to previous error

with the latest three nightly versions (back to and including 2023-07-22). With 2023-06-28 I am getting a bunch of:

   Compiling inline-python-macros v0.12.0
error[E0599]: no method named `line` found for struct `proc_macro::Span` in the current scope
  --> /home/gauteh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/inline-python-macros-0.12.0/src/embed_python.rs:57:35
   |
57 |             self.add_whitespace(span, span.line(), span.column())?;
   |                                            ^^^^ method not found in `Span`

Originally posted by @gauteh in https://github.com/fusion-engineering/inline-python/issues/62#issuecomment-1658195742