How SpaceClaim handles paths

sombodyfromtheworld
sombodyfromtheworld Member Posts: 29
10 Comments Name Dropper
**

I cannot import my custom module in Space Claim. it doesn't see it. Why?

import os
os.chdir('C:/FEA')
from run_files.raw_dir import go_over

output:

from run_files.raw_dir import go_over
No module named run_files.raw_dir

EDIT:
sys.path.append('C:/FEA') # this works

Tagged:

Answers

  • M
    M Member, Employee Posts: 235
    100 Comments Photogenic 5 Likes Name Dropper
    ✭✭✭✭

    You answered your own question. Best!
    Python looks for modules in the sys.path directories.
    os.chdir() just moves you to the given directory.