就是要安裝Python 3.4 + Django + Django REST framework…
●安裝Python 3.4
sudo yum install Python34
sudo加在yum命令前,是用來讓安裝這個套件的動作,
取得super user的安裝套件權限,這樣一來就不用切換到root帳戶,可降低系統風險
●安裝完後,可用命令 python3.4 -V來檢查安裝是否有成功,與顯示安裝的python3.4版本號
●接下來安裝python模組最需要的ez_install與pip
先下載 ez_setup
#wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
將檔案下載下來後,需下su命令切換到root帳戶,安裝ez_setup
#python3.4 ez_setup.py
手動使用 site.getsitepackages() 檢查看看是否正常
# python3.4
Python 3.4.3 (default, Jun 19 2015, 05:46:30)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import site; site.getsitepackages()
['/usr/local/lib/python3.4/site-packages', '/usr/local/lib/site-python']
>>>
●確認pip版本
#pip3.4 -V
安裝成功後畫面如下
1.9.1
#
●安裝virtual environment
$sudo pip install virtualenv
#sudo pip install markdown
#sudo pip install django-filter
http://www.django-rest-framework.org/
sudo yum install Python34
sudo加在yum命令前,是用來讓安裝這個套件的動作,
取得super user的安裝套件權限,這樣一來就不用切換到root帳戶,可降低系統風險
●安裝完後,可用命令 python3.4 -V來檢查安裝是否有成功,與顯示安裝的python3.4版本號
●接下來安裝python模組最需要的ez_install與pip
先下載 ez_setup
#wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
將檔案下載下來後,需下su命令切換到root帳戶,安裝ez_setup
#python3.4 ez_setup.py
手動使用 site.getsitepackages() 檢查看看是否正常
# python3.4
Python 3.4.3 (default, Jun 19 2015, 05:46:30)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import site; site.getsitepackages()
['/usr/local/lib/python3.4/site-packages', '/usr/local/lib/site-python']
>>>
●然後再安裝pip
#easy_install-3.4 pip●確認pip版本
#pip3.4 -V
●安裝Django
# sudo pip install django安裝成功後畫面如下
●確認安裝版本
# django-admin --version1.9.1
#
●安裝virtual environment
$sudo pip install virtualenv
●安裝django rest framework
#sudo pip install djangorestframework#sudo pip install markdown
#sudo pip install django-filter
references:
http://missions5.blogspot.tw/2014/04/centos-6-python34.htmlhttp://www.django-rest-framework.org/
沒有留言:
張貼留言