推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
inSpring
V2EX  ›  Python

pyinstaller + pyqt5 打出来的 windows 包,如果安装的路径有中文,就打不开吗?

  •  
  •   inSpring · Jun 1, 2022 · 2243 views
    This topic created in 1465 days ago, the information mentioned may be changed or developed.

    pyinstaller + pyqt5 + nsis 打出来的 windows 安装包,发给用户,如果用户的安装路径有中文,安装后,点击图标无法打开。

    V 友们有遇到这个问题吗?有啥解决办法吗

    2 replies    2022-06-01 10:04:54 +08:00
    encro
        1
    encro  
       Jun 1, 2022
    首先排除 nsis 应该不会存在中文问题,因为一堆中文应用都是 nsis 打包的。安装成功后就和 nsis 没关系了。那么剩下来就是程序问题了:

    猜测 python 脚本 utf8 可能读取 windows 当前路径中文 gb 没有转码,导致路径错误,从而打不开。

    ----- 人脑 DEBUG
    bakaft
        2
    bakaft  
       Jun 1, 2022
    恰好刚碰到,可能是因为运行时解压的临时文件路径(解压到%TMP%或者%TEMP%) 存在中文(用户名字有中文)而导致的问题。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1149 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 17:46 · PVG 01:46 · LAX 10:46 · JFK 13:46
    ♥ Do have faith in what you're doing.