Python基本使用

基本安装

1、到官网下载最新的版本

虚拟环境

1、安装

pip install pipenv

2、(选用)修改环境变量 该环境会让虚拟环境创建再当前项目下,否则会创建默认位置

PIPENV_VENV_IN_PROJECT=1

3、到项目目录下

pipenv install

该命令会创建虚拟环境目录,并生成 PipfilePipfile.lock 文件

4、安装依赖

pipenv install package_name

5、国内源

阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/