如何在ubuntu18.04上安装wxpython2.8?

如何在ubuntu18.04上安装wxpython2.8?,python,ubuntu,wxpython,robotframework,Python,Ubuntu,Wxpython,Robotframework,我正试图在Ubuntu18.04系统上安装Wxpython2.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 pa

我正试图在Ubuntu18.04系统上安装Wxpython2.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

我在xterminal中使用了它,以便在synaptic中包含可靠的存储库

echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" | sudo tee /etc/apt/sources.list.d/wily-copies.list
之后,Synaptic packagemanager重新加载了存储库,然后我安装了它。
请确保取消选择存储库(在“设置”“存储库”“其他存储库”下),这样您就不会从这个旧存储库安装过时的软件。等待足够长的时间后,该过程已完成,我已安装了wxPython 4

  • sudo pip安装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

由于发行版和wx端口(GTK2或GTK3)有各种选项,因此文件不能全部位于同一文件夹中,以便于pip访问。这只是意味着您需要进一步深入查找要提供给pip的URL。例如,要获得Ubuntu18.04(和16.10、LinuxMint 18,可能还有其他版本)的GTK3 wxPython版本,您可以使用如下pip命令:

pip安装-U\ -f\ wxPython

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

只需打开终端并执行以下操作:

网址=

pip安装-U-f$URL wxPython


这对我有用

这可能会帮助您:

sudo echo“debhttp://archive.ubuntu.com/ubuntu trusty main universe“| sudo-tee/etc/apt/sources.list.d/wily-copies.list
更新源
sudo apt get安装python-wxgtk2.8

检查此线程是否有用,最好链接到该线程链接到的,这是一个非常旧版本的wxPython。为什么要安装它?这是wxPython“如何安装wxPython”问题中提到的版本,问题是关于wxPython 2.8而不是wxPython 4.0这与此问题的其他答案没有区别,而且是错误的-问题是关于安装特定版本(2.8),但您正在安装不同的版本。
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