NameError: name 'pyver' is not defined

Steven D'Aprano steve at pearwood.info
Thu Mar 6 09:14:45 CET 2014


On Wed, 05 Mar 2014 22:53:46 -0800, שולמית מירל wrote:

> Hello,
> 
> We have python 2.6 & 3.2 installed on Sun solaris. When running py
> utility, we get the below error:
> 
> "NameError: global name 'execfile' is not defined"

Sounds like you are accidentally running a script intended for Python2.6 
under Python3.2 instead.

execfile is removed from 3.2, so you need to either edit the script to 
update it for 3.2, or you need to make sure you are running it under 2.6. 

Do you need help with that?



-- 
Steven



More information about the Python-list mailing list