Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qsub python import

I'm running a job on the cluster for the first time. I run it with the following command:

qsub -cwd -S /usr/bin/python myScript.py

I have a python script that starts with:

import time
import anotherScript

The error I get:

Traceback (most recent call last):
  File "/opt/sge62/default/spool/hpc01/job_scripts/487174", line 11, in <module>
    import anotherScript
ImportError: No module named anotherScript

the anotherScript.py is in the same directory as myScript.py.

What can I do to solve the problem? would appreciate any help

like image 744
JelenaČuklina Avatar asked May 09 '26 14:05

JelenaČuklina


1 Answers

well, problem was solved by sys.path.append(currentWorkingDirectory). However, it's definitely not a nice way.

like image 176
JelenaČuklina Avatar answered May 12 '26 04:05

JelenaČuklina



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!