Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find the Python interpreter #1782

Closed
2 tasks done
piper-of-dawn opened this issue Sep 29, 2023 · 3 comments · Fixed by #1783
Closed
2 tasks done

Cannot find the Python interpreter #1782

piper-of-dawn opened this issue Sep 29, 2023 · 3 comments · Fixed by #1783
Labels
bug Something isn't working

Comments

@piper-of-dawn
Copy link

Bug Description

===================================================================
maturin has panicked. This is a bug in maturin. Please report this
at https://github.com/PyO3/maturin/issues/new/choose.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 environment
variable set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.2.3
Args: maturin list-python

thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', src\python_interpreter\mod.rs:157:26
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Your maturin version (maturin --version)

1.2.3

Your Python version (python -V)

Python 3.9.18

Your pip version (pip -V)

pip 23.2.1

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. maturin list-python
@piper-of-dawn piper-of-dawn added the bug Something isn't working label Sep 29, 2023
@messense
Copy link
Member

How did you install that python 3.9.18?

@piper-of-dawn
Copy link
Author

I installed python 3.9.18 with:
conda create --name py39 python=3.9

However, I encountered the same issue when I changed to other versions of Python. I think it occurred because, I created a virtual environment in my project directory, and installed Maturin there.

I rm rf ed the virtual environment and now maturin list-python magically works as expected.

Thanks anyway :)

@anhnt1mirai
Copy link

❯ maturin develop    
🔗  Found pyo3 bindings
💥  maturin failed
  Caused by: Python interpreter should be a kind of interpreter (e.g. 'python3.8' or 'pypy3.9') when cross-compiling, got path to interpreter: /home/colazo/.cache/pypoetry/virtualenvs/teammate-mTmVZXWC-py3.12/bin/python

How to fix it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants