I have a package:


soma::usage = "asdfa";


soma[x_] := x + 1;



I save the file with ".m" extension. So, in another file I tried to load the package:

In[2]:= Get["MPA_HNotation.m", Path -> {"/home/mateus/Desktop/"}]

In[3]:= soma[x]

Out[3]= soma[x]

It seems that doesn't get the package. What can be wrong?

  • 1
    $\begingroup$ Works fine for me, maybe there are old definitions of soma that interfere. Get would issue a message if it didn't find the file. What if you restart the kernel. What does ?soma say? $\endgroup$
    – Kuba
    Jan 24, 2019 at 21:24
  • $\begingroup$ Did you remember to make all the cells you want evaluated when your package loads the Initialization Cell property? $\endgroup$
    – m_goldberg
    Jan 25, 2019 at 4:31
  • $\begingroup$ Still doesn't work for me. I didn't understand @m_goldberg. $\endgroup$
    – Mateus
    Jan 25, 2019 at 13:59
  • $\begingroup$ @Mateus how did you create .m file? What is the raw content of the file? $\endgroup$
    – Kuba
    Jan 25, 2019 at 15:28
  • 1
    $\begingroup$ No, you need to have Code cells. If you create a new .wl file it will have them by default. See linked topic and let me know if you disagree with closing. $\endgroup$
    – Kuba
    Jan 28, 2019 at 14:39


Browse other questions tagged or ask your own question.