Clogged with python update of GCP console ② (Solution)

Last synopsis

Made apt work I put pip I put pyenv I can't install python! ← here

The error that appeared last time (review)

$ pyenv install 3.7.4
Downloading Python-3.7.4.tar.xz...
-> https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
Installing Python-3.7.4...
BUILD FAILED (Ubuntu 16.04 using python-build 1.2.21)
Inspect or clean up the working tree at /tmp/python-build.20201015120257.27370
Results logged to /tmp/python-build.20201015120257.27370.log
Last 10 log lines:
    sys.exit(ensurepip._main())
  File "/tmp/python-build.20201015120257.27370/Python-3.7.4/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
  File "/tmp/python-build.20201015120257.27370/Python-3.7.4/Lib/ensurepip/__init__.py", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/tmp/python-build.20201015120257.27370/Python-3.7.4/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1132: recipe for target 'install' failed
make: *** [install] Error 1

Referenced site

"A story about stumbling on building a pyenv 3.7-based environment on Ubuntu 16.04" https://qiita.com/kenta_ojapi/items/6b19e0c05b268f3e74da

"[Pyenv] Building a python environment with ubuntu 16.04" https://qiita.com/banaoh/items/00aea13fe045fab7e8ba

Actual procedure

$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

It is said that you should look at https://github.com/pyenv/pyenv/wiki/Common-build-problems, so solve it with the following command described here. Believe in the comment and chanting. I don't understand the contents at all, but it will install what you need.

Python installation failed again. It is said that there is no zlib, so install it

sudo apt-get install zlib1g-dev

Installation failed. It takes a lot of time, but it hurts to fail after all.

WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?

So I installed bzip2 lib individually.

Then it worked.


Installed Python-3.7.4

There is no sense of accomplishment when I see it.

from now on

I worked and wrote so far with the tension that seems to have reached the goal, The goal is to create something using the API, so I've only finally arrived at the start.

In addition, it is necessary to be enthusiastic and face each other.

Recommended Posts

Clogged with python update of GCP console ② (Solution)
Clogged with python update of GCP console ①
Automatic update of Python module
Implementation of Bulk Update with mongo-go-driver
Replace dictionary value with Python> update ()
Getting Started with Python Basics of Python
Life game with Python! (Conway's Game of Life)
10 functions of "language with battery" python
Implementation of Dijkstra's algorithm with python
Coexistence of Python2 and 3 with CircleCI (1.0)
Basic study of OpenCV with Python
[Blender] List of shortcut keys of Python Console that comes standard with Blender
How to update the python version of Cloud Shell on GCP
Make the Python console covered with UNKO
Basics of binarized image processing with Python
[Examples of improving Python] Learning Python with Codecademy
Execute Python script with cron of TS-220
Automatic update method with python Pyinstaller exe
Check the existence of the file with python
Output Python log to console with GAE
Easy introduction of speech recognition with Python
[GCP] Operate Google Cloud Storage with Python
Python update (2.6-> 2.7)
UnicodeEncodeError struggle with standard output of python3
1. Statistics learned with Python 1-3. Calculation of various statistics (statistics)
Drawing with Matrix-Reinventor of Python Image Processing-
Recommendation of Altair! Data visualization with Python
Comparison of matrix transpose speeds with Python
[AtCoder] Solve A problem of ABC101 ~ 169 with Python
I tried hundreds of millions of SQLite with python
Prepare the execution environment of Python3 with Docker
Automatic operation of Chrome with Python + Selenium + pandas
Text extraction with GCP Cloud Vision API (Python3.6)
Performance comparison of face detector with Python + OpenCV
[Python] limit axis of 3D graph with Matplotlib
2016 The University of Tokyo Mathematics Solved with Python
Color page judgment of scanned image with python
[Note] Export the html of the site with python.
Calculate the total number of combinations with python
Use multiple versions of python environment with pyenv
Check the date of the flag duty with Python
Solve A ~ D of yuki coder 247 with python
1. Statistics learned with Python 1-2. Calculation of various statistics (Numpy)
[Python] Get rid of dating with regular expressions
How to specify attributes with Mock of python
Poetry-virtualenv environment construction with python of centos-sclo-rh ~ Notes
Automating simple tasks with Python Table of contents
Implementation of TRIE tree with Python and LOUDS
Get CPU information of Raspberry Pi with Python
[Python] Summary of S3 file operations with boto3
Find the solution of the nth-order equation in python
At the time of python update on ubuntu
Convert the character code of the file with Python3
Static analysis of Python code with GitLab CI
One-liner that outputs 10000 digits of pi with Python
Create a Python console application easily with Click
Continuation of multi-platform development with Electron and Python
[Python] Determine the type of iris with SVM
[Blender x Python] Think of code with symbols
Example of reading and writing CSV with Python
Get the update date of the Python memo file.