errors encountered while installing Python -- please advise

Ryan Schmidt ryandesign at
Sat Sep 20 12:34:09 PDT 2008

On Sep 20, 2008, at 4:26 AM, Richard Rucker wrote:

> On Sep 19, 2008, at 6:44 PM, Ryan Schmidt wrote:
>> On Sep 19, 2008, at 5:03 PM, Bryan Blackburn wrote:
>>> If you use py25-serial instead, then that 'sudo ln -s ...' above  
>>> would not
>>> be needed (and in theory, could be a bad idea though sounds like  
>>> it works
>>> for the serial module).
>>> Both py-serial and py25-serial install the serial module, but the  
>>> former
>>> installs it with python 2.4 (hence the python2.4 in that path  
>>> above), and
>>> the latter for python 2.5.  Since all of the other modules listed  
>>> are for
>>> 2.5, using py25-serial should be much simpler as then you won't  
>>> have to
>>> build/install both 2.4 and 2.5 of python.  Especially if you'll  
>>> just be
>>> linking the one module from 2.4 into 2.5.
>> Right.
>> Richard, could you please submit feedback to the authors of the  
>> document you read, telling them to update their instructions to  
>> use py25-serial instead of py-serial? You can refer them back to  
>> Bryan's message with this URL if necessary:
>> September/011555.html
> Ryan,
> Feedback sent --  see your copy of the email set to the developer,  
> Dan Smith.

Great, thanks. Hopefully that'll make things simpler for someone else  
reading the document later.

> Now, can someone please advise me as to what I need to do to  
> recover from yesterday's failed installation, including the fix for  
> the "py-serial" problem. Either that, or tell me how to undo what  
> was done yesterday.
> I am way over my head here, but am willing to learn to get this  
> done, given guidance.
> Briefly, the failed installation that started this way:
>> <me>$ sudo port install py25-gtk py-serial py25-xml py25-hashlib
> and ended this way:
>> Error: The following dependencies failed to build: py25-cairo py25-
>> numpy py25-hashlib py25-gobject libxslt
>> Error: Status 1 encountered during processing.
> And earlier in the log before the error occurred, it says this:
>> To fully complete your installation and make python 2.5 the default,
>> please run
>> 	sudo port install python_select
>> 	sudo python_select python25

Right, the python25 port is explaining how you can get python version  
2.5 to be the default python on your box.

> Ignoring the reported error, I ran those two sudo commands with  
> these results:
>> --->  Fetching python_select
>> --->  Attempting to fetch select-0.1.tar.gz from http:// 
>> --->  Verifying checksum(s) for python_select
>> --->  Extracting python_select
>> --->  Configuring python_select
>> --->  Building python_select with target all
>> --->  Staging python_select into destroot
>> --->  Installing python_select 0.1_4+darwin_9
>> --->  Activating python_select 0.1_4+darwin_9
>> --->  Cleaning python_select
>> <me>$ sudo python_select python25
>> Selecting version "python25" for python

Ok great, so now you've made python 2.5 the default python. Now you  
can just type "python" to run python 2.5. (Prior to this command you  
would have had to type "python2.5".)

> One problem is:
>  I don't know what state this leaves my installation in, and I am  
> not knowledgeable enough to know how to find out.  Please advise.  
> For a more complete version of the installation log, see below.
> Dick Rucker, KM4ML
> Prior to where the error occurred, a repeating pattern of reports  
> in the log:  "Fetching through Activating and Cleaning"  indicates  
> that a lot of stuff was installed without apparent error.
> The following picks up where the trouble began:
>> ----------------------------------------
>> To fully complete your installation and make python 2.5 the default,
>> please run
>> 	sudo port install python_select
>> 	sudo python_select python25
>> --->  Cleaning python25
>> --->  Fetching py25-hashlib
>> --->  Attempting to fetch Python-2.5.2.tar.bz2 from http:// 
>> --->  Verifying checksum(s) for py25-hashlib
>> --->  Extracting py25-hashlib
>> --->  Configuring py25-hashlib
>> --->  Building py25-hashlib with target build
>> Error: Target returned: shell command " cd "/opt/
>> local/var/macports/build/
>> _opt_local_var_macports_sources_rsync
>> .macports.org_release_ports_python_py25-hashlib/work/Python-2.5.2/
>> Modules" && /opt/local/bin/python2.5 build " returned  
>> error 1
>> Command output: running build
>> running build_ext
>> building '_hashlib' extension
>> creating build
>> creating build/temp.macosx-10.3-i386-2.5
>> -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/ 
>> include
>> -I/opt/local/Library/Frameworks/Python.framework/Versions/2.5/ 
>> include/
>> python2.5 -c _hashopenssl.c -o build/temp.macosx-10.3-i386-2.5/
>> _hashopenssl.o
>> unable to execute -DNDEBUG: No such file or directory
>> error: command '-DNDEBUG' failed with exit status 1

This is the real error. As Bryan said [1], this is a bug Apple  
introduced in the version of Tcl they ship with Leopard. It affects a  
seemingly random sampling of ports. It is described on the  
LeopardProblems page [2]. It will be fixed in the next version of  
MacPorts after 1.6.0. Until that is released, the workaround is  
always to clean the work area of the failing port and simply try  
again. So in your case, py25-hashlib is failing (since the error  
occurred after the line "--->  Building py25-hashlib"), so you clean it:

sudo port clean --work py25-hashlib

And then repeat whatever you were doing in the first place, e.g.:

sudo port install py25-gtk py25-serial py25-xml py25-hashlib

Note: just use py25-serial instead of py-serial as the document had  
recommended, since you want to use it with python 2.5, not 2.4. (py-*  
ports are for python 2.4; py25-* ports are for python 2.5.) And omit  
the step about creating the symlink because that's now not necessary,  
since installing py25-serial already puts the serial module in the  
right place for python 2.5 to find.



More information about the macports-users mailing list