easy_install pygame "linux / videodev.h: कोई ऐसी फ़ाइल या निर्देशिका" त्रुटि के कारण काम नहीं कर रहा है


9

स्थापित करने के लिए कोशिश कर रहा है pygameके माध्यम से easy_installउबंटू 12.10 और यह त्रुटियों में मुझे इस देता है:

Continuing With "setup.py"
warning: no files found matching 'readme.txt'
no previously-included directories found matching '*/CVS'
no previously-included directories found matching '*/*/CVS'
src/mixer.c: In function ‘chan_set_volume’:
src/mixer.c:660:9: warning: variable ‘result’ set but not used [-Wunused-but-set-  variable]
In file included from /usr/include/python2.7/Python.h:8:0,
             from src/scrap.h:22,
             from src/scrap.c:30:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
In file included from /usr/include/stdio.h:28:0,
             from src/scrap.c:24:
/usr/include/features.h:215:0: note: this is the location of the previous definition
In file included from src/scrap.c:59:0:
src/scrap_x11.c: In function ‘_get_data_as’:
src/scrap_x11.c:567:17: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
src/scrap.c: In function ‘initscrap’:
src/scrap.c:329:15: warning: variable ‘mod’ set but not used [-Wunused-but-set-variable]
In file included from src/_camera.c:36:0:
src/camera.h:42:32: fatal error: linux/videodev.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

और चल sudo ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.hदेता है:

Continuing With "setup.py"
warning: no files found matching 'readme.txt'
no previously-included directories found matching '*/CVS'
no previously-included directories found matching '*/*/CVS'
src/mixer.c: In function ‘chan_set_volume’:
src/mixer.c:660:9: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
In file included from /usr/include/python2.7/Python.h:8:0,
             from src/scrap.h:22,
             from src/scrap.c:30:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
In file included from /usr/include/stdio.h:28:0,
             from src/scrap.c:24:
/usr/include/features.h:215:0: note: this is the location of the previous definition
In file included from src/scrap.c:59:0:
src/scrap_x11.c: In function ‘_get_data_as’:
src/scrap_x11.c:567:17: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
src/scrap.c: In function ‘initscrap’:
src/scrap.c:329:15: warning: variable ‘mod’ set but not used [-Wunused-but-set-variable]
In file included from src/camera.h:20:0,
             from src/camera_v4l2.c:22:
src/pygame.h:678:14: warning: ‘PyGAME_C_API’ defined but not used [-Wunused-variable]
src/camera_v4l.c: In function ‘v4l_open_device’:
src/camera_v4l.c:29:29: error: storage size of ‘cap’ isn’t known
src/camera_v4l.c:30:23: error: storage size of ‘buf’ isn’t known
src/camera_v4l.c:51:24: error: ‘VIDIOCGCAP’ undeclared (first use in this function)
src/camera_v4l.c:51:24: note: each undeclared identifier is reported only once for      each function it appears in
src/camera_v4l.c:63:26: error: ‘VIDIOCGMBUF’ undeclared (first use in this function)
src/camera_v4l.c:30:23: warning: unused variable ‘buf’ [-Wunused-variable]
src/camera_v4l.c:29:29: warning: unused variable ‘cap’ [-Wunused-variable]
In file included from src/camera.h:20:0,
             from src/camera_v4l.c:20:
src/camera_v4l.c: At top level:
src/pygame.h:678:14: warning: ‘PyGAME_C_API’ defined but not used [-Wunused-variable]
error: Setup script exited with error: command 'gcc' failed with exit status 1

टैग "easy_install" और "pygame" को जोड़ने के लिए बहुत बुरा प्रतिनिधि ...
— JDW

जवाबों:


14

यह SO उत्तर सही सिमिलिंक प्रदान करता है। आपको अपने द्वारा /usr/include/linux/videodev.hबनाए गए को हटाने की आवश्यकता है - यह हेडर फ़ाइल के गलत संस्करण से लिंक कर रहा है।

sudo apt-get install libv4l-dev
सीडी / यूएसआर / शामिल / लिनक्स
sudo ln -s ../libv4l1-videodev.h videodev.h

3

Pygame कुछ निर्भरता की जरूरत है:

sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev   libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev

यदि आप उन्हें स्थापित नहीं करना चाहते हैं, तो पहले से तैयार पैकेज स्थापित करें:

sudo apt-get install python-pygame

2

क्या रिपॉजिटरी ( python-pygame ) में pygame का संस्करण बहुत पुराना है? यदि नहीं, तो आपको पहले स्थापित करने का प्रयास करना चाहिए।

अन्यथा, स्थापित करने के लिए अजगर-पाइप का उपयोग करें pygame:

sudo pip install pygame

क्यों easy_install पर पाइप का उपयोग करें?


क्या मैं virtualenv में पाइप और easy_install के बीच वैकल्पिक कर सकता हूं?
— JDW
हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.