Access Keys:
Skip to content (Access Key - 0)

Q: Why do I get an "invalid Python installation" error on Debathena?

Answer

When running Python scripts on Debathena, you may receive the following error:

Traceback (most recent call last):
  File "/usr/athena/lib/python2.7/site.py", line 562, in <module>
    main()
  File "/usr/athena/lib/python2.7/site.py", line 544, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/athena/lib/python2.7/site.py", line 271, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/athena/lib/python2.7/site.py", line 246, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/athena/lib/python2.7/site.py", line 236, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/athena/lib/python2.7/sysconfig.py", line 577, in get_config_var
    return get_config_vars().get(name)
  File "/usr/athena/lib/python2.7/sysconfig.py", line 476, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/athena/lib/python2.7/sysconfig.py", line 355, in _init_posix
    raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/athena/local/include/python2.7/pyconfig.h (No such file or directory)

This occurs when invoking Python as /usr/athena/bin/python. This syntax has been deprecated since 2009, and should no longer be used. If you're calling python, please use /usr/bin/python. If you have a Python script that starts with:

#!/usr/athena/bin/python

please change it to

#!/usr/bin/python

You may also wish to use

#!/usr/bin/env python

which will run the first available python in the user's PATH.

IS&T Contributions

Documentation and information provided by IS&T staff members


Last Modified:

October 01, 2012

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
Labels:
python python Delete
debathena debathena Delete
ioerror ioerror Delete
invalid invalid Delete
installation installation Delete
c-debathena c-debathena Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
Feedback
This product/service is:
Easy to use
Average
Difficult to use

This article is:
Helpful
Inaccurate
Obsolete
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki