ubuntu环境安装

虚拟机系统安装:

1、  首先安装虚拟环境(VMware-workstation)

2、  在虚拟机中安装Ubuntu系统(ubuntu-16.04.4)


Ubuntu系统安装:

第一步:安装系统

1.插入系统u盘

2.计算机启动时一直按f1

3.选择ubuntu系统–>回车

4.安装完成

第二步:配置环境

1.拷贝u盘中anyconnect-64.sh文件,然后命令行中执行 sudo sh anyconnect-64.sh

2.环境安装步骤同下。


环境安装:

安装pip

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

如果上面命令报错执行sudo apt-get update更新软件资源,然后在执行上面命令


安装虚拟环境

sudo pip install --upgrade virtualenv

sudo pip install virtualenvwrapper


安装完成后,在~/.bashrc写入以下内容

source /usr/local/bin/virtualenvwrapper.sh

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


安装mysql

sudo apt-get install mysql-server # 安装mysql,账户:root   密码:root


创建"artpollo"数据库: create database artpollo character set utf8;

在artpollo数据库创建artpollo用户,密码为artpollo: 

createuser artpollo identifiedby'artpollo';

授权artpollo用户数据库表权限: 

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,网上找个ubuntu版本

Pycharm 配置:

File -> settings -> interpreter  里面选择自己虚拟环境的Python版本

Djangdo创建数据表:

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\]\$

'

你可能感兴趣的:(ubuntu环境安装)