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

configure detects wrong python version #78

Open
Valentin-D-Richard opened this issue Nov 11, 2022 · 2 comments
Open

configure detects wrong python version #78

Valentin-D-Richard opened this issue Nov 11, 2022 · 2 comments

Comments

@Valentin-D-Richard
Copy link

System information

Type Version/Name
Distribution Name Ubuntu
Version 22.04.1 LTS

Describe the problem you're observing

I have python version 3.10.6 and binaries /usr/bin/python3 and usr/bin/python3.10 exist, but not /usr/bin/python3.1.

./configure detects python version 3.1 and stops because it cannot find python3.1 in the system path.

I followed the README tutorial and chose to compile with python3 binding. Here's the last lines of the output of command PYTHON=python3 ./configure --enable-python

checking for python3 version... 3.1
checking for python3 platform... linux
checking for python3 script directory... ${prefix}/local/lib/python3.10/dist-packages
checking for python3 extension module directory... ${exec_prefix}/local/lib/python3.10/dist-packages
checking for python3.1... no
configure: error: Cannot find python3.1 in your system path
@proycon
Copy link

proycon commented Nov 14, 2022

I'm also running into this bug now.. It seems the autoconf detection can't deal with minor versions running into the double digits..

@Valentin-D-Richard
Copy link
Author

I managed to solve this problem.

It comes from line 12659 of configure. It runs a small python command which simply takes the 3 first characters of the python version. So I changed line 12659 from

  am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`

to

  am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write('.'.join(sys.version.split('.')[:2]))"`

It takes the major and the minor versions of python (exactly, if the version is u.v.w (...), it takes u.v).

Valentin-D-Richard added a commit to Valentin-D-Richard/Phonetisaurus that referenced this issue Jan 24, 2023
… by fixing in the python command determining the python version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants