返回总目录页

pip安装使用详解

 

 

1、pip安装使用详解

2、pip添加环境变量:

import sys
sys.path.append("C:\python3\Scripts")
print(sys.path)
------------------结果:
['D:\\.........., 'C:\\python3\\Scripts']


3、pip报错:

pip install xlrd

-----------结果:

Fatal error in launcher: Unable to create process using '"d:\python3.6\python.exe" "D:\python3.6\Scripts\pip.exe" install xlrd'
解决方法:执行如下命令,重新安装pip,如果pip没问题就会更新
python3 -m pip install --upgrade pip

如果执行完后还不行,关闭cmd再开。

4、pip源

https://pypi.tuna.tsinghua.edu.cn/simple/ 

5、pip安装的直接复制粘贴就 可以用,但是要注意系统和版本

psutil 就是因为系统不同,而浪费好多时间

 

修改Linux服务使用阿里的pip源

# pip源也可以更新国内源,利用阿里的pip国内源

# 在~/.pip/pip.conf文件中添加或修改

[global]
index‐url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted‐host=mirrors.aliyun.com

 

a. 找到下列文件

~/.pip/pip.conf

b. 在上述文件中添加或修改:

[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

 

 

https://blog.csdn.net/qq_42102911/article/details/128214206

 

posted @ 2018-02-25 18:21  马昌伟  阅读(299)  评论(0编辑  收藏  举报
博主链接地址:https://www.cnblogs.com/machangwei-8/