python常用命令
安装
sudo easy_install pip
列出已安装的包
pip freeze or pip list
导出requirements.txt
pip freeze > <目录>/requirements.txt
安装包
在线安装
pip install <包名> 或 pip install -r requirements.txt
通过使用== >= <= > <来指定版本,不写则安装最新版
requirements.txt内容格式为:
APScheduler==2.1.2
Django==1.5.4
MySQL-Connector-Python==2.0.1
MySQL-python==1.2.3
PIL==1.1.7
South==1.0.2
django-grappelli==2.6.3
django-pagination==1.0.7
安装本地安装包
pip install <目录>/<文件名> 或 pip install --use-wheel --no-index --find-links=wheelhouse/ <包名>
<包名>前有空格
可简写为
pip install --no-index -f=<目录>/ <包名>
卸载包
pip uninstall <包名> 或 pip uninstall -r requirements.txt
升级包
pip install -U <包名>
或:pip install <包名> --upgrade
升级pip
pip install -U pip
显示包所在的目录
pip show -f <包名>
搜索包
pip search <搜索关键字>
查询可升级的包
pip list -o
下载包而不安装
pip install <包名> -d <目录> 或 pip install -d <目录> -r requirements.txt
打包
pip wheel <包名>
更换国内pypi镜像
国内pypi镜像
- 阿里:
https://mirrors.aliyun.com/pypi/simple - 中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/simple/
指定单次安装源
pip install <包名> -i https://mirrors.aliyun.com/pypi/simple
指定全局安装源
在unix和macos,配置文件为:$HOME/.pip/pip.conf
在windows上,配置文件为:%HOME%\pip\pip.ini
[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple
python常用命令的更多相关文章
- python常用命令和基础运算符
基础运算符 http://www.cnblogs.com/alex3714/articles/5465198.html 身份运算符:is is not成员运算符:in not in ##in 判断元素 ...
- Python 常用命令
对Python进行软件的安装.卸载和查看,是我们在日常工作中经常要做的事情,有的时候会突然忘记常用的命令,所以在此记录下来: pip 安装软件包 pip install xxx 卸载软件包 pip u ...
- OpenCV for Python常用命令
读取图像首先要导入OpenCV包 import cv2 OpenCV目前支持读取bmp.jpg.png.tiff等常用格式. //读取图片 img2 = cv2.imread('out-0022. ...
- Linux(Ubuntu) 和 Python 常用命令
Linux: pwd: check current directory touch f1 f2 f3: create three empty files tree dir/: show the lev ...
- python常用命令(持续) | Commonly used Python command list (con't)
---------------------------------------------------------------------------------------------------- ...
- python常用命令—‘\r’
# \r 默认表示将输出的内容返回到第一个指针,这样的话,后面的内容会覆盖前面的内容 如常用的显示程序完成进度!!
- python常用命令—windows终端查看安装包信息
1, pip list 会将 Python 的所有安装包全部显示出来, 左边是包名, 右边是包的版本号. 2, pip show 包的名字 会将这个包的名字,版本号,包的功能说明,按装这个包的路径显示 ...
- deepfake安装python常用命令
pip install -r requirements.txt -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/ python -m p ...
- python 常用命令sys.exit()
Python的程序有两中退出方式:os._exit(), sys.exit() os._exit()会直接将python程序终止,之后的所有代码都不会继续执行. sys.exit()会引发一个异常:S ...
- deeplearning.ai 作业中的Python常用命令
1. print大法 test = Hello World print ("test:" + test) 2. math和numpy的区别:math只对单个元素,numpy会bro ...
随机推荐
- MySql数据库常用语句汇总
第一天1.登陆数据库 mysql -uroot -proot; //-u用户名 -p密码2.启动数据库 net start mysql;3.创建表空间(数据库)create database qy97 ...
- (django1.10)访问url报错Forbidden (CSRF cookie not set.): xxx
问题:页面访问时报错 Forbidden (CSRF cookie not set.): xxx 解决方法: 修改settings.py文件,注释掉 django.middleware.csr ...
- Kubernetes 之上的架构应用
规划并运转一个兼顾可扩展性.可移植性和健壮性的运用是一件很有应战的事情,尤其是当体系杂乱度在不断增长时.运用或体系 本身的架构极大的影响着其运转办法.对环境的依靠性,以及与相关组件的耦合强弱.当运用在 ...
- GIT 命令集
Git图形化界面 下面是我整理的常用 Git 命令清单.几个专用名词的译名如下. Workspace:工作区 Index / Stage:暂存区 Repository:仓库区(或本地仓库) Remot ...
- linux 重定向命令详解(如1>/dev/null 2>&1)
基础 0:表示标准输入stdin 1:表示标准输出stdout,系统默认为1,可省略(即1>/dev/null等价于>/dev/null) 2:表示标准错误stderr >:表示重定 ...
- Shell教程 之字符串
1.Shell字符串 字符串是shell编程中最常用最有用的数据类型(除了数字和字符串,也没啥其它类型好用了),字符串可以用单引号,也可以用双引号,也可以不用引号. 1.1 单引号 str='I am ...
- 【Linux 线程】引出线程加锁问题
1.多线程的问题引入 多线程的最大的特点是资源的共享,但是,当多个线程同时去操作(同时去改变)一个临界资源时,会破坏临界资源.
- Django使用jsonp和cors解决跨域请求问题
1.使用jsonp的方式解决跨域请求的问题 我启动两个django项目,然后使用的端口不一样,在项目1中通过ajax发请求给项目2,然后接受项目2发送过来的数据 先看项目1的ajax的代码 $(&qu ...
- ubuntu系统ssh遇到port 22:No route to host问题
ssh遇到这个port 22:No route to host这个问题 检查防火墙状态 (iptables -L) 检查ssh状态 (ps -elf |grep ssh) 检查网络状态(换根网线)
- es数组去重的简写
console.log([...new Set([2, 2, 12, 1, 2, 1, 6, 12, 13, 6])])