rhel5.5 搭建pyinstaller环境
来源:互联网 发布:booking.it 编辑:程序博客网 时间:2024/06/03 20:03
rhel5.5 搭建pyinstaller环境
1.python和pyinstaller环境搭建(redhat5.5)
1.1 从python官网下载python2.7.12。
1.2 安装:https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
xz -d Python-2.7.12.tar.xz
tar -xf Python-2.7.12.tar
cd Python-2.7.12
. /configure --enable-shared --prefix=/tmp/python2.7 (注意:一定要加上--enable-shared参数,允许build python动态库。否则,pyinstaller会报:找不到模块。IOError: Python library not found: libpython2.7mu.so.1.0, libpython2.7.so.1.0, libpython2.7m.so.1.0)
make
make install
1.3 安装setuptool,以便使用setup安装包点击打开链接。
tar -zxf setuptoos.tar.gz
cd setuptoos
export PATH=/tmp/python2.7:$PATH (方便可以直接调用最新的python命令)
export LD_LIBRARY_PATH=/tmp/python2.7/lib/
python2.7 setup.py install --prefix=/tmp/python2.7/ (将pip安装到最新的python中)
1.4 安装pip,下载pip点击打开链接。
tar -zxf pip-9.0.1.tar.gz
cd pip-9.0.1
export PATH=/tmp/python2.7:$PATH (方便可以直接调用最新的python命令)
export LD_LIBRARY_PATH=/tmp/python2.7/lib/
python2.7 setup.py install --prefix=/tmp/python2.7/ (将pip安装到最新的python中)
1.5安装pyinstaller
pip install pyinstaller
至此就安装完成了!
2. pyinstaller打包可执行文件。
1.打成单个可执行文件:
pyinstaller -F test.py (test.py为自己所需要打成的可执行文件的源码)
2.打成包,包中包含动态库和可执行文件。
pyinstaller -D test.py
3.部分参数解释:
-i 跟程序的ico文件。
-w 非console程序。
3.安装python过程中出现的问题。
1.在编译python动态库时即(--enable-shared参数),会出现:缺少库的问题:
Python build finished, but the necessary bits to build these modules were not found:
_tkinter bsddb185 dl
imageop sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
这个问题在多个python版本中编译都会出现,这个问题可以根据自身实际需要来安装需要的库。
2.pyinstaller和自己编译安装python启动都需要加载自身动态链接库,所以,在使用之前请export以下环境变量:
export LD_LIBRARY_PATH=/tmp/python2.7/lib/
- rhel5.5 搭建pyinstaller环境
- 在RHEL5上搭建LAMP环境
- win32 Python环境搭建(Python3.5+PyQt5+PyCharm+打包工具PyInstaller)
- Python GUI打包程序pyinstaller在Windows环境下的搭建
- RHEL5 搭建FTP
- RHEL5安装中文环境
- RedHat(rhel5.5_x86-client)下配置CUDA开发环境
- pyinstaller
- Pyinstaller
- pyInstaller
- RHEL5下搭建DNS服务器
- RHEL5下搭建DNS服务器
- RHEL5下搭建DNS服务器
- Git+RHEL5搭建使用指南一
- rhel5下编译php环境
- rhel5.5配置yum
- RHEL5.5启动xdmcp
- RHEL5.5-DNS设置
- AMS 如何管控 Activity/Service/Broadcast的?
- 工作BUG总结(一)
- 数据查询
- 轻松玩转Camera,使用CameraView来拍照,修改CameraView 实现自定义拍照分辨率
- 部署ElasticSearch环境的几点注意
- rhel5.5 搭建pyinstaller环境
- C语言总结(三)
- [leetcode:python]9.Palindrom Number
- 借助数据库执行sql语句批量生成测试数据
- C++ HackerRank|Truck Tour
- ES安装X-pack后的默认账户与密码
- SSAS日期维度部署出错, 出现重复属性键
- Android编程学习之一:简单的控件使用
- 使用yum安装 MariaDB 数据库