【问题标题】:How to install wxPython 2.8 on Ubuntu 18.04?如何在 Ubuntu 18.04 上安装 wxPython 2.8?
【发布时间】:2018-09-06 08:24:33
【问题描述】:

我正在尝试在 Ubuntu 18.04 系统上安装 wxPython 2.8。但它失败并出现以下错误:

$ sudo apt install python-wxgtk2.8
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-wxgtk2.8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-wxgtk2.8' has no installation candidate

让我知道如何解决上述错误,以便我可以安装 wxPython 2.8

【问题讨论】:

标签: python ubuntu wxpython robotframework


【解决方案1】:

由于发行版和 wx 端口(GTK2 或 GTK3)有多种选项,因此文件不能全部位于同一文件夹中,以便通过 pip 轻松访问。这只是意味着您需要更深入地了解要提供给 pip 的 URL。例如,要获得适用于 Ubuntu 18.04(和 16.10、LinuxMint 18 以及可能的其他版本)的 GTK3 wxPython 构建,您可以使用如下 pip 命令:

点安装 -U \ -fhttps://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04\ wxPython

当然你也可以自己下载 wheel 文件,然后使用 pip 安装文件的本地副本。

【讨论】:

    【解决方案2】:

    来自https://extras.wxpython.org/wxPython4/extras/

    只要打开你的终端然后做:

    URL=https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04

    pip install -U -f $URL wxPython

    这对我有用!

    【讨论】:

    • 这与此问题的其他答案没有什么不同,而且是错误的 - 问题是关于安装特定版本 (2.8) 但您正在安装不同的版本。
    【解决方案3】:

    这可能会对您有所帮助:

    sudo echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" | sudo tee /etc/apt/sources.list.d/wily-copies.list
    sudo apt-get update
    sudo apt-get install python-wxgtk2.8
    
    

    【讨论】:

      【解决方案4】:

      我在 xterminal 中使用它来在突触中包含可信赖的存储库。

      echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" | sudo tee /etc/apt/sources.list.d/wily-copies.list
      

      之后在 Synaptic-packagemanager 中重新加载了存储库,然后我安装了它。 请务必取消选择存储库(在“设置”“存储库”“附加存储库”下),这样您就不会从这个旧存储库安装过时的软件

      【讨论】:

        【解决方案5】:

        等待足够长的时间后,该过程已完成,我安装了 wxPython 4。

        运行

        sudo apt install make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev
        
        • sudo pip install wxpython
        • 稍等片刻即可安装

        完成后,您将看到此消息。

        目录 '/home/user-ii-6/.cache/pip/http' 或其父目录不归当前用户所有,缓存已被禁用。请检查该目录的权限和所有者。如果使用 sudo 执行 pip,您可能需要 sudo 的 -H 标志。

        The directory '/home/user-ii-6/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
        Collecting wxpython
          Downloading https://files.pythonhosted.org/packages/dd/31/bd55ab40e406a026a7fda0bb5eb61f466682544ae91ac26267c750f5e618/wxPython-4.0.3.tar.gz (68.5MB)
            100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 68.5MB 929kB/s 
        Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from wxpython) (1.11.0)
        Requirement already satisfied: PyPubSub in ./.local/lib/python2.7/site-packages (from wxpython) (4.0.0)
        Requirement already satisfied: typing in ./.local/lib/python2.7/site-packages (from PyPubSub->wxpython) (3.6.6)
        Installing collected packages: wxpython
          Running setup.py install for wxpython ... done
        Successfully installed wxpython-4.0.3
        

        【讨论】:

        • 问题是询问 wxPython 2.8 而不是 wxPython 4.0
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-06-26
        • 2020-01-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-12-01
        相关资源
        最近更新 更多