Jump to content

Python3 Import is strange


Drughi

Recommended Posts

Hi,

I'm updating my python scripts, but it behaves weird when importing with python3. 

I got a python3.7libs folder in my HOUDINI_PATH. Inside there is my lets say "tools" folder containing "__init__.py"  and "test.py". In "test.py" there is a test function hello_world.

If I now "import tools" I would expect to be able to call  test.py by  "tools.test" , wich is not working ("tools has no attribute test"). Only if I do "from tools import test" it works.

Also if there is another python file in the folder called "utils.py"  I'm not able to "import utils" in test.py.

What am I doing wrong?

Edit:

My bad. I need to "import test from tools"

Edited by Drughi
  • Downvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...