Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'received:209.85.223': 0.03; 'syntax': 0.03; 'importing': 0.04; 'interpreter': 0.04; 'subject:Python': 0.05; 'bug.': 0.07; 'setup.py': 0.07; 'try:': 0.07; 'undefined': 0.07; 'unrecognized': 0.07; 'subject:help': 0.07; 'python': 0.09; '2to3': 0.09; 'naturally': 0.09; 'porting': 0.09; 'retry': 0.09; 'valueerror': 0.09; 'cc:addr:python-list': 0.10; '2.7': 0.13; '"python': 0.16; 'command,': 0.16; 'eclipse': 0.16; 'fine.': 0.16; 'folder.': 0.16; 'install"': 0.16; 'numpy': 0.16; 'oct': 0.16; 'png': 0.16; 'subject:3.3': 0.16; 'try/except': 0.16; 'uint16': 0.16; 'valueerror,': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'fix': 0.17; 'exists': 0.17; 'skip': 0.17; 'subject:need': 0.17; 'appears': 0.18; 'code,': 0.18; 'windows': 0.19; 'variable': 0.20; 'all,': 0.21; 'trying': 0.21; 'import': 0.21; 'error.': 0.21; 'java': 0.21; 'not,': 0.21; 'supposed': 0.21; '3.x': 0.22; 'assuming': 0.22; 'recognize': 0.22; 'installation': 0.23; 'cc:2**0': 0.23; 'errors': 0.23; 'needed.': 0.23; "haven't": 0.23; 'installed': 0.23; 'seems': 0.23; '(this': 0.24; 'somewhere': 0.24; 'cc:no real name:2**0': 0.24; 'second': 0.24; 'command': 0.24; 'tried': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'skip:[ 10': 0.26; 'am,': 0.27; 'updating': 0.27; 'message- id:@mail.gmail.com': 0.27; 'lines': 0.28; 'noticed': 0.28; 'run': 0.28; 'attempted': 0.29; 'python2.7': 0.29; 'case,': 0.29; 'no,': 0.29; 'this.': 0.29; "i'm": 0.29; 'install': 0.29; 'that.': 0.30; 'error': 0.30; 'point': 0.31; 'file': 0.32; 'not.': 0.32; 'could': 0.32; 'adjust': 0.33; 'idle': 0.33; 'version': 0.34; "can't": 0.34; 'received:google.com': 0.34; 'project': 0.34; 'clear': 0.35; 'needed': 0.35; 'mine': 0.35; 'path': 0.35; 'process,': 0.35; 'too.': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'except': 0.36; 'but': 0.36; 'success.': 0.36; "didn't": 0.36; 'test': 0.36; 'should': 0.36; 'too': 0.36; 'problems': 0.36; 'available.': 0.37; 'execute': 0.37; 'reported': 0.37; 'does': 0.37; 'option': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'sure': 0.38; 'several': 0.39; 'short': 0.39; 'little': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'you.': 0.61; "you've": 0.61; 'first': 0.61; 'strange': 0.62; 'more': 0.63; 'here': 0.65; 'decided': 0.65; 'gave': 0.65; 'learned': 0.65; 'skip:c 50': 0.66; 'prompt': 0.78; 'construct': 0.84; 'disappear': 0.84; 'box)': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=a3n4qhqgSUEsiz6V/hAq5GAYvmNu8XDZO46bqG5kzJM=; b=sfvJ4EwsUENCswyQ5yuDWzyiMZAI1sSGFOKmD6IVJI7JH2MgGLKSQMK/umKnnVzc8C o+Ek9/MK3wc3JAhWCOAy0cWxPf2UCOiTm/+3dFzOakUJx8V3BhUMO8bxuf6A1dfkkLzP VyZcoUyAHJ4slE3Q42SRimRiLWECsuxAynV3wFalhzKDqjxV7Dc43t8UwwHE9PA9xj3U RezgJlYInp5xKKAnCpXvSF7G4Rk1sEANMNObFc06fcEINiPx126IFRnmOcmIx6jJp/zA Dh+h+W8QRoRrxOeqPWhxVrvnIRUun8QRRQELKddmcwHk+l/0a9S6d+94DSuH5Om4J26S xNsA== MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 29 Oct 2012 11:08:10 -0400 Subject: Re: I need help installing pypng in Python 3.3 From: David Robinow To: icgwh@tagyourself.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 84 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351523294 news.xs4all.nl 6870 [2001:888:2000:d::a6]:47142 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32381 On Mon, Oct 29, 2012 at 8:23 AM, wrote: > Hello all, > > I am very new to python. I am currently porting a little project of mine = from java to python and I need to be able to construct and write png images= . I naturally turned myself toward pypng to accomplish this. > > I learned from the net that pypng 0.0.13 is supposed to work in Python 3.= x when run through '2to3'. However, in my case, it apparently does not. > You haven't shown that. > I ran into various problems when trying to install it, some of them I cou= ld fix myself. First I attempted to install pip but I couldn't get Windows = to recognize pip as an internal command as the prompt informs me. No, it's not an internal command, but you don't need that. I'm assuming your python is installed under C:\Python33. If not, adjust as needed. Try: C:\Python33\Scripts\pip install pypng [You didn't say what you did to install pip so I don't know if pip.exe actually exists in C:\Python33\Scripts] > Then I tried to directly run "setup.py install" from the pypng folder. It= didn't work as I got a syntax error. I noticed that in the beginning of th= e installation process, the following warning was displayed: "conf[use_2to3= =3D true] unrecognized configuration option" The following works for me: C:\Python33\python setup.py install > > At that point I was already pretty pissed but I managed to make the warni= ng disappear by updating (installing?) distribute. After that there are no = more errors during the installation process and everything seems to work fi= ne. (This seems still strange to me as 2to3 was present in Tools/Script out= of the box) It's not clear what you did here. setup.py should run 2to3 for you. What command did you use to successfully? install it? > I use pydev in Eclipse and pydev reports several error in png.py anytime = I want to import or use it. When trying to import from IDLE I get: > > except ValueError, e: > ^ > Syntax error, line 1863 It's clear that the install process didn't run 2to3. > that paricular error I was able to fix by changing it to "except ValueErr= or as e:" but I don't understand why 2to3 didn't do it automatically. 2to3 does do it automatically. > There are several more errors reported by pydev, here are a few: > > line 1368 : "raise ValueError('Chunk %s too short for checksum.', tag)" > Undefined variable: tag Looking at the code, this appears to be a bug. > > line 2736 : "rows =3D [map(numpy.uint16, range(0,0x10000,0x5555))]" > Undefined variable from import: uint16 > > The second one made me suspect I needed to install numpy too. As there ar= e no installers for numpy aimed toward Python3.3. A few lines above there's a try/except for importing numpy. It should skip this test if numpy is not available. I'm not sure how you were able to execute that line [unless you've got a stray numpy.py file somewhere somewhere] > I decided to install Python2.7 and retry the whole process. Unfortunately= I didn't get much more success. I get the exact same errors in pydev when = using the 2.7 version of the interpreter and I cannot install numpy either = because when I run the .exe file aimed toward Python 2.7 i get the error me= ssage: > > "Python version 2.7 required, which was not found in the registry" > > I then have the option to manually enter the path to Python 2.7 but the t= extform is greyed out and I can't type in anything. > Do you have the file c:\Python33\Lib\site-packages\pypng-0.0.13-py3.3.egg = ? If not, you have not successfully installed pypng. Please try one of the methods I gave above.