跟换下载源( 防止下载慢)
pip 国内的一些镜像
阿里云 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/
应该写详细点,win+R 打开用户目录%HOMEPATH%,在此目录下创建 pip 文件夹,在 pip 目录下创建 pip.ini 文件, 内容如下
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
安装UI开发库
(base) C:\Users\Administrator>pip install pySide
安装的过程有点长:
安装打包工具
(base) C:\Users\Administrator>pip install pyinstaller
注意次安装在命令行下安装,直接是显示超时,在 conda下才可以安装
安装完成之后的效果如下:
(base) C:\Users\Administrator>pip install pyinstaller
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: pyinstaller in c:\programdata\anaconda2\lib\site-packages (3.6)
Requirement already satisfied: altgraph in c:\programdata\anaconda2\lib\site-packages (from pyinstaller) (0.17)
Requirement already satisfied: pywin32-ctypes>=0.2.0 in c:\programdata\anaconda2\lib\site-packages (from pyinstaller) (0.2.0)
Requirement already satisfied: pefile>=2017.8.1 in c:\programdata\anaconda2\lib\site-packages (from pyinstaller) (2019.4.18)
Requirement already satisfied: dis3 in c:\programdata\anaconda2\lib\site-packages (from pyinstaller) (0.1.3)
Requirement already satisfied: setuptools in c:\programdata\anaconda2\lib\site-packages (from pyinstaller) (38.4.0)
Requirement already satisfied: future in c:\programdata\anaconda2\lib\site-packages (from pefile>=2017.8.1->pyinstaller) (0.18.2)
测试是否安装成功:
(base) C:\Users\Administrator>pyinstaller
usage: pyinstaller [-h] [-v] [-D] [-F] [--specpath DIR] [-n NAME]
...
pyinstaller: error: too few arguments
至此打包工具安装成功,但是使用命令行脚本编译工具还是不行:
这个一看就是环境变量没有设置好:
在 conda 中查看 path 找打对应的脚本的环境变量
···
C:\ProgramData\Anaconda2\Scripts
···
将其添加到 windows 的用户环境变量中
于是再次测试,就可以了