gpt4 book ai didi

ubuntu - 在 Ubuntu 18.04 上的 Python 3.7 上安装 wxPython

转载 作者:行者123 更新时间:2023-12-04 18:44:03 26 4
gpt4 key购买 nike

我在 Python 3.7.5 上安装 wxPython4 时遇到问题

$ pip3 install wxpython
Defaulting to user installation because normal site-packages is not writeable
Collecting wxpython
Using cached wxPython-4.1.0.tar.gz (65.8 MB)
Requirement already satisfied: pillow in ./.local/lib/python3.7/site-packages (from wxpython) (7.1.2)
Requirement already satisfied: six in ./.local/lib/python3.7/site-packages (from wxpython) (1.14.0)
Requirement already satisfied: numpy in ./.local/lib/python3.7/site-packages (from wxpython) (1.18.4)
Building wheels for collected packages: wxpython
Building wheel for wxpython (setup.py) ... \


....

File "/usr/lib/python3/dist-packages/Cython/Compiler/ExprNodes.py", line 2844
await = None
^
SyntaxError: invalid syntax

我不确定是什么问题。在 Python3 中所做的更改,所以 await 现在是一个特殊的关键字。它是否以某种方式将 Python2 与 Python3 混淆了?

如果我按照这里的建议做

https://askubuntu.com/questions/1073145/how-to-install-wxpython-4-ubuntu-18-04

First I found it by:

sudo apt search python3-wx I installed the latest wxpython with:

sudo apt-get install python3-wxgtk4.0 python3-wxgtk-webview4.0 python3-wxgtk-media4.0 You may also try synaptic to install it that way if you prefer.



我得到一个不同的错误
    In [1]: import wx                                                                                                                                                                                                                 
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-03faa7660341> in <module>
----> 1 import wx

/usr/lib/python3/dist-packages/wx/__init__.py in <module>
15 # Import all items from the core wxPython module so they appear in the wx
16 # package namespace.
---> 17 from wx.core import *
18
19

/usr/lib/python3/dist-packages/wx/core.py in <module>
10 """
11
---> 12 from ._core import *
13
14 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

ModuleNotFoundError: No module named 'wx._core'

这可能是由于缺少依赖项。

最佳答案

我认为这是由于 Cython 0.26 和 Python 3.7 之间的不兼容问题。请参阅有关 SerpentAI 的答案.

关于ubuntu - 在 Ubuntu 18.04 上的 Python 3.7 上安装 wxPython,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61879561/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com