Jump to content
Sign in to follow this  
Drughi

Python3 Import is strange

Recommended Posts

Posted (edited)

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×