跳转至

ubuntu16.04安装python+node环境

软件源

  • 设置国内源

  • sudo gedit /etc/apt/sources.list

  • 清空文件内所有的内容, 替换成下面的

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  • 重启
sudo apt update
sudo apt upgrade

输入法

  1. 进入Fcitx输入法配置中附加组件 点击高级
  2. 找到云输入,点击配置,把Google替换成baidu

jetbrains-toolbox

1. 首先去官网下载 http://www.jetbrains.com/toolbox/app/?fromMenu

58249-pky6oro8o4r.png

2. 下载完毕之后,解压缩, windows/linux 双击即可安装

25530-kqg4wn0htti.png

3. linux在安装之后可以删除掉文件了,记得把软件添加到DOCK栏

14785-5o9b27wmtpb.png

Python三大神器->pip

安装pip3

sudo apt-get install python3-pip

指定pip3 国内源

cd ~/
mkdir ./.pip
gedit ./.pip/pip.conf
#插入
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
#保存退出

升级pip3

pip3 install --upgrade pip

查看版本

pip3 -V

Python三大神器->virtualenv

1. 安装

pip3 install virtualenv
pip3 install virtualenvwrapper
export WORKON_HOME=~/.Envs #设置环境变量路径 (在~/路径下的.Envs)
mkdir -p $WORKON_HOME # 创建虚拟环境管理目录 (在~/路径下创建.Envs)
sudo find / -name virtualenvwrapper.sh #找到virtualenvwrapper.sh的路径
sudo gedit ~/.bashrc  #打开终端的配置文件在最下面添加
......
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/home/zhangy233/.local/bin/virtualenv
export WORKON_HOME=~/.Envs
# 下面的路径替换成上面找到的路径
source /home/zhangy233/.local/bin/virtualenvwrapper.sh
......
source ~/.bashrc  #重启终端
sudo rm -r ~/.virtualenvs/ # 删除默认的环境变量文件夹

ZSH同理

前端相关

1、先在系统上安装好nodejs和npm

sudo  apt-get  install  nodejs-legacy
sudo  apt-get  install  npm

2、安装用于安装nodejs的模块n

sudo  npm  install  -g  n

3、通过n模块安装指定的nodejs

sudo  n  latest
sudo  n  stable
sudo  n  lts

4、升级npm为最新版本

sudo  npm  install  npm@latest  -g

5、查看版本

sudo  node  -v
sudo  npm  -v
npm config set registry https://registry.npm.taobao.org
sudo npm install -g @vue/cli # sudo安装