ubuntu下用Pip安裝python拓展包
今天在windows下學習django的時候創建admin的用戶,在python命令模式執行manage.py createsuperuser
python.exe虛擬機崩潰...我也崩潰了,按照教程一步步沒錯,環境也沒問題,在網上找到了一些同樣的錯誤 但貌似
沒解決方法,建議換到linux環境下..沒辦法只能將python整體搬遷到ubuntu虛擬機中,晚上在配環境安裝以前的
一些python拓展。在python中可以使用easy_install和pip安裝python拓展但推薦使用pip,在stackoverflow看到
個帖子:
Don't use easy_install, unless you like stabbing yourself in the face. Use pip.
Two reasons, there may be more:
-
pip provides an
uninstall
command -
if an installation fails in the middle, pip will leave you in a clean state.
安裝pip的方法:
Install pip and virtualenv for Ubuntu 10.10 Maverick and newer
$ sudo apt-get install python-pip python-dev build-essential
$ sudo pip install --upgrade pip
$ sudo pip install --upgrade virtualenv
For older versions of Ubuntu
-
Install Easy Install
$ sudo apt-get install python-setuptools python-dev build-essential
-
Install pip
$ sudo easy_install pip
-
Install virtualenv
$ sudo pip install --upgrade virtualenv
安裝mysql拓展包可以:sudo pip install
mysql-python
安裝其他的包只要pip + 包的名字 就行了 很方便。而且安裝完的mysqlib用起來沒一點問題,
在windows下還要修改下源文件。寫程序還是在linux下好啊。
安裝mysql
apt-get install mysql-server