透過 pip 或 easy_install 安裝 wxpython

透過 pip 或 easy_install 安裝 wxpython

wxpython我在使用 .安裝時遇到一些問題pip

這是我目前的輸出:

[myuserid]% sudo pip install wxpython
Downloading/unpacking wxpython
  Downloading wxPython2.8-win64-devel-2.8.11.0-msvc9x64.tar.bz2 (7.2Mb): 7.2Mb downloaded
  Running setup.py egg_info for package wxpython
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
    IOError: [Errno 2] No such file or directory: '/Users/myuserid/build/wxpython/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

IOError: [Errno 2] No such file or directory: '/Users/myuserid/build/wxpython/setup.py'

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/myuserid/.pip/pip.log
  • 我查看了 pip.log 文件,但它完全是空的。
  • 我嘗試透過安裝其他軟體包pip,沒有任何問題,所以我得出的結論是它pip本身正在工作。

我也嘗試過easy_install並得到以下結果:

[myuserid]% sudo easy_install wxpython
install_dir /Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6/site-packages/
Searching for wxpython
Reading http://pypi.python.org/simple/wxpython/
Reading http://wxPython.org/
Reading http://wxPython.org/download.php
Best match: wxPython src-2.8.11.0
Downloading http://downloads.sourceforge.net/wxpython/wxPython-src-2.8.11.0.tar.bz2
Processing wxPython-src-2.8.11.0.tar.bz2
error: Couldn't find a setup script in /tmp/easy_install-faZZOn/wxPython-src-2.8.11.0.tar.bz2
  • 這是否意味著和wxpython抓取的包裹出現了問題pipeasy_install
  • 除了從原始碼建置之外,還有其他方法可以調試或修補來自 或 的此類回應pipeasy_install

系統配置:

  • 作業系統 X 10.6
  • Enthought Python 發行版 Python v2.6,64 位

如果還需要其他信息,請告知,我會發布。

答案1

您似乎對此很陌生...歡迎!

Enthought 的人員為您建立了 EPD,但仍然沒有弄清楚如何可靠地為 64 位元 Python 建立 wxPython,請參閱此處:

http://www.enthought.com/products/epdfaq.php#mac

所以,你正在踏入困難的水域。你有考慮過走Qt路線嗎?所有 TraitsUI 支援的應用程式都可以輕鬆移植到 Qt。目前,我喜歡 Homebrew 與 EPD 互動的外觀(例如安裝 pyQt),但還沒有定論(還沒有這樣做)。我也會發布一個鏈接,但我目前是 1 分用戶......

另一種可能性是安裝 32 位元 EPD,其中已包含 wxPython。然後,您可以使用 32 位元 Python 進行視覺化,使用 64 位元 Python 進行嚴格的數字運算。

如果您堅持安裝 wxPython,請注意您將無法連結 Carbon 版本(它很穩定,但只有 32 位元)。相反,您需要使用 wxCocoa(實驗性的,64 位元)。至少,這是我的理解。 Enthought 的人沒有提到 wxCocoa,如果有破損我也不會感到驚訝。 TraitsUI 很複雜且難以調試,所以如果您走這條路,請預先警告!

答案2

wxPython 不包含setup.py文件,因此兩者easy_installpip無法以這種方式建構它。看一下wxPython 網站上的這些說明Enthought 網站上的這些說明了解如何建構 wxPython。不幸的是,我從未建立過它(我不使用 Python 的 Enthought 版本),所以我無法為您提供更多幫助。祝你好運!

答案3

我沒有使用EPD,但我也遇到了同樣的問題。結果是自製有一個安裝wxWidget和 的公式wxPython。它就像一個魅力。運行以下命令:

brew install --python wxmac

答案4

按照首頁說明:

確保您的 pip 版本至少為 6.0.8,setuptools 版本至少為 12.0.5。

Linux 的安裝要求如下自述文件中概述

安裝wxPython-Phoenix(Linux):

sudo pip install --upgrade \
    --trusted-host wxpython.org --pre -f \
    http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix

安裝wxPython-Phoenix(Windows,使用適當的腳本資料夾):

C:\python27\scripts\pip.exe install --upgrade \
    --trusted-host wxpython.org --pre -f \
    http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix

相關內容