V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
chenstack
V2EX  ›  Python

关于 Windows 端 Python 3.7.2 embeddable 版运行报错

  •  1
     
  •   chenstack · 2018-12-25 19:17:03 +08:00 · 2917 次点击
    这是一个创建于 1921 天前的主题,其中的信息可能已经有所发展或是发生改变。

    由于是版本控,从 Python 官网一开始说的 12 月 20 日盼到今天,Python 3.7.2 终于发布了,激动地下载安装包更新,顺便下了embeddable zip

    因为自己的一个项目是 Python 嵌入 C++中(模仿 Sublime Text 的做法),覆盖新版的 pyd 及 Python37.zip 后却无法运行该项目了,这个 Python37.zip 是便携版打包后的标准库。

    在 VS 中调试发现 Py_InitializeEx 失败了。把 python-3.7.2-embed-amd64.zip 解压后直接运行 python 也是无法运行,报错:Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can't find module 'encodings'。

    我又下载了 3.7.1 版本的便携版 zip,用里面的 Python37.zip 覆盖 3.7.2 的却能运行。有人遇到这个问题吗,是否可以判断是 3.7.2 发行的 Python37.zip 有问题?目前想到的做法是自己把安装版的 Python 3.7.2 标准库编译成 pyc 打包一个 zip。

    第 1 条附言  ·  2019-01-09 19:43:47 +08:00
    官方已经修复了这个问题,详见 https://bugs.python.org/issue35596
    2 条回复    2019-01-09 19:38:43 +08:00
    justou
        1
    justou  
       2018-12-26 00:30:57 +08:00
    是的, 同样的错误, 而且不知道为啥压缩包里打包了两个一样的 vcruntime140.dll
    chenstack
        2
    chenstack  
    OP
       2019-01-09 19:38:43 +08:00   ❤️ 1
    @justou Python 官方已经修复了这个问题,下载页面的链接也已经更新。
    UPDATED 2019-01-09: An issue was discovered in the embeddable packages for Windows and updated download files have been provided for the Windows x86-64 embeddable zip file and the Windows x86 embeddable zip file and their GPG signatures. No other download was affected. See https://bugs.python.org/issue35596 for more information.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2799 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:31 · PVG 21:31 · LAX 06:31 · JFK 09:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.