Python: make: *** [libinstall] Error 1 while installing python 2.7.11

Created on 9 Jun 2016  路  10Comments  路  Source: docker-library/python

I am not exactly using this container, I just copy pasted everything into mine, but since lately I am not able to build python, which fails with the error:

Compiling /usr/local/lib/python2.7/zipfile.py ...
make: *** [libinstall] Error 1

Here is some piece of the console output:
http://piratepad.net/ep/pad/view/ro.gl0rcJXb3s8/latest
And here is my old dockerfile https://github.com/manycoding/teamcity-agent-robotframework-docker/commit/bc2a2b3566f7e68c3edc8bdc22a75dc26641442b

Does anyone have any ideas perhaps?

Most helpful comment

I had the same problem building 2.7.14, I fix it removing /usr/lib/python2.x and /usr/local/lib/python2.x

All 10 comments

I got same error, any suggestion? Thanks.

Well, I just installed python from ppa:fkrull/deadsnakes-python2.7

This appears to be related:

Compiling /usr/local/lib/python2.7/dist-packages/enum/py35_test_enum.py ...
  File "/usr/local/lib/python2.7/dist-packages/enum/py35_test_enum.py", line 974
    class AutoNumberedEnum(Enum, metaclass=auto_enum):
                                          ^
SyntaxError: invalid syntax

I had the same problem building 2.7.14, I fix it removing /usr/lib/python2.x and /usr/local/lib/python2.x

@lega911 Thanks very much. It worked just a while ago for python2.7.14

@lega911 Hey! Thanks for the response. But ain't we supposed to not delete python2.x files since Ubuntu/Linux system depends upon them. I checked some questions on stackoverflow about uninstalling python2.7 but most of them recommended me to not uninstall it. Is it safe to delete the files in lieu of python 2.7.14?

https://askubuntu.com/questions/315015/how-can-i-remove-python-2-7-after-installing-python-3-3

@pallavbakshi
I removed files inside of the docker just to build deb package, after that I can install this deb normally, without removing (on another system/container). Also you can try to choose another folder for python to prevent conflicts.

yeh...
update python2.7.6 to python2.7.14, find the same problem...

mv /usr/lib/python2.7 /usr/lib/badpython2.7

of curse, i install python to /usr/bin
like this
mkdir build
cd build
../configure --prefix=/usr/
make
make install

mv /usr/lib/python2.7 /usr/lib/badpython2.7

make install

done

3KS

As @KylixC noted above, the trick here is to remove the old python from the way, otherwise the commands during the installation will try to use the old one instead of the new one you've just built.

I had the same problem building 2.7.14, I fix it removing /usr/lib/python2.x and /usr/local/lib/python2.x

I had the same problem building 2.7.16, and I fixed it same solution.

Was this page helpful?
0 / 5 - 0 ratings