【问题标题】:Pywin32 fails in embedded installation with Python 3.9Pywin32 在 Python 3.9 的嵌入式安装中失败
【发布时间】:2020-11-22 12:04:33
【问题描述】:

我正在尝试在 Python 3.9 x64 嵌入式环境(在 Windows 10 上)中安装 pywin32。安装成功,但导入失败。

重现步骤:


mkdir embed
unzip python-3.9.0-embed-amd64.zip embed
python -m pip install --target embed pywin32

cd embed
python
import win32api

【问题讨论】:

    标签: pywin32 python-embedding


    【解决方案1】:

    将库安装到不同的路径会有所帮助:

    
    mkdir embed
    unzip python-3.9.0-embed-amd64.zip embed
    python -m pip install --target embed\lib\site-packages pywin32
    
    cd embed
    python
    import site
    site.addsitedir("lib/site-packages")
    
    import win32api
    
    

    我有一个未解决的问题:https://github.com/mhammond/pywin32/issues/1618

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-14
      • 1970-01-01
      • 2021-02-07
      • 2021-02-07
      • 2016-08-02
      • 1970-01-01
      • 2021-02-03
      相关资源
      最近更新 更多