|
[PyFeyn] problems with installationGeorg von Hippel hippel at kph.uni-mainz.deWed Sep 11 15:27:19 BST 2013
Dear Maien, first of all, thanks for giving pyfeyn a try! Could you try changing the file <your pyfeyn installation path>/pyfeyn/__init__.py to read as follows (delimited by -----)? ----- """ PyFeyn - a simple Python interface for making Feynman diagrams. """ __author__ = "Andy Buckley & Georg von Hippel (pyfeyn at projects.hepforge.org)" __version__ = "0.3.2" __date__ = "$Date: 2009-01-08 12:57:43 +0100 (Thu, 08 Jan 2009) $" __copyright__ = "Copyright (c) 2007 Andy Buckley" __license__ = "GPL" ## Import PyX and set up some things try: import pyx except: print "You don't have PyX - that's a problem unless you're just running the setup script." import sys sys.exit() ## Check the version from distutils.version import StrictVersion as Version if Version(pyx.version.version) < Version("0.9.0"): print "Warning: PyFeyn may not work with PyX versions older than 0.9!" ## Units pyx.unit.set(uscale = 4, vscale = 4, wscale = 4, xscale = 4) pyx.unit.set(defaultunit = "cm") ## TeX stuff pyx.text.defaulttexrunner.set(mode="latex") pyx.text.defaulttexrunner.preamble(r"\usepackage{hepnicenames}") ## Set __all__ (for "from pyfeyn import *") __all__ = ["diagrams", "points", "blobs", "lines", "deco", "utils", "config"] ----- Presumably the problem is not your not having PyX, but the PyX version you have being incompatible with pyfeyn. Unfortunately, PyX does not offer a stable interface -- each new PyX version breaks some of the code in pyfeyn, and there is little we can do about that. If you can let us know what version of PyX you have, perhaps the problems can be fixed. I have version 0.11.1, and this works with pyfeyn. Best regards, Georg -- ============================================================================ Dr. Georg von Hippel Institut für Kernphysik Phone: +49 6131 39-22933 Johannes Gutenberg-Universität Mainz Fax: +49 6131 39-22964 Johann-Joachim-Becher-Weg 45 Email: hippel at kph.uni-mainz.de 55099 Mainz, Germany ============================================================================ On Wed, 11 Sep 2013, mymb1a09 wrote: > Hello > > First, I'd like to thank the authors of this code which I'm keen to learn so > that I can use it for my work. > > I have ubuntu 12.04 64bit, I tried downloading the package and up to now, I > can import it via python. But I'm facing a number of issues: > > 1) Even though I have PyX, I get a message saying you don't have PyX. I > import it along with pyfeyn but I get that message as in: > > ===================== >>>> import pyx, pyfeyn > You don't have PyX - that's a problem unless you're just running the setup > script. > ===================== > > 2) Once I try any of the test codes provided in the website, I get a number > of errors which I'm not sure how to interpret. For example, if I run the > first test code I get: > > =========================================== > Python 2.7.3 (default, Apr 10 2013, 06:20:15) > [GCC 4.6.3] on linux2 > Type "copyright", "credits" or "license()" for more information. >>>> > You don't have PyX - that's a problem unless you're just running the setup > script. > > Traceback (most recent call last): > File "/home/maien/Desktop/tests/pyfen/test1.py", line 27, in <module> > fd.draw("pyfeyn-test1.pdf") > File "build/bdist.linux-x86_64/egg/pyfeyn/diagrams.py", line 67, in draw > c = self.drawToCanvas() > File "build/bdist.linux-x86_64/egg/pyfeyn/diagrams.py", line 59, in > drawToCanvas > obj.draw(FeynDiagram.currentCanvas) > File "build/bdist.linux-x86_64/egg/pyfeyn/lines.py", line 325, in draw > canvas.stroke(path, styles) > File "/usr/local/lib/python2.7/dist-packages/pyx/canvas.py", line 298, in > stroke > self.draw(path, [deco.stroked]+list(attrs)) > File "/usr/local/lib/python2.7/dist-packages/pyx/canvas.py", line 284, in > draw > adeco.decorate(dp, self.texrunner) > File "build/bdist.linux-x86_64/egg/pyfeyn/deco.py", line 27, in decorate > 1, self.size, 45, constrictionlen) > TypeError: _arrowhead() takes exactly 7 arguments (6 given) >>>> > ============================================= > > I'd really appreciate it if I can get help with this. > > Best regards, > Maien > _______________________________________________ > PyFeyn mailing list > PyFeyn at projects.hepforge.org > http://www.hepforge.org/lists/listinfo/pyfeyn >
More information about the PyFeyn mailing list |