Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problem in loading own Package

  • To: mathgroup at
  • Subject: [mg27137] Re: Problem in loading own Package
  • From: "Allan Hayes" <hay at>
  • Date: Wed, 7 Feb 2001 02:12:44 -0500 (EST)
  • References: <95l38f$>
  • Sender: owner-wri-mathgroup at

It works OK for me.

The problem may be that that it is not stored in a place where your system
will look (in the directories listed in $Path).
With my Windows system I have put it in the directory

"C:\\Program Files\\Wolfram

and it loads with

<< Poisson`

If I had put it inside a folder, say, mypacks, in this directory then I
would need to use


( for other reasons it would then be a good idea to use

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Ossama Kullie" <kullie at> wrote in message
news:95l38f$e2r at
> Dear Mathematica users can you help me?
> I have written the folloing  package
> BeginPackage["Poisson`"]
>  Clear[PoissonBracket]
> PoissonBracket::usage = "PoissonBracket[a, b,n] calculates the Piosson
> bracket for tow functions a and b which depend on the variables p, q"
> Begin["`Private`"]
> PoissonBracket[a_, b_, n_] := Block[{pk, n},
>       pk =
>         Simplify[
>           Sum[D[a, q[i]]* D[b,p[i]] - D[a,p[i]] * D[b,q[i]], {i,1,n}]]]
> End[]
> EndPackage[]
>  and I have put it in a file Poisson.m, and  tried all possibilties to
> load the package but it doesnot work!
>  Mathematica has read the file Poisson.m, but the function PoissonBracket
>  is not created
>   As Example :
>  Needs["Poisson`", "Poisson.m"]
>  give the folloing error
>  Needs::nocont: Context Poisson` was not created when Needs was
>  evaluated.
>  or: <<Poisson`
>      then
>      ?? PoissonBracket
>      Information::notfound: Symbol PoissonBracket not found.
>  or: Get["Poisson.m"]
>    and then
>    ?? PoissonBracket
>    nformation::notfound: Symbol PoissonBracket not found.
>    the folloing information may be usfel to anser my quation
>    $ContextPath
>    Context[Poisson]
>    ?? Poisson
>    this give the Output
>   {"Global`", "System`"}
>   "Global`"
>   "Global`Poisson"
>  the funktion PoissonBracke work very well, when I create it in my
>  Notebook, only in a package doesnot!
>  I cannot find any error, why I cannot load the
>  function PoissonBracket from the pachage? .

  • Prev by Date: Re: assigning parameters from a matrix
  • Next by Date: Determine the "value range" of a function
  • Previous by thread: Re: Problem in loading own Package
  • Next by thread: Re: Problem in loading own Package