jsk-ros-pkg / jsk_control

jsk control ros packages
http://github.com/jsk-ros-pkg/jsk_control
13 stars 51 forks source link

Add trouble shooting for README.md of MIDI device usage #760

Closed ykawamura96 closed 3 years ago

ykawamura96 commented 3 years ago

Add trouble shooting to avoid pygame import error. This doesn't seems to be solved in original pygame repo. Ref: https://github.com/pygame/pygame/issues/463

k-okada commented 3 years ago

how can I reproduce this problem? do I need MIDI device?

k-okada@p51s:/usr/lib/python2.7/dist-packages/pygame$ python --version
Python 2.7.17
k-okada@p51s:/usr/lib/python2.7/dist-packages/pygame$ apt show python-pygame
Package: python-pygame
Version: 1.9.1release+dfsg-10build1
Priority: optional
Section: universe/python
Source: pygame
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 6,217 kB
Depends: fonts-freefont-ttf, python-numpy (>= 1:1.10.0~b1), python-numpy-abi9, python (>= 2.7), python (<< 2.8), libc6 (>= 2.14), libjpeg8 (>= 8c), libpng16-16 (>= 1.6.2-1), libportmidi0, libsdl-image1.2 (>= 1.2.10), libsdl-mixer1.2, libsdl-ttf2.0-0, libsdl1.2debian (>= 1.2.11), libsmpeg0, libx11-6
Suggests: timidity
Homepage: http://www.pygame.org/
Download-Size: 1,662 kB
APT-Manual-Installed: yes
APT-Sources: http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Description: SDL bindings for games development in Python
 A multimedia development kit for Python. Pygame provides modules for you
 to access the video display, play sounds, track time, read the mouse and
 joystick, control the CD player, render true type fonts and more. It does
 this using mainly the cross-platform SDL library, a lightweight wrapper
 to OS-specific APIs.
 .
 This package also includes Pygame's API documentation and examples.

k-okada@p51s:/usr/lib/python2.7/dist-packages/pygame$ python -c "import pygame.midi; pygame.midi.init()"
k-okada@p51s:/usr/lib/python2.7/dist-packages/pygame$
ykawamura96 commented 3 years ago

@k-okada I had my pip installed pygame and the version was pygame-2.0.1. If I remove and reinstall pygame by pip uninstall pygame && sudo apt-get install python-pygame, then import error disappeared.

So pip was the cause in this case....

Also I check with/without MIDI device by using python-pygame from apt, so having MIDI device should not matter.

ykawamura@goat:~$ pip show pygame
Name: pygame
Version: 2.0.1
Summary: Python Game Development
Home-page: https://www.pygame.org
Author: A community project.
Author-email: pygame@pygame.org
License: LGPL
Location: /home/ykawamura/.local/lib/python2.7/site-packages
Requires: 
ykawamura@goat:~$ apt show python-pygame
Package: python-pygame
Version: 1.9.1release+dfsg-10build1
Priority: optional
Section: universe/python
Source: pygame
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 6,217 kB
Depends: fonts-freefont-ttf, python-numpy (>= 1:1.10.0~b1), python-numpy-abi9, python (>= 2.7), python (<< 2.8), libc6 (>= 2.14), libjpeg8 (>= 8c), libpng16-16 (>= 1.6.2-1), libportmidi0, libsdl-image1.2 (>= 1.2.10), libsdl-mixer1.2, libsdl-ttf2.0-0, libsdl1.2debian (>= 1.2.11), libsmpeg0, libx11-6
Suggests: timidity
Homepage: http://www.pygame.org/
Download-Size: 1,662 kB
APT-Manual-Installed: yes
APT-Sources: http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Description: SDL bindings for games development in Python
 A multimedia development kit for Python. Pygame provides modules for you
 to access the video display, play sounds, track time, read the mouse and
 joystick, control the CD player, render true type fonts and more. It does
 this using mainly the cross-platform SDL library, a lightweight wrapper
 to OS-specific APIs.
 .
 This package also includes Pygame's API documentation and examples.

ykawamura@goat:~$ 
k-okada commented 3 years ago

I see, so proposed workaround is to remove pip, not run sudo ln -s

2021年4月14日(水) 1:33 Yoichiro Kawamura @.***>:

@k-okada https://github.com/k-okada I had my pip installed pygame and the version was pygame-2.0.1. If I remove and reinstall pygame by pip uninstall pygame && sudo apt-get install python-pygame, then import error disappeared.

So pip was the cause in this case....

Also I check with/without MIDI device by using python-pygame from apt, so having MIDI device should not matter.

@.:~$ pip show pygame Name: pygame Version: 2.0.1 Summary: Python Game Development Home-page: https://www.pygame.org Author: A community project. Author-email: @. License: LGPL Location: /home/ykawamura/.local/lib/python2.7/site-packages Requires: @.:~$ apt show python-pygame Package: python-pygame Version: 1.9.1release+dfsg-10build1 Priority: optional Section: universe/python Source: pygame Origin: Ubuntu Maintainer: Ubuntu Developers @.> Original-Maintainer: Debian Python Modules Team @.***> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size https://bugs.launchpad.net/ubuntu/+filebugInstalled-Size: 6,217 kB Depends: fonts-freefont-ttf, python-numpy (>= 1:1.10.0~b1), python-numpy-abi9, python (>= 2.7), python (<< 2.8), libc6 (>= 2.14), libjpeg8 (>= 8c), libpng16-16 (>= 1.6.2-1), libportmidi0, libsdl-image1.2 (>= 1.2.10), libsdl-mixer1.2, libsdl-ttf2.0-0, libsdl1.2debian (>= 1.2.11), libsmpeg0, libx11-6 Suggests: timidity Homepage: http://www.pygame.org/ Download-Size http://www.pygame.org/Download-Size: 1,662 kB APT-Manual-Installed: yes APT-Sources: http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages Description: SDL bindings for games development in Python A multimedia development kit for Python. Pygame provides modules for you to access the video display, play sounds, track time, read the mouse and joystick, control the CD player, render true type fonts and more. It does this using mainly the cross-platform SDL library, a lightweight wrapper to OS-specific APIs. . This package also includes Pygame's API documentation and examples.

@.***:~$

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jsk-ros-pkg/jsk_control/pull/760#issuecomment-818875616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADYNXACLEN3EB6SAFABLDTTIRW3ZANCNFSM423E7FJQ .

--

◉ Kei Okada