如何在Python 3.4.3中安裝pyinstaller

如何在Python 3.4.3中安裝pyinstaller

我正在嘗試在 Python 3.4.3 中安裝 pyinstaller:

C:\Python34\Scripts>pip3 install pyinstaller

Collecting pyinstaller
  Using cached PyInstaller-3.3.1.tar.gz
Requirement already satisfied: setuptools in c:\python34\lib\site-packages (from pyinstaller)
Collecting pefile>=2017.8.1 (from pyinstaller)
  Using cached pefile-2017.11.5.tar.gz
Collecting macholib>=1.8 (from pyinstaller)
  Using cached macholib-1.9-py2.py3-none-any.whl
Collecting future (from pyinstaller)
  Using cached future-0.16.0.tar.gz
Collecting pypiwin32 (from pyinstaller)
  Using cached pypiwin32-223-py3-none-any.whl
Collecting altgraph>=0.15 (from macholib>=1.8->pyinstaller)
  Using cached altgraph-0.15-py2.py3-none-any.whl
Collecting pywin32>=223 (from pypiwin32->pyinstaller)
  Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32->pyinstaller) (from versions: )
No matching distribution found for pywin32>=223 (from pypiwin32->pyinstaller)

然後我嘗試安裝 pypiwin32:

C:\Python34\Scripts>pip3 install pypiwin32

Collecting pypiwin32
  Using cached pypiwin32-223-py3-none-any.whl
Collecting pywin32>=223 (from pypiwin32)
  Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: )
No matching distribution found for pywin32>=223 (from pypiwin32)

我可以在Python3.4.3中安裝這個嗎?我需要這個版本,因為它是支援XP安裝的最後一個版本。

答案1

我需要這個版本,因為它是支援XP安裝的最後一個版本。

順便說一句,關於 Python 3.4.x 的二進位發行版,您可能需要考慮Python 3.4.4。我相信它應該仍然與 Windows XP 相容,並且顯然是更好的一個版本。 =)

我可以在Python 3.4.3中安裝[PyInstaller]嗎?

經過一些(非常)輕微的測試後,這似乎是可能的。

您遇到的問題是目前版本pywin32pypiwin32皮伊似乎沒有支援 Python 3.4.x 的版本。

為了pywin32,最新版本(版本223)僅提供Python 2.7、3.5、3.6和3.7(目前處於預發布階段)的輪子。pypiwin32,是重新打包的版本pywin32,目前requires pywin32 (>=223),(如前所述)目前沒有針對 3.4.x 的明顯選項。

也就是說,假設您沒有遇到其他問題,可以手動將這些軟體包的舊版本安裝到 3.4.x 中。


手動安裝pypiwin32/pywin32

請注意:

  • 下面列出的選項是互斥的 - 它們都安裝一個版本pywin32。選一個。

  • 手動安裝意味著您必須自行下載正確的軟體包。使用pip可能仍然涉及,也可能不涉及。如果是,則僅在您先下載正確的檔案後才能使用。

選項 1 - pypiwin32(較舊)

pypiwin32 版本 219仍然可以在 PyPI 上使用,並且有 Python 3.4 的輪子。 64 位輪和py安裝程式3.0(也是手動安裝的)對我來說沒有問題。

安裝pypiwin32 版本 219:

  • 從上面連結的 PyPI 頁面下載與您的 Python 發行版相符的正確的輪子( 或pypiwin32-219-cp34-none-win32.whl) 。pypiwin32-219-cp34-none-win_amd64.whl

  • 打開命令視窗並導航到儲存方向盤的位置。

  • 假設 Python 已在命令列中註冊,請鍵入類似以下內容的內容:

    python -m pip install name-of-the-downloaded.whl
    

選項 2 - pywin32(較新)

pywin32維護 GitHub 儲存庫獨立於 PyPI,目前有發布為了pywin32 版本 221在 Python 3.4 上(版本 222 和 223 仍然沒有與 3.4 相容的版本)。

py安裝程式3.3.1(目前可透過 取得的最新版本pip)似乎可以在該版本上正常工作pywin32

安裝pywin32 版本 221:

  • 從上面連結的發布頁面下載.exe與您的 Python 發行版(或 )相符的pywin32-221.win32-py3.4.exe正確安裝程式 ( )。pywin32-221.win-amd64-py3.4.exe

  • 導航到儲存安裝程式的位置。

  • 雙擊安裝程式並按照螢幕上的指示進行操作。確保在第二個安裝視窗中標識了 Python 安裝的正確版本和位置資訊:

pywin32 安裝程序


測試筆記

  • 安裝是在 Windows 7 上完成的(遺憾的是,我目前沒有可用的 XP 虛擬機器)。

  • 測試非常輕鬆(沒有安裝錯誤,PyInstaller 正確打包了一個小測試腳本)。

  • PyInstaller 在 PyPI 上有多個可用版本。我嘗試將發布日期與兩者之間的發布日期稍微匹配pypiwin32/pywin32py安裝程式版本可能的兼容性,但我沒有測試上面列出的組合之外的任何組合。


相關內容