py2exe打包pyside项目时出错
来源:互联网 发布:淘宝管理中心在哪 编辑:程序博客网 时间:2024/05/29 12:32
使用py2exe打包pyside时发现如下错误:
Traceback (most recent call last): File "Main.py", line 4, in <module> File "zipextimporter.pyo", line 82, in load_module File "PySide\__init__.pyo", line 41, in <module> File "PySide\__init__.pyo", line 11, in _setupQtDirectories File "PySide\_utils.pyo", line 97, in get_pyside_dir File "PySide\_utils.pyo", line 88, in _get_win32_case_sensitive_name File "PySide\_utils.pyo", line 63, in _get_win32_short_nameWindowsError: [Error 3] 系统找不到指定的路径。
查源代码_utils.py源码如下:
def get_pyside_dir(): try: from . import QtCore except ImportError: return os.path.abspath(os.path.dirname(__file__)) else: return os.path.abspath(os.path.dirname(QtCore.__file__))
可知主要问题在于这里打包成exe zip后,__file__表示的路径找不到了,作如下修改即可解决问题
def get_pyside_dir(): is_frozen = hasattr(sys, 'frozen') try: from . import QtCore except ImportError: s1 = sys.argv[0] if is_frozen else __file__ return _get_win32_case_sensitive_name(os.path.abspath(os.path.dirname(s1))) else: s2 = sys.argv[0] if is_frozen else QtCore.__file__ return _get_win32_case_sensitive_name(os.path.abspath(os.path.dirname(s2)))
参考这里https://stackoverflow.com/questions/17509088/system-path-error-with-pyqt-and-py2exe
原创,转载请注明来自http://blog.csdn.net/wenzhou1219
阅读全文
0 0
- py2exe打包pyside项目时出错
- py2exe打包出错
- pyqt 用py2exe打包出错的解决办法
- py2exe打包PyQt项目若干问题总结
- py2exe打包
- py2exe打包
- py2exe打包
- py2exe打包
- py2exe 打包
- 将pyside项目打包成windows,ubuntu和mac可执行文件。
- Py2exe 打包 Python项目(traits、traitsui、matplotlib)
- python+pyside+py2exe+inno setup 开发图形界面程序
- python+pyside+py2exe+inno setup 开发图形界面程序
- py2exe打包问题
- py2exe打包一个文件
- Py2exe打包成exe
- python--py2exe打包方法
- py2exe打包python脚本
- Apache Spark 2.2.0 中文文档
- Effective Java(避免使用最终方法、覆盖equals时请遵守通用约定)
- ibatis 传递复杂参数
- Prim算法与Kruskal算法探索
- 【PL/SQL】用星号拼出金字塔
- py2exe打包pyside项目时出错
- js基础-JSON
- 博客简介
- Linux下快速安装Ruby
- 【PostgreSQL-9.6.3】临时表
- springMVC返回jsp和html的配置,已经springmvc返回html乱码的解决方案
- iText导出pdf、word、图片
- Deepin系统更新apt-get源
- JS实现TITLE悬停长久显示效果