I want to use ProjectForMMA package,but it throws an error.

enter image description here

But I want to import this package if Kernel started.

So I want to modify FileNameJoin[{$UserBaseDirectory, "Kernel", "init.m"}]:

Add NotebookSave[EvaluationNotebook[],FileNameJoin[{$TemporaryDirectory, "test.nb"}]]; to init.m.

enter image description here

Re-open Mathematica ,it throws an error...

enter image description here

So how to import ProjectForMMA package when I opened MMA?

PS:Only in Mathematica 11.1.0 has this problem.11.0.0 runs ok.

  • 2
    $\begingroup$ We usually reserve the bugs tag for when others have confirmed the behavior as a bug. I'm no expert on the interaction between the front end and the kernel, but what would you expect EvaluationNotebook[] to evaluate to in the kernel's init.m? $\endgroup$ – Jason B. May 6 '17 at 4:01
  • 2
    $\begingroup$ As Kuba said, EvaluationNotebook[] makes no sense in init.m because the evaluation is not being done in a notebook. Generally, no notebook operations should be present in init.m because this is a file that is run on kernel startup, and the kernel can run independently of the front end. $\endgroup$ – Szabolcs May 6 '17 at 17:03
  • $\begingroup$ Let us continue this discussion in chat. $\endgroup$ – Kuba May 9 '17 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.