我尝试使用 来从终端安装 Mu-editor pip install mu-editor
。它下载了所有内容,但在安装结束时我收到此错误:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zh4eovyq/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zh4eovyq/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-zh4eovyq/pygame/pip-egg-info
cwd: /tmp/pip-install-zh4eovyq/pygame/
Complete output (12 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using UNIX configuration...
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
Hunting dependencies...
WARNING: "sdl-config" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is installed.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
答案1
这些命令对我有用。python3.6 上的虚拟环境
python3 -m venv mu
source ~/myvenev/mu/bin/activate
sudo pip3 install mu-editor
输出:
Successfully installed Pillow-8.1.2 PyQt5-sip-12.8.1 PyQtChart-5.14.0 appdirs-1.4.4 colorzero-1.1
cycler-0.10.0 gpiozero-1.5.1 guizero-1.1.1 ipykernel-5.5.0 jupyter-client-6.1.12
jupyter-core-4.7.1 kiwisolver-1.3.1 matplotlib-2.2.2 mu-editor-1.0.3
nudatus-0.0.5 numpy-1.19.5 pgzero-1.2 pigpio-1.78 pycodestyle-2.4.0
pyflakes-2.0.0 pygame-1.9.6 pyparsing-2.4.7 pyqt5-5.14.1 pyserial-3.4
pytz-2021.1 qscintilla-2.11.4 qtconsole-4.3.1 semver-2.13.0 tornado-6.1
(mu) masua@w2l-pc:~/0l2p0/Python/ide/mu$ mu-editor
Registrando en /home/masua/.cache/mu/log/mu.log
QApplication: invalid style override 'gtk' passed, ignoring it.
Available styles: Windows, Fusion
Gtk-Message: 09:39:53.450: GtkDialog mapped without a transient parent. This is discouraged.
Gtk-Message: 09:40:11.517: GtkDialog mapped without a transient parent. This is discouraged.
Gtk-Message: 09:47:19.852: GtkDialog mapped without a transient parent. This is discouraged.
QObject::killTimer: Timers cannot be stopped from another thread
QObject::~QObject: Timers cannot be stopped from another thread
QThread: Destroyed while thread is still running
Abortado (`core' generado)
(mu) masua@w2l-pc:~/0l2p0/Python/ide/mu$ [IPKernelApp] WARNING | Parent appears to have exited, shutting down.
^C
(mu) masua@w2l-pc:~/0l2p0/Python/ide/mu$
答案2
编辑:您似乎还缺少对 SDL-devel 的依赖;但第一个错误与 python3.8 有关,据我所知。
sudo apt install libsdl2-dev
可能还需要..
原始回复:看起来是Python 3.8 不兼容:您应该能够sudo apt install python3.7
像这样为 python37 创建一个虚拟环境:
$ virtualenv --python=`which python3.7` venv37
$ source venv37/bin/activate
(我没有测试过,但应该可以工作..基于我使用的回复这里)