This is the contents of sys,path  from the .exe

['C:\\Program Files\\Neocodex\\Manager\\pre_loader.exe', 'C:\\Program Files\\Neocodex\\Manager', 'C:\\Program Files\\Neocodex\\Manager/Lib']

(I removed the importing of every single directory inside Lib to reduce the spam)

It shows the proper Lib Directory, as it should. 

The specific error is:

Traceback (most recent call last):
  File "", line 66, in <module>
  File "__init__.pyo", line 8, in <module>
  File "ProgramManager.pyo", line 35, in <module>
  File "rpdb2.pyo", line 13487, in rpdb2_import_wrapper
  File "PluginManager.pyo", line 9, in <module>
  File "rpdb2.pyo", line 13487, in rpdb2_import_wrapper
ImportError: No module named GeneralFunctions

Which is this line 

from GeneralFunctions import *

And GeneralFunctions is a folder inside of the Lib folder containing


Do you need anything else?

On Mon, Aug 8, 2011 at 7:08 AM, King Simon-NFHD78 <> wrote:
> -----Original Message-----
> From: Adam Estes []
> Sent: 08 August 2011 11:55
> To:
> Cc:
> Subject: Re: [Py2exe-users] Python and independent modules
> I used the following code
> path = os.getcwd()
> sys.path.append(path)
> sys.path.append(path + '/Lib')
> path2 = os.walk(path + '/Lib')
> for dirpath, dirnames, filenames in path2:
>     sys.path.append(path + dirpath)
> To add everything in the lib folder to the sys path. Everything works
> perfectly, until we compile it, and then it doesn't work. :(

Have you tried printing out sys.path after you've appended those
directories (in the py2exe-d version)? There are a couple of potential
problems with your approach:

a) I don't think os.getcwd() is guaranteed to return the directory
containing your .exe. You'd be better off using one of the suggestions

b) I think os.getcwd() will return an absolute path, which means that
'dirpath' in your 'for' loop will also be an absolute path. 'path +
dirpath' will therefore be invalid. In general you should use
os.path.join to do these kinds of path manipulations.

If neither of these suggestions fix your problem, perhaps you could show
us the contents of sys.path and the exact error message, and we might be
able to help further.