Mathematica Student Edition
Mathematica Home Edition
Computable Document Format (CDF)
Aerospace Engineering & Defense
Biotechnology & Medicine
Finance, Statistics & Business Analysis
Financial Engineering & Mathematics
Financial Risk Management
Software Engineering & Content Delivery
Authoring & Publishing
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
STEM Education Initiative
Community & Technical College Education
Primary & Secondary Education
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
Other Ways to Buy
Volume & Site Licensing
Does My Site Have a License?
Wolfram User Portal
About Wolfram Research
Stephen Wolfram's Home Page
Wolfram Functions Site
More Info >>
Mark as an Answer
How to load and use a package
Many apologies for another newbie question but what do I do with a package and where do I put it so that it will load and be usable? I want to use Combinatorica and I have saved NewCombinatorica.m in several places, mostly hanging off my main Mathematica program files directory and given them various names but no attempt to load the package has yet been successful. I get a msg Get::noopen: "Cannot open \!\(\"Combinatorica\"\)." (or something similar, depending on the filename I use).
When I write packages, I usually put them in the AddOns/Applications folder.
Also see the discussion about possible locations for packages in earlier posts on this group and also covered in the attached tutorial that I have posted a couple fo times (but which i burried in an old post by this point):
Building Packages Tutorial.nb
Many thanks for the replies. I've put Combinatorica in AddOns/Applications as suggested and it looks like something is making sense to Mathematica as I now get a stream of erro rmessages (attached). I realise I'm trying to run before I walk here, having only ever used Mathematica interactively rather than with programs and data but I really haven't got a clue how to proceed or what help and various tutorials are telling me.
ScreenHunter_45 May. 06 18.19.jpg
Combinatorica is a package that is shipped with Mathematica so you do not need to download and install it. The version that you link to in your first posting is 2.0. The version shipped with mathematica is version 2.1. The error messages that you are getting may have to do with incompatibilities between the 2.0 version and Mathematica versions greater than 6.
ut also pay attention to this:
Thanks again for the reply. I'd visited both those links before I posted - it was them that led me to download Combinatorica: why that chose to download an okld version beats me. So, assuming one of my futile attempts to get this thing to do something has wiped the version shipped with Mathematica which Mathematica tells me it can't load, I am now truly up the creek. I think I'll dig out my version 8 DVD and reinstall everything and not bother with version 9.
Version 9 has Combinatorica as well. No need to go back to an older version of Mathematica.
This, by the way, is one good reason not to change things that are in the Mathematica distribution itself, but rather put them in in one of the folders that I describe in my notebook above. Then you will never overwrite something that is in Mathematica itself. You can then always choose to load the alternative package that is in on of those folders by pointing to it directly.
Thanks - going back to 8 fixed it. Must have been an install glitch. Having said that, Inversions doesn't give me the number of inversions in a vector A as I had expected so I've headed back to Python anyway. Methinks I should go back to watch all the Mathematica intro videos to lear more about the bits I've not used before.