[DOCKER] A story that required preparation when trying to do a Django tutorial with plain centos7

Background

If you want to touch Django and try to run it on Docker while studying the tutorial A story that required various preparations

Premise

--Use docker. The image of the container is centos7: latest --Install python uses pyenv in 3.5.2.

Overview

To do a Django tutorial, use pyenv in a docker container, When I tried to install and use python, I got an error, so I solved it little by little.

How to solve

Anyone who wants to solve it should execute the following script on the container. https://github.com/tomokitamaki/BuildForDockercontPython/tree/master `For my convenience, Django will be installed. ``

Errors and processes that came out

I didn't git when I tried to put pyenv

--Solution below [root@c72864a7fe2c ~]# yum install -y git

I didn't have a C compiler when I tried to install python

[root@c72864a7fe2c ~]# pyenv install 3.5.2
sha256sum: the --quiet option is meaningful only when verifying checksums
Try 'sha256sum --help' for more information.
Downloading Python-3.5.2.tar.xz...
-> https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
Installing Python-3.5.2...

BUILD FAILED (CentOS Linux 7 using python-build 1.0.0-47-g5be82cb)

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

Last 10 log lines:
checking for --with-universal-archs... no
checking MACHDEP... linux
checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/python-build.20160918121231.1047/Python-3.5.2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[root@c72864a7fe2c ~]# cat /tmp/python-build.20160918121231.1047.log

--Solution below [root@c72864a7fe2c ~]# yum install -y gcc

No make

--Solution below [root@c72864a7fe2c ~]# yum install -y make

no bzip2

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

--Solution below [root@c72864a7fe2c ~]# yum install -y bzip2-libs.x86_64 bzip2 bzip2-devel.x86_64

No GUN readline?

WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?

--Solution below [root@c72864a7fe2c ~]# yum install -y readline readline-devel.x86_64

Missing openssl library

--Solution below [root@c72864a7fe2c ~]# yum install openssl openssl-devel.x86_64

No sqlite

WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?

--Solution below [root@c72864a7fe2c ~]# yum install sqlite-devel.x86_64

Recommended Posts

A story that required preparation when trying to do a Django tutorial with plain centos7
A story that failed when trying to remove the suffix from the string with rstrip
A story that suffered from OS differences when trying to implement a dissertation
A story that I was addicted to when I made SFTP communication with python
Things to do when you start developing with Django
A story that got stuck when trying to upgrade the Python version on GCE
A story that stumbled when I made a chatbot with Transformer
[python] A note when trying to use numpy with Cython
A program that failed when trying to create a linebot with reference to "Dialogue system made with python"
[Django] A story about getting stuck in a swamp trying to validate a zip with form [TDD]
A story that I wanted to do a function like before_action used in rails with django [Beginner learns python with a reference book]
A story about trying to automate a chot when cooking for yourself
A story that didn't work when I tried to log in with the Python requests module
[Tips] How to do template extends when creating HTML with django
A story I was addicted to trying to get a video url with tweepy
[Python / Pandas] A bug occurs when trying to replace a DataFrame with `None` with` replace`
I get a UnicodeDecodeError when trying to connect to oracle with python sqlalchemy
A story about a beginner trying hard to set up CentOS 8 (procedure memo)
How to do arithmetic with Django template
The story that had nothing to do with partitions when I did disk backup with dd for the first time
When writing a test using DB with django, you may be able to do it faster by using `setUpTestData ()`
A story that did not end with exit when turning while with pipe input
The story of making a web application that records extensive reading with Django
How to develop a cart app with Django
Story of trying to use tensorboard with pytorch
A story about implementing a login screen with django
I got stuck when trying to specify a relative path with relative_to () in python
Create a flag in settings that will be True only when testing with Django
A memo of misunderstanding when trying to load the entire self-made module with Python3
Django-A story that got stuck when trying to operate mail with SES and Amazon SES (also introduces the fastest operation procedure)
When writing to a csv file with python, a story that I made a mistake and did not meet the delivery date
A story that I did not know how to load a mixin when making a front with the django app [Beginners learn python with a reference book in one hand]
I tried to create a table only with Django
What to do when gdal_merge creates a huge file
What I did when I stumbled on a Django tutorial
A story that struggled with the common set HTTP_PROXY = ~
When you want to filter with Django REST framework
A story about trying a (Golang +) Python monorepo with Bazel
A story that I was addicted to at np.where
Transit to the update screen with the Django a tag
The story that Japanese output was confused with Django
Things to watch out for when migrating with Django
A memo when Django was released on VPS (preparation)
Error and solution when trying to run a classifier made with Labellio with my own ubuntu
[Tips] Dealing with errors that occur when trying to install Python 3 series less than 3.5.3 with pyenv
What to do when a Missing artifact occurs in a jar that is not defined in pom.xml
A story that went missing when I specified a path starting with a tilde (~) in python open
A story that makes it easier to see Model debugging in the Django + SQLAlchemy environment
[Note] A story about trying to override a class method with two underscores in Python 3 series.
What to do if you get an Undefined error when trying to use pip with pyenv
A story that I had a hard time trying to create an "app that converts images like paintings" with the first web application