Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 3
    $\begingroup$ How about mathkernel -run '$Path=...' ? $\endgroup$ Commented Dec 15, 2016 at 17:23
  • $\begingroup$ There are two environment variables that can be used for this, MATHEMATICA_BASE and MATHEMATICA_USERBASE. With them I think you should be able to achieve what you want, although they are not exactly the same thing as PYTHONPATH. Both are documented here $\endgroup$ Commented Dec 15, 2016 at 19:10
  • $\begingroup$ @AlbertRetey: Thanks for the pointer. After experimenting a bit with MATHEMATICA_BASE and MATHEMATICA_USERBASE, however, I concluded that Mathematica interprets them sufficiently differently from what I have in mind that decided to go with a different solution. (I've posted this solution as an answer, below.) $\endgroup$ Commented Dec 15, 2016 at 22:10