简体   繁体   中英

pyenv BUILD FAILED (Fedora 28 using python-build 20180424)

I was trying to install python 3.7.0 and here is a part of the message from the log file after build failed:

......

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_dbm                  _gdbm                 _tkinter           
_uuid                 nis                                      
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc                  atexit                pwd                
time                                                           

running build_scripts
creating build/scripts-3.7
copying and adjusting /tmp/python-build.20180829114540.17502/Python-3.7.0/Tools/scripts/pydoc3 -> build/scripts-3.7
copying and adjusting /tmp/python-build.20180829114540.17502/Python-3.7.0/Tools/scripts/idle3 -> build/scripts-3.7
copying and adjusting /tmp/python-build.20180829114540.17502/Python-3.7.0/Tools/scripts/2to3 -> build/scripts-3.7
copying and adjusting /tmp/python-build.20180829114540.17502/Python-3.7.0/Tools/scripts/pyvenv -> build/scripts-3.7
changing mode of build/scripts-3.7/pydoc3 from 664 to 775
changing mode of build/scripts-3.7/idle3 from 664 to 775
changing mode of build/scripts-3.7/2to3 from 664 to 775
changing mode of build/scripts-3.7/pyvenv from 664 to 775
renaming build/scripts-3.7/pydoc3 to build/scripts-3.7/pydoc3.7
renaming build/scripts-3.7/idle3 to build/scripts-3.7/idle3.7
renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7
renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7
Creating directory /home/gio/.pyenv/versions/3.7.0/bin
if test "no-framework" = "no-framework" ; then \
    /usr/bin/install -c python /home/gio/.pyenv/versions/3.7.0/bin/python3.7m; \
else \
    /usr/bin/install -c -s Mac/pythonw /home/gio/.pyenv/versions/3.7.0/bin/python3.7m; \
fi
if test "3.7" != "3.7m"; then \
    if test -f /home/gio/.pyenv/versions/3.7.0/bin/python3.7 -o -h /home/gio/.pyenv/versions/3.7.0/bin/python3.7; \
    then rm -f /home/gio/.pyenv/versions/3.7.0/bin/python3.7; \
    fi; \
    (cd /home/gio/.pyenv/versions/3.7.0/bin; ln python3.7m python3.7); \
fi
if test -f libpython3.7m.a && test "no-framework" = "no-framework" ; then \
    if test -n "" ; then \
        /usr/bin/install -c -m 555  /home/gio/.pyenv/versions/3.7.0/bin; \
    else \
        /usr/bin/install -c -m 555 libpython3.7m.a /home/gio/.pyenv/versions/3.7.0/lib/libpython3.7m.a; \
        if test libpython3.7m.a != libpython3.7m.a; then \
            (cd /home/gio/.pyenv/versions/3.7.0/lib; ln -sf libpython3.7m.a libpython3.7m.a) \
        fi \
    fi; \
    if test -n ""; then \
        /usr/bin/install -c -m 555  /home/gio/.pyenv/versions/3.7.0/lib/; \
    fi; \
else    true; \
fi
zsh:9: parse error near `fi'
make: *** [Makefile:1173: altbininstall] Error 1

There's no further information after the BUILD FAILED line:

I installed pyenv through

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

and have installed all the given requirements.

sudo yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel \
openssl-devel xz xz-devel libffi-devel

Also

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshenv
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshenv
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.zshenv

But still get the error message above every time. How do I make it work?

The problem is solved.

Somehow my /bin/sh had been symlinked to /usr/bin/zsh . Pyenv installation fixed after linking /bin/sh back to /usr/bin/bash .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM