注:我博客中的how-to系列只列出操作步骤,不涉及到原理和非通常情况的操作。主要为有相关经验的人进行速查。如果感兴趣的人比较多,则会写一个tutorial版本,提供详细入门说明。
1. 下载一个纯净的python
https://www.python.org/downloads/
2. 安装pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
3. 安装pipenv
pip install pipenv
4. 创建环境
cd到一个目录
如果使用python 3
pipenv —three
如果使用python 2
pipenv --two
5. 进入环境
pipenv shell
6. 安装软件所需包
pip install {your lib}
or
pip install -r requirments.txt
7. 安装打包软件
pip install pyinstaller
8. 打包
pyinstaller -Fw your_program.py