How to use multiple versions of a python module on single machine -
on single machine, how can/should 2 versions of single python module used
(a) simultaneously on same machine,
(b) under single user, and
(c) without installing external programs (cant reliably install external stuff on windows work computer, sadly),
(d) having same name (to allow no pains when upgrading ($ git pull newversion
) )
a production version of code project running constantly. on same machine, test/development version of code running periodically. how can both use own specific version of given module?
version a:
#!/usr/bin/python34 #c:\\myproject\\testversion\\bin\\myprogram.py import mymodule ## version in c:\\myproject\\testversion\\lib\\python mymodule.do_stuff() # do_stuff version
version b:
#!/usr/bin/python34 #c:\\myproject\\productionversion\\bin\\myprogram.py import mymodule ## version in c:\\myproject\\productionversion\\lib\\python mymodule.do_stuff() ## do_stuff version b
strictly using pythonpath
environment variable pick same mymodule
both versions, if understanding correct.
after reading this question different python modules, , the python docs modules, feel organizing package rather module may appropriate, can't quite tell best practice that.
also, since thought standard (best?) procedure many projects such deb packages etc. have scripts in different folder modules (e.g. bin vs. lib), seems import
keyword looking in same directory not sufficient above case.
Comments
Post a Comment