running phyloGenerator via command line

28 views
Skip to first unread message

Alison Ravenscraft

unread,
Nov 29, 2016, 7:44:43 PM11/29/16
to phyloGenerator Users
Hi pG users,

I want to use phyloGenerator via command line.  I'm working through the instructions in the scripting tutorial ("introduction.py") but I'm stuck on the first step. I tried to add phyloGenerator.py to my path using the command: sys.path.append("/Applications/phyloGeneratorMac/phyloGenerator.app")  This appears to have run correctly.  However, when I run import phyloGenerator as pG, I get the message: "ImportError: No module named phyloGenerator."

I must be making a really silly mistake here, but I've been stuck for hours. Can someone explain how to add phyloGenerator to the path?

Thank you!
Alison

Will

unread,
Nov 30, 2016, 4:35:00 AM11/30/16
to Alison Ravenscraft, phyloGenerator Users
Hello Alison,

Thanks for using the program! Just to be clear, when you say "via command line", do you mean programming it using Python? If so, the scripting tutorial is for you, but if you mean just using the program (as I demonstrate in the videos) then you'd be better off following this guide (http://willpearse.github.io/phyloGenerator/guide.html).

If you're going down the Python route, the path to add is "/Applications/phyloGeneratorMac/phyloGenerator.app/Contents/Resources/". If I were you, however, I would just copy phyloGenerator.py and the "requires" folder (both in /Applications/phyloGeneratorMac/phyloGenerator.app/Contents/Resources/) and put them somewhere a bit more convenient. Remember you can open up an application by right-clicking on it and selecting something like "show package contents" (my memory's a bit hazy as I don't have a Mac anymore).

I hope that makes sense - let me know if it doesn't.

Cheers,

Will

---

Need a phylogeny? Try phyloGenerator: original or new version
Measuring phylogenetic structure? Try install.packages('pez')

Will Pearse
Assistant Professor of Biology, Utah State University
Skype: will.pearse
Reply all
Reply to author
Forward
0 new messages