Installing and Loading Packages

Packages intended for frequent use can be automatically installed within Mathematica™ to the Applications directory using the “Install” option under the menu “File.” The main benefits to installing the packages this way are that the packages will remain available even when a new version of Mathematica™ is installed, and that the directory is automatically part of the paths searched when loading a package.

If you do not have access to the Applications directory (e.g., if you are using Mathematica™ on a shared computer where you do not have the appropriate permissions), you can place the package in the default Documents folder–which is also in the list of paths searched automatically–or anywhere else, although you may have to enter the path to that other location manually when loading the package.

Packages are best loaded using the “Needs” function within Mathematica™. So for the ComplexSymbols package, you would type:

Needs["ComplexSymbols`"]

If you did not install the package in the Applications directory, you may need to include a second parameter that gives the path to the package file.

The Needs function tests to see if the package has already been loaded, and then only loads it if it has not been.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s