$ ipython
Python 3.4.3 (default, Sep 14 2016, 12:36:27)
Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
ipython は問題なく起動するようだね!
4.Matplotlib 動作確認
肝心な Matplotlib は・・・
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1,2,3,4,5,4,3,2,1])
plt.savefig('graph.png')
ファイル「graph.png」が作れたようだ。
作成した graph.png を Windows から開いてみる。Ubuntu 環境の home ディレクトリは、例えば k4750 ユーザだと、以下のような場所に存在する。
# python setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in
from setuptools import find_packages, setup
ImportError: No module named 'setuptools'
Python3 用の setuptools をインストールする。
# aptitude search setuptools
...
p python3-setuptools - Python3 Distutils Enhancements
p python3-setuptools-git - plugin for setuptools that enables git integration
v python3.4-setuptools -
# aptitude install python3-setuptools
3.インストール
Django の setup.py を使ってインストールを実行する。
# python setup.py install
...
Installed /usr/local/lib/python3.4/dist-packages/Django-1.10.2-py3.4.egg
Processing dependencies for Django==1.10.2
Finished processing dependencies for Django==1.10.2
Django のバージョンを確認してみる。
# python
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print(django.get_version())
1.10.2
$ cd mysite
$ python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
October 08, 2016 - 02:14:31
Django version 1.10.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
lynx http://127.0.0.1:8000/ を実行して、動作しているか確認してみる。
It worked!
Congratulations on your first Django-powered page.
Of course, you haven't actually done any work yet. Next, start your first app by running python manage.py startapp [app_label].
You're seeing this message because you have DEBUG = True in your Django settings file and you haven't configured any URLs. Get to work!
ページは表示された。先ほど開発用サーバを起動したコンソールを見てみると・・・
...
Quit the server with CONTROL-C.
[08/Oct/2016 02:19:09] "GET / HTTP/1.1" 200 1767
$ wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.5.7.tar.gz
$ tar xvfz 4.5.7.tar.gz; cd mod_wsgi-4.5.7
$ ./configure
$ make
$ sudo make install