How SpaceClaim handles paths

Options
sombodyfromtheworld
sombodyfromtheworld Member Posts: 29
First Comment 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: 230
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Options

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