error messages unclear

Paul G. pgarceau at attbi.com
Tue Dec 3 20:05:39 EST 2002


Hi folks,

	Keep getting this, and am still not exactly sure how to decode it.

	
> AttributeError: 'module' object has no attribute 'path'

	A few questions:

		Is there a list of what each Error means somewhere?

		eg.

		AttributeError:
		
			This usually means that an attribute somewhere has an error. (generic)
			AttributeError:  'module' has no attribute 'path' means...(?)

	Ok, can grok this:

		A python 'module' (name unknown) is missing a 'path' reference of some sort ('path' 
here could be an attribute, an environment string or something else entirely)..

		"path reference" is too generic.  What 'kind" of "path reference" are we actually 
talking about here?

	Also, in the case above, it fails on setup.py.

	again, that does not tell me much other than this:  somehow or another (working from 
the error given) a 'path' of some sort has not been assigned.  There is no reference to which 
"path", or even to the what the "existing 'path' " looks like.  This missing "attribute 'path' " is 
the cause of the problem.  Unfortunately, there is not a definition as to what is or is not a 
"legal" attribute called 'path'. 

	Finally, the auto-traceback adds this:  

		  File ".../python-2.2.1/Lib/distutils/sysconfig.py", line 23, in ?
    PREFIX = os.path.normpath(sys.prefix)

	There is no definition, at least none that I am aware of, as to what or how 
os.path.normpath(sys.prefix) is actually built or defined.  I say that after the fact that I tracked 
for hours through the source code trying to find out exactly what and how 
os.path.normpath(sys.prefix) is in fact defined.

	Nor is there any way, given the error report "AttributeError:...", to output what the actual 
value of os.path.normpath(sys.prefix) in fact looks like.

	Yes, the documentation talks about os.path.normpath(sys.prefix), but the documentation 
I read did not really define it as anything specific aside from a variable of some sort.  That 
indicates that there is no constant definition of os.path.normpath(sys.prefix).

	Here is the complete text of the error:

	$ make
gcc   -o python.exe \
                Modules/python.o \
                libpython2.2.a    -lm  
case $MAKEFLAGS in \
*-s*) CC='gcc' LDSHARED='ld' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' 
./python.exe -E ./setup.py -q build;; \
*) CC='gcc' LDSHARED='ld' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' 
./python.exe -E ./setup.py build;; \
esac
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "./setup.py", line 7, in ?
    from distutils import sysconfig
  File "\msys\1.0\src\python-2.2.1/Lib/distutils/sysconfig.py", line 23, in ?
    PREFIX = os.path.normpath(sys.prefix)
AttributeError: 'module' object has no attribute 'path'
make: *** [sharedmods] Error 1

	It is also clear from the error report above that the error occurs when sharedmods is the 
target.  Beyond that, however, there is no information as to what is really going on here.

	AttributeError: 'module' object has no attribute 'path'

	really is saying nothing that might help in terms of what the actual cause of the error in 
fact "is".

	os.path.normpath(sys.prefix) is not verbalized, nor is it, apparently, defined to be 
constant for any system.

	I am not using Cygwin.

	Paul G.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20021203/f01dcb88/attachment.html>


More information about the Python-list mailing list