# How to install custom package

There is great code by István Zachar , but I do not know how to use it. I have saved the code as a .m file and use file->install to install it. However, when I call the package the error message below occurred. May you so kind to give me some reference of how the package to be created and install from scratch. I really want to write some useful package by myself.

Needs["ExploreGraphics"]

Needs::nocont: Context ExploreGraphics was not created when Needs was evaluated.

• Check the variable $Path. Is the package file in one of the directories listed? – mikado Jun 4 '17 at 19:31 • Yes, the package file is in the folder. – Rikeijin Jun 5 '17 at 11:29 • Kuba♦ Thank you. I saved the code by István Zachar in a m.file with name ExploreGraphics.m and use ExploreGraphics as the name of package. I am not sure whether it is the right way to use the code. – Rikeijin Jun 5 '17 at 17:03 • @Kuba Thans for reminding me the cross-post this in Wolfram community. I had write to the moderation team for apology and will make sure the infomration will always be added next time. – Rikeijin Jun 5 '17 at 19:25 ## 1 Answer Notice the content of the message is only about missing context, which is usually introduced by BeginPackage["ExploreGraphics"]. Your functions should already be loaded. If your package is on $Path, and it seems it is, otherwise you'd get additional Get::noopen: Cannot open ExploreGraphics. message, you are almost there.

If you want it to work well with Needs you need to add mentioned BeginPackage and friends. See Creating Mathematica packages, shortly you should write something like:

BeginPackage["ExploreGraphics"]

GetPlotRange::usage = ...
GraphicsButton::usage = ...
...

Begin["Private"]
(*implementation*)
End[]
EndPackage[]
`