import os - "No module named os"

Post Reply
timao
Posts: 11
Joined: Fri Jun 25, 2010 12:42 pm
Location: Hannover - Germany

import os - "No module named os"

Post by timao » Mon Jan 17, 2011 1:48 pm

Hello,

i just tried to load the os module via a batch script. On my Windows workstations everything is fine. But on fedorra I can't load this standard module. Can somebody confirm this?

Cheers

PS: e.g. "import sys" works fine in both worlds...

User avatar
tsn
Posts: 283
Joined: Fri Jun 11, 2010 7:22 am

Re: import os - "No module named os"

Post by tsn » Mon Jan 17, 2011 3:25 pm

As far as I know, the os module is part of your Python distribution and not RF. You can check for "os" with a simple command: open a shell/terminal and enter

python
>>> help('modules')

Look for "os" and if it's not there you have to install it separately or reinstall Python. If it's there you might have to change your environment variables or paths to point to this module.
Thomas Schlick | Next Limit Technologies

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: import os - "No module named os"

Post by Alex » Mon Jan 17, 2011 3:43 pm

Hi all,

the problem with modules import in Linux is our fault. The path set for modules search is not well constructed.

I don't have a Linux machine at this moment to test it. Can you post the result of this command?:

Code: Select all

import sys
scene.message( str( sys.path) )
Path is most likely corrupt with some Windows style info. If you post the output path we can provide you a quick workaround.

Of course, it will be fixed for the next version.

Sorry for the inconvenience
Alex Ribao
RealFlow Team
Next Limit Technologies

timao
Posts: 11
Joined: Fri Jun 25, 2010 12:42 pm
Location: Hannover - Germany

Re: import os - "No module named os"

Post by timao » Mon Jan 17, 2011 5:03 pm

Hello Alex,

here is my output:

Code: Select all

['/home/timo/realflow/lib/python;/home/timo/realflow/lib/dlls', '/home/timo/realflow/lib/python/lib-dynload']
I think in my case:

Code: Select all

sys.path.append("/home/timo/realflow/lib/python")
will do the job.

Best regards

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: import os - "No module named os"

Post by Alex » Mon Jan 17, 2011 5:32 pm

Hi Timo,

That's right.

Code: Select all

sys.path = ['/home/timo/realflow/lib/python', '/home/timo/realflow/lib/python/lib-dynload']
That should do the trick.

Let us know if you have any more problem with it.
Alex Ribao
RealFlow Team
Next Limit Technologies

Post Reply