# How to load two packages?

I want to use FeynArts and FormCalc. I've saved them in two different folders and I want to load and use both of them. This is how I load one of them: I write

SetDirectory["/Users/MyUserName/Library/Mathematica/Applications/HighEnergyPhysics/FeynArts-3.9"]


And then I write

<<FeynArts


which then loads correctly. But now I want to load FormCalc which is in another folder. How can one load two packages lying in different folders?

My layman temporary solution is

SetDirectory["/Users/MyUserName/Library/Mathematica/Applications/\
HighEnergyPhysics/FeynArts-3.9"]
<< FeynArts
HighEnergyPhysics/FormCalc-9.1"]
<< FormCalc


Which I use to be able to run the script Lecture1-1.nb given on Misho's webpage

His script does not work on my Mac if I simply run it as it stands. If I simply write

<<FeynArts


I get the error

Get::noopen: Cannot open FeynArts. >>

• In general, packages need to be installed before loading them. Usually this means placing them in FileNameJoin[{$UserBaseDirectory, "Applications"}]. It is not necessary to enter the directory where the package is before loading it. Instead, install them to the correct location. Now, I do not use FeynArts and FormCalc, so I do not know if there are any special steps needed when installing them. Have you read the documentation of these packages, specifically the installation instructions? – Szabolcs Nov 18 '15 at 11:31 • How do I find the correct location? – Your Majesty Nov 18 '15 at 11:33 • Execute the FileNameJoin[$UserBaseDirectory, "Applications"] in a notebook. That will show you the directory. – Jack LaVigne Nov 18 '15 at 12:36

The "standard" way to install FeynArts+FormCalc on OSX or Linux would be to use the automatic installation script from the developer. I'm quoting the second paragraph of www.feynarts.de

The automatic installation script gets you started quickly and easily.

NEW Major improvements for Cygwin and Mac.

(Use the right mouse button and "Save Link As...")

Make it executable with chmod 755 FeynInstall.

Run it in the directory in which you want the packages installed: ./FeynInstall.

The script separately prompts you for the installation of FeynArts, FormCalc, and LoopTools.

Finally, it asks whether to include FeynArts and FormCalc in Mathematica's \$Path


At the end you should be able to load both packages simply with

<<FeynArts
<<FormCalc

• I don't know how closely this one is related but I though you may judge that quicker: 138799 thanks in advance ;) – Kuba Mar 1 '17 at 6:49