A story that got stuck when trying to upgrade the Python version on GCE

TL;DR There were other files that should be ʻapt get`. I will write it very roughly.

version

$ python3 -V
3.5.3

pyenv install 3.7.3

$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
$ echo 'eval "$(pyenv init -)"' >> ~/.profile
$ source ~/.profile
jrny@iris:~/Iris$ pyenv install  3.7.3
Downloading Python-3.7.3.tar.xz...
-> https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
Installing Python-3.7.3...

BUILD FAILED (Debian 9.11 using python-build 1.2.16-1-g4500a33c)

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

Last 10 log lines:
    sys.exit(ensurepip._main())
  File "/tmp/python-build.20200112073219.22183/Python-3.7.3/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
  File "/tmp/python-build.20200112073219.22183/Python-3.7.3/Lib/ensurepip/__init__.py", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/tmp/python-build.20200112073219.22183/Python-3.7.3/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1130: recipe for target 'install' failed
make: *** [install] Error 1

Something went wrong, so Look at the error log.

/tmp/python-build.20200112073219.22183.log I've collected logs in, so I took a look.

Last 10 log lines:
    sys.exit(ensurepip._main())
  File "/tmp/python-build.20200112073219.22183/Python-3.7.3/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
  File "/tmp/python-build.20200112073219.22183/Python-3.7.3/Lib/ensurepip/__init__.py", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/tmp/python-build.20200112073219.22183/Python-3.7.3/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1130: recipe for target 'install' failed
make: *** [install] Error 1

understood. GCE was so easy.

$ sudo apt update
$ 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

Anyway, I'll put in various things.

It went well.

Recommended Posts

A story that got stuck when trying to upgrade the Python version on GCE
A story when a beginner gets stuck trying to build a vim 8.2 + python 3.8.2 + lua plugin environment on Ubuntu 18.04.4 LTS
A story that failed when trying to remove the suffix from the string with rstrip
I got stuck when trying to specify a relative path with relative_to () in python
The story that the version of python 3.7.7 was not adapted to Heroku
A story that struggled to handle the Python package of PocketSphinx
Django-A story that got stuck when trying to operate mail with SES and Amazon SES (also introduces the fastest operation procedure)
A story that didn't work when I tried to log in with the Python requests module
About the error I encountered when trying to use Adafruit_DHT from Python on a Raspberry Pi
A story that suffered from OS differences when trying to implement a dissertation
A solution to the problem that the Python version in Conda cannot be changed
About the point that python 3.x got stuck due to an error due to caching_sha2_password
[Python] Solution to the problem that elements are linked when copying a list
A story that I was addicted to when I made SFTP communication with python
When I tried to introduce python3 to atom, I got stuck
A story that required preparation when trying to do a Django tutorial with plain centos7
A story that was convenient when I tried using the python ip address module
A story about a Python beginner trying to get Google search results using the API
A memo of misunderstanding when trying to load the entire self-made module with Python3
A story about trying to introduce Linter in the middle of a Python (Flask) project
[python] A note when trying to use numpy with Cython
A story about trying to implement a private variable in Python.
When you want to hit a UNIX command on Python
[Python] A story that seemed to fall into a rounding trap
A story that makes it easy to estimate the living area using Elasticsearch and Python
Summary of points to keep in mind when writing a program that runs on Python 2.5
A program that failed when trying to create a linebot with reference to "Dialogue system made with python"
A story about trying to use cron on a Raspberry Pi and getting stuck in space
A story that pyenv is stuck because the python execution command PATH does not pass
When writing to a csv file with python, a story that I made a mistake and did not meet the delivery date
"Cython" tutorial to make Python explosive: When a function on the C ++ side has an overload.
The story that a hash error came out when using Pipenv
A story that I fixed when I got Lambda logs from Cloudwatch Logs
How to get the Python version
A story about trying to run multiple python versions (Mac edition)
[Python] I tried to make a simple program that works on the command line using argparse.
The story that the guard was confined when the laboratory was converted to IoT
A script that returns 0, 1 attached to the first Python prime number
How to update the python version of Cloud Shell on GCP
[python] A note that started to understand the behavior of matplotlib.pyplot
The story of the algorithm drawing a ridiculous conclusion when trying to solve the traveling salesman problem properly
The story of making a module that skips mail with python
[Python] A program that rotates the contents of the list to the left
[Python] About creating a tool to create a new Outlook email based on the data of the JSON file and the part that got caught
[Python] I made a bot that tells me the current temperature when I enter a place name on LINE
A story about trying to run JavaScripthon on Windows and giving up.
ImportError when trying to use gcloud package with AWS Lambda Python version
Things to watch out for when creating a Python environment on a Mac
[Python] A program that calculates the number of socks to be paired
A story I was addicted to when inserting from Python to a PostgreSQL table
A story I was addicted to trying to install LightFM on Amazon Linux
When Selenium tells me that the Chrome driver version is different (Python)
[Python / Pandas] A bug occurs when trying to replace a DataFrame with `None` with` replace`
A story of a deep learning beginner trying to classify guitars on CNN
I get a UnicodeDecodeError when trying to connect to oracle with python sqlalchemy
A reminder of what I got stuck when starting Atcoder with python
A memorandum because I stumbled on trying to use MeCab in Python
The story of trying to push SSH_AUTH_SOCK obsolete on screen with LD_PRELOAD
A note where a Python beginner got stuck
The story of trying to reconnect the client
The story of blackjack A processing (python)