SCIENTIFIC-LINUX-USERS Archives

May 2011

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Brett Viren <[log in to unmask]>
Reply To:
Brett Viren <[log in to unmask]>
Date:
Mon, 23 May 2011 11:20:45 -0400
Content-Type:
multipart/signed
Parts/Attachments:
text/plain (1053 bytes) , application/pgp-signature (201 bytes)
Coert Metz <[log in to unmask]> writes:

> Hi all,
>
> I'm running a Python script which tries to import subprocess. This
> fails because it cannot import the select module.
> Does anybody know how to solve this?
>
> My PYTHONPATH is set to: /usr/lib64/python2.6/

Normally you should not need to set PYTHONPATH when using the system
Python.  Although, I can't see how setting it to that value could cause
harm.  

You can see what path Python is actually using via:

  python -c 'import sys; print sys.path'
  ['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4',
   '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
   '/usr/lib64/python2.4/lib-dynload',
   '/usr/lib64/python2.4/site-packages',
   '/usr/lib64/python2.4/site-packages/Numeric',
   '/usr/lib64/python2.4/site-packages/gtk-2.0',
   '/usr/lib/python2.4/site-packages']

And, here is my select module:

  python -c 'import select; print select'
  <module 'select' from '/usr/lib64/python2.4/lib-dynload/selectmodule.so'>

This is on SL5.3.  Maybe it helps you spot some inconsistency....

-Brett.


ATOM RSS1 RSS2