I don't know why you are getting different results, but I do know that you aren't supposed to put the whole psyco-1.3 folder inside site-packages. Just put the psyco folder (from inside psyco-1.3) into site-packages.

Also the os.chdir() doesn't have any effect on import.

You could compare sys.path in the two different environments and see what is different between them.
>>> import sys
>>> sys.path
['', 'C:\\Python24\\python24.zip', 'D:\\Projects', 'C:\\Python24\\DLLs', 'C:\\Python24\\lib', 'C:\\Python24\\lib\\plat-win', 'C:\\Python24\\lib\\lib-t
k', 'C:\\Python24', 'C:\\Python24\\lib\\site-packages', 'C:\\Python24\\lib\\site-packages\\win32', 'C:\\Python24\\lib\\site-packages\\win32\\lib', 'C:
\\Python24\\lib\\site-packages\\Pythonwin']


You can also find out where psyco is being found by printing the module's 
__file__ attribute:
>>> import psyco
>>> psyco.__file__
'C:\\Python24\\lib\\site-packages\\psyco\\__init__.py'

Kent

Orri Ganel wrote:
Hello all, I recently downloaded Psyco and put it in the site-packages folder. Now, when i tried to use it to optimize a program, IDLE says it can't
find it:


Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************
IDLE 1.1


import os
os.chdir(r"c:\python24\lib\site-packes\psyco-1.3")
import psyco


Traceback (most recent call last):
  File "<pyshell#5>", line 1, in -toplevel-
    import psyco
ImportError: No module named psyco

... However, when using the Command Prompt:

Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import os
os.getcwd()

'C:\\Python24'

os.chdir(r"c:\python24\lib\site-packages\psyco-1.3")
import psyco



Anyone know why this is? . . .

Thanks in advance,
Orri

_______________________________________________
Tutor maillist  -  [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to