![在 GalliumOS 上使用 pip 安裝 Kivy 時發生錯誤](https://rvso.com/image/112005/%E5%9C%A8%20GalliumOS%20%E4%B8%8A%E4%BD%BF%E7%94%A8%20pip%20%E5%AE%89%E8%A3%9D%20Kivy%20%E6%99%82%E7%99%BC%E7%94%9F%E9%8C%AF%E8%AA%A4.png)
我正在運行 GalliumOS 的筆記型電腦上安裝 Kivy,當我這樣做時
pip install kivy
它給了我所有這些東西。我是 Linux 和 Python 的新手,所以我不知道這到底是什麼意思。
Collecting kivy
Using cached Kivy-1.10.0.tar.gz
Complete output from command python setup.py egg_info:
Using distutils
Detected Cython version 0.23.4
Using this graphics system: OpenGL
WARNING: A problem occurred while running pkg-config --libs --cflags gstreamer-1.0 (code 1)
Package gstreamer-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gstreamer-1.0' found
WARNING: A problem occurred while running pkg-config --libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer (code 1)
Package sdl2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sdl2' found
Package SDL2_ttf was not found in the pkg-config search path.
Perhaps you should add the directory containing `SDL2_ttf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'SDL2_ttf' found
Package SDL2_image was not found in the pkg-config search path.
Perhaps you should add the directory containing `SDL2_image.pc'
to the PKG_CONFIG_PATH environment variable
No package 'SDL2_image' found
Package SDL2_mixer was not found in the pkg-config search path.
Perhaps you should add the directory containing `SDL2_mixer.pc'
to the PKG_CONFIG_PATH environment variable
No package 'SDL2_mixer' found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-4Vxs2J/kivy/setup.py", line 934, in <module>
version=get_version(),
File "/tmp/pip-build-4Vxs2J/kivy/setup.py", line 47, in get_version
['git', 'rev-parse', 'HEAD']
File "/usr/lib/python2.7/subprocess.py", line 567, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4Vxs2J/kivy/
我要做的就是安裝 Kivy。我確實安裝了 pip,因為我過去使用過 pygame。
有什麼簡單的方法可以解決這個問題嗎?我不太熱衷於深入研究這些文件,但如果必須的話我會這樣做,這樣才能發揮作用。
我安裝了 Python 2.7 和 3.5。
答案1
沒有軟體包 {gstreamer-1.0.pc、sdl2.pc、SDL2_ttf.pc、SDL2_image.pc、SDL2_mixer.pc}
IE /usr/lib/pkgconfig/[files].pc
。
sudo apt-get install apt-file
: 然後你可以使用apt-file search [file.pc]
列出[packages]-devKivy 需要。 (可能像 libgstreamer0.10-dev、libsdl2-dev 等)