I put Python 2.7 in Sakura VPS 1GB.

** Sakura VPS 1GB ** * Notice of the end of the trial period * has arrived, so I added ** Python2.7 ** for a moment. The purpose is ** parsing social data **! ** Python ** is one of the royal roads for data mining, so it's a good idea to experience it. * (・ ∀ ・)! !! *

Preparation

[funya@hogex ~]$ cd /usr/local/bin/
[funya@hogex bin]$ ls
[funya@hogex ~]$ sudo yum install gcc
[funya@hogex bin]$ sudo yum install libjpeg-devel
[funya@hogex bin]$ sudo yum install zlib-devel
[funya@hogex bin]$ sudo wget http://www.sqlite.org/sqlite-autoconf-3070500.tar.gz
[funya@hogex bin]$ sudo tar xvfz sqlite-autoconf-3070500.tar.gz

By the way, it's easy because you can erase all commands with CTRL + U.

Install sqlite

[funya@hogex bin]$ cd sqlite-autoconf-3070500
[funya@hogex bin]$ sudo ./configure
[funya@hogex bin]$ sudo make
[funya@hogex bin]$ sudo make install

Install Python 2.7

[funya@hogex bin]$ sudo wget http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2
[funya@hogex bin]$ sudo tar xjvf Python-2.7.tar.bz2
[funya@hogex bin]$ cd Python-2.7
-bash: cd: Python-2.7:No permission
[funya@hogex bin]$ sudo chmod a+rwx Python-2.7
[funya@hogex bin]$ ./configure --enable-shared

[funya@hogex bin]$ sudo yum -y install httpd-devel
[funya@hogex bin]$ sudo wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
[funya@hogex bin]$ sudo tar xvfz mod_wsgi-3.3.tar.gz
[funya@hogex bin]$ cd mod_wsgi-3.3
[funya@hogex mod_wsgi-3.3]$ sudo ./configure --with-apxs=/usr/sbin/apxs --with-python=/usr/local/bin/python
checking Apache version... 2.2.15
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
/usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
configure: creating ./config.status
config.status: creating Makefile

It was an error. Investigation.

[funya@hogex bin]$ ldd python2.7

Hmmm, the file seems to have been created. This is a symbolic link that is always used.

[funya@hogex lib64]$ sudo ln /usr/local/bin/Python-2.7/libpython2.7.so.1.0 libpython2.7.so.1.0
[funya@hogex mod_wsgi-3.3]$ sudo ./configure --with-apxs=/usr/sbin/apxs --with-python=/usr/local/bin/python
checking Apache version... 2.2.15
configure: creating ./config.status
config.status: creating Makefile
[funya@hogex mod_wsgi-3.3]$ sudo make
[funya@hogex mod_wsgi-3.3]$ sudo make install
[funya@hogex bin]$ python -V
Python 2.7
[funya@hogex bin]$ sudo python
Python 2.6.6 (r266:84292, Feb 22 2013, 00:00:18) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
>>>

It worked for the time being! Let's finish today ☆ Mi


ref) 1. http://www.kzfmix.com/sakura/python.html ref) 2. http://itpro.nikkeibp.co.jp/article/COLUMN/20060228/231200/ ref) 3. http://homepage3.nifty.com/nasunu-i/LinuxBeginner/Permission.htm ref) 4. http://memo.yomukaku.net/entries/jbRkQkq

tip) 1. $ ll for detailed information about the file tip) 2. tar xjvf Python_hogehoge.bz2 tip) 3. Press CTRL + U to erase all commands

Recommended Posts

I put Python 2.7 in Sakura VPS 1GB.
I wrote python in Japanese
I understand Python in Japanese!
What I learned in Python
Put MeCab in "Windows 10; Python3.5 (64bit)"
Put python, numpy, opencv3 in ubuntu14
Until you put Python in Docker
I wrote Fizz Buzz in Python
I put Arch in XPS 13 (7390) (Note)
I learned about processes in Python
I can't install scikit-learn in Python
I wrote the queue in Python
I tried Line notification in Python
I wrote the stack in Python
I tried to implement PLSA in Python
I tried to implement permutation in Python
I made a payroll program in Python!
[Itertools.permutations] How to put permutations in Python
PUT gzip directly to S3 in Python
I tried to implement PLSA in Python 2
I tried using Bayesian Optimization in Python
I can't debug python scripts in Eclipse
I put Linux (Ubuntu) in VAIO SX14.
I implemented Cousera's logistic regression in Python
I tried to implement ADALINE in Python
I wanted to solve ABC159 in Python
I tried to implement PPO in Python
I searched for prime numbers in python
I created a password tool in Python.
Why can't I install matplotlib in python! !!
Quadtree in Python --2
Python in optimization
CURL in python
Metaprogramming in Python
I want to do Dunnett's test in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
I implemented Robinson's Bayesian Spam Filter in python
Put python xgboost in max osx (llvm version)
A memo that I wrote a quicksort in Python
Meta-analysis in Python
Unittest in python
I was able to recurse in Python: lambda
Put text scraped in Python into Google Sheets
I want to create a window in Python
I got an error when I put opencv in python3 with Raspberry Pi [Remedy]
I tried playing a typing game in Python
When I try matplotlib in Python, it says'cairo.Context'
I tried simulating the "birthday paradox" in Python
3 steps to put Python + mecab in yum only
I tried the least squares method in Python
I started python
I investigated in detail about variable processing in python
I wrote a class in Python3 and Java
Epoch in Python
Discord in Python
I wrote "Introduction to Effect Verification" in Python
Sudoku in Python
DCI in Python
quicksort in python