Setting the ht_condor (condorpy) Python path

5 views
Skip to first unread message

shawncrawley

unread,
Jul 21, 2017, 11:27:44 AM7/21/17
to Tethys Platform
Since I've upgraded to Tethys 2.0, my condor jobs are failing at import lines. I printed the sys.path (python) to see where it was looking, and got the following:

['/var/lib/condor/execute/dir_17601', '/usr/lib/tethys/lib/python2.7', '/usr/lib/tethys/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/tethys/lib/python2.7/lib-tk', '/usr/lib/tethys/lib/python2.7/lib-old', '/usr/lib/tethys/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/tethys/local/lib/python2.7/site-packages', '/usr/lib/tethys/src', '/usr/lib/tethys/local/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg', '/home/shawn/tethysdev/epanet-adapter', '/home/shawn/tethysdev/tethysapp-citywater', '/home/shawn/tethysdev/cloned_bpi_tool', '/usr/lib/tethys/local/lib/python2.7/site-packages/reportlab-3.3.0-py2.7-linux-x86_64.egg', '/usr/lib/tethys/local/lib/python2.7/site-packages/Pillow-3.2.0-py2.7-linux-x86_64.egg', '/usr/lib/tethys/local/lib/python2.7/site-packages/openpyxl-2.3.5-py2.7.egg', '/usr/lib/tethys/local/lib/python2.7/site-packages/et_xmlfile-1.0.1-py2.7.egg', '/usr/lib/tethys/local/lib/python2.7/site-packages/jdcal-1.3-py2.7.egg', '/usr/lib/tethys/lib/python2.7/site-packages', '/usr/lib/tethys/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg', '/usr/lib/tethys/lib/python2.7/site-packages/reportlab-3.3.0-py2.7-linux-x86_64.egg', '/usr/lib/tethys/lib/python2.7/site-packages/Pillow-3.2.0-py2.7-linux-x86_64.egg', '/usr/lib/tethys/lib/python2.7/site-packages/openpyxl-2.3.5-py2.7.egg', '/usr/lib/tethys/lib/python2.7/site-packages/et_xmlfile-1.0.1-py2.7.egg', '/usr/lib/tethys/lib/python2.7/site-packages/jdcal-1.3-py2.7.egg']

Though a long list, it can be noted that there is not a single path including "/home/shawn/tethys/," which is where the my newest installation of Tethys 2.0 is located. So it makes sense that my script is failing with an import not found error. How do I add the python modules within "/home/shawn/tethys/" to this path?

shawncrawley

unread,
Jul 21, 2017, 11:42:35 AM7/21/17
to Tethys Platform
Additional info:

I also printed out the sys.executable, and it looks like ht_condor is executing its scripts with the older Tethys version python path (/usr/lib/tethys/bin/python). My question still stands about how to change which python executable ht_condor uses.

shawncrawley

unread,
Jul 21, 2017, 11:45:43 AM7/21/17
to Tethys Platform
Wow, I just found my own answer! I forgot that ht_condor requires that each executable have a shebang at the top specifying the path to the execution engine. The shebang at the top of my files is currently "#!/usr/lib/tethys/bin/python" so I just need to change that to the new path. Well... I'm glad we had this chat! Haha. Hopefully this will help someone in the future.


On Friday, July 21, 2017 at 9:27:44 AM UTC-6, shawncrawley wrote:
Reply all
Reply to author
Forward
0 new messages