Script access to studio virtualenv / repository

60 views
Skip to first unread message

Panupat Chongstitwattana

unread,
Jan 15, 2018, 2:45:40 AM1/15/18
to Python Programming for Autodesk Maya
Question for Windows system. My code is messy trying to get everything working with lots of hard-coded sys.path insert/append. I really want to get rid of. Our scripts and virtualenv do not live in the same location, what would be the best approach?

Would you have the IT set %PATH% to virtualenv python.exe? 

Would you launch the scripts with bat file? That would mean having different bat file for every scripts.

Have an entry point to launch every other tools so you only have to set this up once?

The sys.path append/insert is also unavoidable when I want to call functions from Deadline events or jobscripts. 

Can anyone give me some suggestion please?

Marcus Ottosson

unread,
Jan 15, 2018, 3:05:30 AM1/15/18
to python_in...@googlegroups.com
The question is a bit broad. What was your experience trying the alternatives you mention; (1) having IT set the %PATH%, (2) launch scripts with a bat file and (3) an entrypoint executable?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/72b9e969-7795-4864-ad2b-d02cef7643ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Panupat Chongstitwattana

unread,
Jan 16, 2018, 4:36:42 AM1/16/18
to Python Programming for Autodesk Maya
Hi Marc.

The way I'm doing now is set up a bat file that I can drop .py files on to run it with virtualenv Python.exe. All the env variables are set there. This works well for stand-alone scripts and I imagine it would work very similarly if I asked IT to embed those in Windows environment too.

However once I start importing those scripts and call functions from other places like Maya/Deadline, I'm not sure what to do other than append the virtualenv path to sys.path.

Sorry if I wasn't very clear, thinking about this makes my head spins.
Reply all
Reply to author
Forward
0 new messages