Closed GabLeRoux closed 6 years ago
I tried again manually and it looks like the problem is not with pyenv but with building python itself. I tried with a few versions, 2.7
, 3.6.3
, 3.4.2
, etc. Always the same output.
I also tried to build python manually:
wget https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
tar xf Python-3.4.2.tar.xz
cd Python-3.4
./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... linux
checking for --without-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/laprise/python-fix/Python-3.4.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
Don’t ask us about compiler issue of yours. It’s clear your C compiler has issue.
@yyuu I understand, all I did was to follow the steps described in pyenv documentation on a fresh fedora install, and it didn't work out of the box so I thought it'd be worth mentioning here.
I'll keep digging and post answer here anyway for further reference. It would be nice if you could also point me where this question should go.
After further investigation, the problem is indeed with the C compiler as one would expect from original error message.
So I tried to compile a simple c file:
helloworld.c
#include<stdio.h>
main() {
printf("Hello World");
}
gcc helloworld.c
In file included from /usr/include/features.h:447:0,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from helloword.c:1:
/usr/include/gnu/stubs.h:10:11: fatal error: gnu/stubs-64.h: No such file or directory
# include <gnu/stubs-64.h>
^~~~~~~~~~~~~~~~
compilation terminated.
Let's confirm the file is not there
ls /usr/include/gnu/
libc-version.h lib-names-32.h lib-names.h stubs-32.h stubs.h
One way to figure out what package provides a specific file is to run dnf provides
:
sudo dnf provides /usr/include/gnu/stubs-64.h
Last metadata expiration check: 0:36:06 ago on Mon 15 Jan 2018 06:55:28 PM EST.
glibc-devel-2.26-21.fc27.x86_64 : Object files for development using standard C
: libraries.
Repo : updates
Matched from:
Filename : /usr/include/gnu/stubs-64.h
glibc-devel-2.26-15.fc27.x86_64 : Object files for development using standard C
: libraries.
Repo : fedora
Matched from:
Filename : /usr/include/gnu/stubs-64.h
I do have that package installed, maybe reinstalling it could fix somehting:
sudo dnf reinstall -y glibc-devel
but /usr/include/gnu/stubs-64.h
is still not present.
sudo dnf list | grep glibc-devel
glibc-devel.i686 2.26-21.fc27 @updates
glibc-devel.x86_64 2.26-21.fc27 updates
According to provides
command, my current version should provide that file, but I ran ls /usr/include/gnu/stubs-64.h
and it's still missing.
The system is a 64bit system:
uname -a
Linux hpbenlocalhost 4.14.11-300.fc27.x86_64 #1 SMP Wed Jan 3 13:52:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Continuing investigation.
I managed to get passed the above C compiler error about missing stubs-64.h
with the following command:
sudo dnf reinstall -y glibc-devel.x86_64
Hard to tell why sudo dnf list | grep glibc-devel
showed both i686
and x86_64
. The reinstall command for glibc-devel
didn't do anything but specifying glibc-devel.x86_64
directly did the trick 👍
Now that /usr/include/gnu/stubs-64.h
can be found, I'm getting a different error:
CFLAGS=-I/usr/include/openssl \
LDFLAGS=-L/usr/lib64 \
pyenv install -v 3.4.2
Downloading Python-3.4.2.tar.xz...
-> https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
Installing Python-3.4.2...
patching file ./Lib/ssl.py
patching file ./Modules/_ssl.c
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (Fedora 27 using python-build 20160602)
Inspect or clean up the working tree at /tmp/python-build.20180115195610.6612
Results logged to /tmp/python-build.20180115195610.6612.log
Last 10 log lines:
(cd /home/laprise/.pyenv/versions/3.4.2/share/man/man1; ln -s python3.4.1 python3.1)
if test "xupgrade" != "xno" ; then \
case upgrade in \
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Ignoring ensurepip failure: pip 1.5.6 requires SSL/TLS
Which is documented in the Common build problems 'ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?'
sudo dnf list | grep openssl
openssl.x86_64 1:1.1.0g-1.fc27 @updates
[...]
openssl-devel.x86_64 1:1.1.0g-1.fc27 @updates
openssl-devel.i686 1:1.1.0g-1.fc27 updates
So I tried to reinstall all the required packages (the ones mentioned in the wiki)
dnf reinstall -y zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel
That didn't help this time. I also tried to reinstall openssl-devel.x86_64
, but I'm still getting the same error.
Alright, so I managed to get passed the openssl
issue now, looks like it's related to https://github.com/pyenv/pyenv/issues/916
I successfully installed python 3.6.3
even tho python 3.4.2
is still failing.
openssl version
OpenSSL 1.1.0g-fips 2 Nov 2017
maybe you xcode settings is wrong
try this:
Start Xcode, select 'Preferences', then 'Locations'.
You'll notice a dropdown control at 'Command Line Tools'.
Select the newest version, close the dialog window,
then call brew again. Restart your computer and run it again.
install command
output
Log file
I installed using pyenv/pyenv-installer and added the env flags to my
~/.zshrc
as mentioned after installation and restarted the shell.I also installed all the required packages as mentioned in wiki's home suggested-build-environment:
And the packages mentioned in Common-build-problems#requirements
Note that it differs one from an other, I think this is also an issue, packages should be the same for both sections.
I also installed the following packages:
clang
andbuild-essentials
equivalent:dnf install @development-tools
. I am not sure what is missing.