python常用国内镜像源

jupyter如何安装和使用

1、打开终端输入 pip3 install jupyter

如果安装过程中速度很慢可以使用国内pip镜像配置:

1.1 pip官方软件源

官方源 https://pypi.python.org/simple

1.2 常用国内镜像源

下载安装包 https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/opencv-python/ 清华的网址

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

1.3 临时指定软件源

通常来讲,如果想要手动指定临时软件源来安装软件的话,可是使用如下格式
pip install 需要下载的package -i xx(其中xx是指定的源ip地址)

例如, 从阿里云安装 jupyter:
python -m pip --default-timeout=300 install jupyter -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com/pypi/simple/
例如,使用豆瓣源来安装jupyter包
pip install jupyter -i https://pypi.douban.com/simple
python -m pip --default-timeout=300 install jupyter -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install pyodbc -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install pdfminer -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install wxauto -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install django-mssql -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install numpy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
例如,使用清华源来安装jieba包
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter
注意,simple 不能少, 是 https 而不是 http
升级 pip 到最新的版本 (>=10.0.0) 后进行配置:
python -m ensurepip 修复
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
如果您到 pip 默认源的网络连接较差,临时使用本镜像站来升级 pip:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U

python 安装第三方库,超时报错--Read timed out.

解决方法,设置超时时间

如: pip --default-timeout=100 install -U Pillow
matplotlib

2 、终端输入 IPython -V,查看当前使用的版本

3、具体使用

进入安装目录 我的目录是 /usr/bin/python

python3 -m IPython notebook

pip install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

python -m pip --default-timeout=300 install pyinstaller -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install pyecharts -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install pyside2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install sqlalchemy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install pyodbc -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install pymssql -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install baidu_aip -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install selenium -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install xlrd -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install xlwings -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install chinese_calendar -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install configparser -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install multiprocessing -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install functools -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install pyOpenSSL -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install charset -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install requests -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip --default-timeout=300 install 包名 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip -m pip --default-timeout=300 install django-sqlserver django-pytds pyodbc django-pyodbc pypiwin32 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

python -m pip --proxy http://proxy1.bj.petrochina:8080 install --upgrade chinese_calendar --trusted-host pypi.douban.com 更新 chinese_calendar

python 初始配置:setting-editor-File and Code Templates-Python Scripts

!/usr/bin/env python
-*- coding:utf-8 -*-
@Time:${DATE} ${TIME}
@Author:
@File:${NAME}.py
@Sofeware :${PRODUCT_NAME}

清华源 镜像网站
https://mirrors.tuna.tsinghua.edu.cn/

办公室电脑 ie使用了代理,在pycharm中也应相应进行配置:
File > Setting > apperarance&behavior > Sytem Setting > HTTP Proxy > Manual proxy configuration
HTTP Host name: proxy1.bj.petrochina
Port number: 8080

在线正则表达式:
https://tool.oschina.net/regex/

非官方安装包 选择
https://www.lfd.uci.edu/~gohlke/pythonlibs/
CTRL+F pandas 下载 pandas-1.3.0-cp39-cp39-win_amd64.whl
安装 : pip install pandas-1.3.0-cp39-cp39-win_amd64.whl 或pip install pandas 按TAB键补全

chromedriver.exe 下载地址:
https://npm.taobao.org/mirrors/chromedriver/97.0.4692.71/

批量安装包:
pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

下载 Ta-Lib包:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib

打包:
pyinstaller -F -w -i d:\fms202206\venv\images\rlylogo.ico fms.py --hiddenimport charset

posted @   冀未然  阅读(4243)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示