ubuntu環(huán)境安裝

虛擬機(jī)系統(tǒng)安裝:

1、? 首先安裝虛擬環(huán)境(VMware-workstation)

2、? 在虛擬機(jī)中安裝Ubuntu系統(tǒng)(ubuntu-16.04.4)


Ubuntu系統(tǒng)安裝:

第一步:安裝系統(tǒng)

1.插入系統(tǒng)u盤

2.計算機(jī)啟動時一直按f1

3.選擇ubuntu系統(tǒng)–>回車

4.安裝完成

第二步:配置環(huán)境

1.拷貝u盤中anyconnect-64.sh文件,然后命令行中執(zhí)行 sudo sh anyconnect-64.sh

2.環(huán)境安裝步驟同下。


環(huán)境安裝:

安裝pip

sudo apt-get install python-pip python-dev build-essential

如果上面命令報錯執(zhí)行sudo apt-get update更新軟件資源,然后在執(zhí)行上面命令


安裝虛擬環(huán)境

sudo pip install --upgrade virtualenv

sudo pip install virtualenvwrapper


安裝完成后,在~/.bashrc寫入以下內(nèi)容

source /usr/local/bin/virtualenvwrapper.sh

source ~/.bashrc    #讀入配置文件,立即生效


安裝mysql

sudo apt-get install mysql-server # 安裝mysql,賬戶:root?? 密碼:root


創(chuàng)建"artpollo"數(shù)據(jù)庫: create database artpollo character set utf8;

在artpollo數(shù)據(jù)庫創(chuàng)建artpollo用戶,密碼為artpollo:?

createuser artpollo identifiedby'artpollo';

授權(quán)artpollo用戶數(shù)據(jù)庫表權(quán)限:?

grantallprivilegeson*.*to'artpollo'@'localhost'identifiedby'artpollo'withgrantoption;


sudo

apt-get install libmysqlclient-dev? #

后面安裝MySQL-python時,會報錯“EnvironmentError: mysql_config not

found”,需要安裝libmysqlclient-dev




安裝git: sudo apt install git

生成ssh key:

ssh-keygen -t rsa -C “*******@qq.com”? 按三次回車就可以

用戶根目錄ssh 中獲取key:

cd .ssh

cat id_rsa.pub

拷貝key 然后放到自己icode,然后本地可以克隆代碼了



安裝pycharm,網(wǎng)上找個ubuntu版本

Pycharm 配置:

File -> settings -> interpreter? 里面選擇自己虛擬環(huán)境的Python版本

Djangdo創(chuàng)建數(shù)據(jù)表:

makemigrations

migrate

createsuperuser? 用戶名


ubuntu修改終端顯示 (可改可不改):

在用戶根目錄下修改 .bashrc 文件,在文件的末尾加上以下代碼:

function git_branch {

? branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"

? if [ "${branch}" != "" ];then

????? if [ "${branch}" = "(no branch)" ];then

????????? branch="(`git rev-parse --short HEAD`...)"

????? fi

????? echo "->$branch"

? fi

}

export PS1='\u@\h \[\033[01;36m\]\W\[\033[01;32m\]$(git_branch)\[\033[00m\] \$ '

#export

PS1='\[\e[37;40m\][\[\033[01;36m\]\u\[\e[37;40m\]@\[\e[0m\]\h

\[\033[01;36m\]\W\[\033[01;32m\]$(git_branch)\[\033[00m\]\[\e[37;40m\]]\[\e[0m\]\$

'

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容