Module not found error

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

xvoodoo
Posts: 5
Joined: Sun Dec 22, 2002 3:08 pm

Module not found error

Postby xvoodoo » Mon Feb 10, 2003 10:41 am

Hi I'm new in python scripting. And I have a little problem. I have two script files loaded in text window - for example file1.py and file2.py. And if I write in file1.py this:

from file2 import *

I got an error - Module 'file2' not found

What should I do? Or what should I set and where?
:?:
Thanx for help

xvoodoo
Posts: 5
Joined: Sun Dec 22, 2002 3:08 pm

Postby xvoodoo » Fri Feb 14, 2003 11:05 am

:!: hey, is anyone reading this formum? Did somebody already read my message? Does somebody care about my problem? :?:

Coz
Posts: 46
Joined: Wed Oct 16, 2002 5:15 pm
Location: Santo Domingo, Dominican Republic

Postby Coz » Fri Feb 14, 2003 5:11 pm

I don't know much about python, and maybe the ones that know in this forum don't know how to help you. Ask for help in www.elysiun.com

EDITED: I think you are trying to import a file in the wrong way. In a python script I saw this:

import Blender
from Blender.Draw import *

So I guess python thinks you are trying to import a function not a file. Try the first, but as you can see, I'm just guessing.

xvoodoo
Posts: 5
Joined: Sun Dec 22, 2002 3:08 pm

Postby xvoodoo » Sun Feb 23, 2003 9:30 am

Thax for help, but that's not it. Maybe I try ellysium.

willian
Posts: 20
Joined: Mon Jan 13, 2003 3:50 am

Re: Module not found error

Postby willian » Sun Feb 23, 2003 9:50 pm

xvoodoo wrote:Hi I'm new in python scripting. And I have a little problem. I have two script files loaded in text window - for example file1.py and file2.py. And if I write in file1.py this:

from file2 import *

I got an error - Module 'file2' not found

What should I do? Or what should I set and where?
:?:
Thanx for help


Hi :)

As far as I know, loading both scripts is not the right way. If you want to import file2 in file1, file2 must be in the PYTHONPATH: like other python modules, it must be in one of the folders where the python interpreter will look for it. This link at elysiun should tell you how to solve the matter:

http://www.elysiun.com/forum/viewtopic.php?t=7723

Have fun.


Return to “Python”

Who is online

Users browsing this forum: No registered users and 2 guests