#########国内源地址##############
腾讯开源镜像站 http://mirrors.cloud.tencent.com/pypi/simple
豆瓣 http://pypi.douban.com/simple/
网易开源镜像站 http://mirrors.163.com/
搜狐开源镜像 http://mirrors.sohu.com/
华为镜像源 https://mirrors.huaweicloud.com/
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
浙江大学开源镜像站 http://mirrors.zju.edu.cn/
#########临时设置源##############
pip install XXXX -i http://pypi.douban.com/simple/
#########本地设置源##############
【我自己用的豆瓣,亲测可用】
# 查看设置
python -m pip config list
# 设置源
python -m pip config set global.index-url 'http://pypi.douban.com/simple/'
# 设置信任镜像
python -m pip config set install.trusted-host 'pypi.douban.com'
#########pip升级##############
python -m pip install --upgrade pip
#########打包成exe############
1、pip install pyinstaller
2、pyinstaller -F AllSelenium.py
然后生成exe exe要与静态资源配合,根据设置的资源路径。放在同一目录下最好
可能有路径问题问题,脚本添加:
import os
import sysdef app_path():
if hasattr(sys, 'frozen'):
return os.path.dirname(sys.executable) # 使用pyinstaller打包后的exe目录
return os.path.dirname(__file__) # 没打包前的py目录