Pyenv won't install python environment

When I run “pyenv install 3.10”, this is the output:

Downloading Python-3.10.12.tar.xz...
-> https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tar.xz
Installing Python-3.10.12...

BUILD FAILED (EndeavourOS rolling using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20230619113720.1481382
Results logged to /tmp/python-build.20230619113720.1481382.log

Last 10 log lines:
checking for python3.10... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/python-build.20230619113720.1481382/Python-3.10.12':
configure: error: C compiler cannot create executables
See `config.log' for more details

HOWEVER, if I were to run “sudo pyenv install 3.10”, the installation itself works fine, but pyenv can’t set the global python version (no error messages available).

1 Like

Try running pyenv install -v 3.10.12 so you can see more of the log file. I use pyenv all the time and have never had this issue.

Question: how did you install pyenv?

1 Like

I installed pyenv by doing sudo pacman -S pyenv
Also, the output of your command was:

/tmp/python-build.20230619133850.1490587 ~
Downloading Python-3.10.12.tar.xz...
-> https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tar.xz
/tmp/python-build.20230619133850.1490587/Python-3.10.12 /tmp/python-build.20230619133850.1490587 ~
Installing Python-3.10.12...
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.10... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/python-build.20230619133850.1490587/Python-3.10.12':
configure: error: C compiler cannot create executables
See `config.log' for more details

BUILD FAILED (EndeavourOS rolling using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20230619133850.1490587
Results logged to /tmp/python-build.20230619133850.1490587.log

Last 10 log lines:
checking for python3.10... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "linux"
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/python-build.20230619133850.1490587/Python-3.10.12':
configure: error: C compiler cannot create executables
See `config.log' for more details
1 Like

I installed mine with git, as outlined here: https://github.com/pyenv/pyenv#basic-github-checkout. I found it was easier to manage and faster to update its python versions; it does require manual intervention to update, though.

If this is working with sudo, but not your user account, then I’m not sure what’s wrong. Compilers are not limited to elevated accounts, at least not by default. One thing I find interesting is the version of python-build that your install fails on. When I ran this on my machine, after cancelling mid-install, I got this error message:

BUILD FAILED (EndeavourOS rolling using python-build 2.3.20-1-gd0b78fd5)

Yours is showing this:

BUILD FAILED (EndeavourOS rolling using python-build 20180424)

UPDATE: my python-build matches yours, at least within the pyenv environment. I have no idea why a cancelled build showed what it did.

1 Like

Thanks for your response. So, installing pyenv through the method described in the link you provided ended up solving the problem.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.