2to3 translation problem

Laura Creighton lac at openend.se
Sat Dec 12 12:08:30 EST 2015


In a message of Sat, 12 Dec 2015 16:31:54 +0000, Tony van der Hoff writes:
>On 12/12/15 15:09, Mark Lawrence wrote:
>> On 12/12/2015 14:42, Tony van der Hoff wrote:
>>> Debian Jessie, python 2.7; python 3.4
>>>
>>> I have an application, using pygame for graphics, that works fine under
>>> python2.7. I have run it through 2to3, but when running the result under
>>> python 3.4, I get the error :
>>>
>>> Traceback (most recent call last):
>>>    File "ppm304.py", line 9, in <module>
>>>      import pygame
>>> ImportError: No module named 'pygame'
>>>
>>> So, python 3.4 can't find the library, whilst python 2.7 can.
>>> How do I track down/fix the missing dependency.
>>
>> This isn't a 2to3 translation problem.  You've installed pygame under
>> 2.7 at some point, repeat the process for 3.4.  I've no idea how you'd
>> do that on Debian Jessie but on Windows it'd be "pip3.4 install pygame".
>>
>Thanks, Mark, for the pointer. I'm pretty sure I installed Pygame from 
>Debian's repository, via apt-get install python-pygame. I believe that 
>should be effective for any version of Python.

You are mistaken here.
python-pygame is only a python 2.7 pygame.

you want python3-pygame.
https://packages.debian.org/search?keywords=python3-pygame

Speaking as a debian user are going to have a _whole lot of this_.
If you don't know about apt-cache search <pkgname> 
let me recommend it to you.

This on debian unstable:

lac at smartwheels:~$  apt-cache search pygame
lightyears - single player real-time strategy game with steampunk sci-fi
psychopy - environment for creating psychology stimuli in Python
python-pygame - SDL bindings for games development in Python
python-pyglet - cross-platform windowing and multimedia library
pyntor - flexible and componentized presentation program
solarwolf - Collect the boxes and don't become mad
python-soya - high level 3D engine for Python
python-soya-dbg - high level 3D engine for Python - debug extension
python-soya-doc - high level 3D engine for Python
python3-pygame - SDL bindings for games development in Python (Python 3)

So, too many hits, alas, but it does tend to find such things.

Laura




More information about the Python-list mailing list