Page 1 of 1
import os - "No module named os"
Posted: Mon Jan 17, 2011 1:48 pm
by timao
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...
Re: import os - "No module named os"
Posted: Mon Jan 17, 2011 3:25 pm
by tsn
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.
Re: import os - "No module named os"
Posted: Mon Jan 17, 2011 3:43 pm
by Alex
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
Re: import os - "No module named os"
Posted: Mon Jan 17, 2011 5:03 pm
by timao
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
Re: import os - "No module named os"
Posted: Mon Jan 17, 2011 5:32 pm
by Alex
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.