playonlinux导入错误:没有名为wx的模块

2024-05-14 10:47:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我在运行playonlinux时收到以下错误:

neo@nixos ~> playonlinux
Looking for python... 2.7.17 - wxversion(s): 3.0-gtk2
Traceback (most recent call last):
  File "/nix/store/i0rqq9hval8ls0ny7172kzsrbjspi3r9-playonlinux-4.3.4/share/playonlinux/python/check_python.py", line 7, in <module>
    import wx
ImportError: No module named wx
failed tests
Looking for python2.7... 2.7.17 - wxversion(s): 3.0-gtk2
Traceback (most recent call last):
  File "/nix/store/i0rqq9hval8ls0ny7172kzsrbjspi3r9-playonlinux-4.3.4/share/playonlinux/python/check_python.py", line 7, in <module>
    import wx
ImportError: No module named wx
failed tests
Looking for python2.6... which: no python2.6 in (/nix/store/686iccqpafk5fcxrn73g8r2zvrdmdlpv-cabextract-1.9.1/bin:/nix/store/8f6kdvqkdb2g7pr8x68lm9hjbw29gf7k-python-2.7.17/bin:/nix/store/f7d91pkhcnnwjk2pc95b3nwyh6w4n5vs-gettext-0.20.1/bin:/nix/store/nxbravgpws70apfqh9rg96wr1iqi4dsg-glxinfo-8.4.0/bin:/nix/store/hn5d3z3v256jflyc8h8wzc2zkdmwhd2z-gnupg-2.2.20/bin:/nix/store/3gl3118wc5ydy58qazsj90nzrbiqbcz2-icoutils-0.32.3/bin:/nix/store/9f85gnwxw9mn22m4fxkp6kcgskhp0i91-imagemagick-6.9.10-71/bin:/nix/store/i8pw7ng29pbrzhbdx6jicgg8sc28z03f-netcat-gnu-0.7.1/bin:/nix/store/07d29r5i9fxcjqxfnsz1g2kkfi6rnygj-p7zip-16.02/bin:/nix/store/n9cnc1yc42lzpxlpsi9rn4mcg45ljfss-unzip-6.0/bin:/nix/store/3cs2g02k7fayk1j7h2pmc0a1dkshyp6j-wget-1.20.3/bin:/nix/store/rgmbblyjh280qins6rpjw9x21kvxa7w2-wine-5.0/bin:/nix/store/nzb84cdyp3ghnhb9g9kdvn6s7p0wgsxq-xdg-user-dirs-0.17/bin:/nix/store/gj78z8591b0906wixslwi5mxjhvj3awm-xterm-353/bin:/nix/store/a9qq4k77syx050193nyplcr2shin9ak1-which-2.21/bin:/nix/store/m4w15vy167h2l0iqdx6kwdhb6s0bh50w-curl-7.69.1-bin/bin:/nix/store/bwg96i486h2l1i179s98mwmxjmclih5d-jq-1.6-bin/bin:/run/wrappers/bin:/home/neo/.nix-profile/bin:/etc/profiles/per-user/neo/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin)

Looking for python2... 2.7.17 - wxversion(s): 3.0-gtk2
Traceback (most recent call last):
  File "/nix/store/i0rqq9hval8ls0ny7172kzsrbjspi3r9-playonlinux-4.3.4/share/playonlinux/python/check_python.py", line 7, in <module>
    import wx
ImportError: No module named wx
failed tests
Please install python before trying to run this program

我已经通过Nix安装了python27

我尝试了python27使用以下所有python wx包:wxPythonwxPython30wxPython_4_0,但没有一个能解决这个问题

有人也遇到了这个问题,并在IRC上询问:https://logs.nix.samueldr.com/nixos/2019-12-06

在使用nix包wxPython30时运行pythonimport wx会输出以下结果:

neo@nixos ~> python
Python 2.7.17 (default, Oct 19 2019, 18:58:51) 
[GCC 9.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
/nix/store/yp1p9isp0dlkja5msgd8rwcxhyi54p24-python-2.7.17-env/lib/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py:16629: UserWarning: wxPython/wxWidgets release number mismatch
  warnings.warn("wxPython/wxWidgets release number mismatch")
>>> 

此处报告了此问题,但没有任何解决方案:https://github.com/NixOS/nixpkgs/issues/81447


Tags: storeinpyimportforbinnixwxpython

热门问题