84

https://blog.stephenwolfram.com/2019/05/launching-today-free-wolfram-engine-for-developers/

http://www.wolfram.com/engine/

The Free Wolfram Engine for Developers is available for pre-production software development.

You can use this product to:

  • Develop a product for yourself or your company

  • Conduct personal projects at home, at school, at work

  • Explore the Wolfram Language for future production projects

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
Alexey Golyshev
  • 9,526
  • 2
  • 27
  • 57
  • 2
    Answers really focus on how to setup Jupyter interface with WE. Is that what you want from this question? If not maybe we could rephrase it to fit answers and move the original one to a new quesion? – Kuba Jun 04 '19 at 21:25

8 Answers8

67

On Windows

  1. Download and install Python: https://www.python.org/downloads/windows/

    Don't forget to to check "add python environment variables" / "add to PATH". Otherwise you will have to add python.exe to PATH manually.

  2. Download the .paclet file from the "Assets" section in github : WLforJupyter > Releases

Assets section of the page linked.

  1. In the Command Prompt (running as Admin):

     pip install jupyter 
    
  2. In the Wolfram Engine prompt (wolframscript):

     PacletInstall @ "path/to/the.paclet"
    

    << WolframLanguageForJupyter`

    ConfigureJupyter["Add"]

  3. That's all! Now in the Command Prompt: jupyter notebook. This will launch a web browser. Select New -> Wolfram Language

    Options in menu for "New".

    Example: solving an equation.


And just for fun:

Running Python with the Wolfram Engine kernel in Jupyter.

Alexey Golyshev
  • 9,526
  • 2
  • 27
  • 57
  • 1
    Will functions like Plot or 3DPlot work in Jupyter? – floyd17 May 23 '19 at 17:59
  • 2
    @floyd17 Yes, but you will only get static images as a result. You will not be able to rotate 3D graphics freely (though you can make an animated gif of rotating 3D graphics if you know what you're doing). – Sjoerd Smit May 23 '19 at 18:42
  • 1
    My Jupyter has been installed with Anaconda. I don't know whether that makes the difference, but I get "ConfigureJupyter::notfound: Jupyter installation on Environment["PATH"] not found.". Even if I do ConfigureJupyter["add", <|"JupyterBinary" -> "D:\\Anaconda3\\Scripts\\jupyter.exe"|>] to point at the Jupyter executable it doesn't work. – Sjoerd C. de Vries May 24 '19 at 07:46
  • After adding the path to the Windows environment variable the error disappears, but Jupyter doesn't have a Mathematica option. – Sjoerd C. de Vries May 24 '19 at 07:54
  • @SjoerdC.deVries It is difficult to say what is wrong. I experimented with Anaconda and Python + Jupyter (after removing Anaconda). Everything worked well. – Alexey Golyshev May 24 '19 at 11:22
  • There is a question about Ubuntu specifically. Should that question/answer be merged with this one? – Robert Jacobson May 24 '19 at 16:59
  • Just following the WolframScript instructions on the WolframLanguageForJupyter page and using the configure-jupyter.wls add + explicit paths to my jupyter and Mathemetica kernel binaries worked for me. – Sjoerd C. de Vries May 25 '19 at 21:33
  • 2
    On Windows 10, instructions given above worked perfectly for me. (Thanks :-)). – user1066 May 28 '19 at 12:10
  • I simplified WLfJ installation, and added few comments, hope you don't mind. You can always revert that changes of course. – Kuba Jun 04 '19 at 06:05
  • 1
    @SjoerdSmit amd floyd17: FYI - https://mathematica.stackexchange.com/q/199736/5478 – Kuba Jun 04 '19 at 21:22
  • An importand addition to the above instruction. In order to get Jupiter+WL working from non-Admin accounts (on Windows 10) it was necessary for me to grant write permissions to all users for the whole Anaconda3 directory (it was installed to C:\ProgramData\Anaconda3). – Alexey Popkov Jan 09 '20 at 08:17
  • 1
    I did all this but it says failed connection to the notebook server. – Anixx Nov 20 '20 at 04:44
  • In my case, all the above options failed (I have Python with Anaconda). The only solution that worked for me was defining a virtual environment following this post: https://stackoverflow.com/questions/68313658/problem-with-configuring-wolframlanguageforjupyter – Wiles01 Aug 08 '22 at 11:11
  • PacletInstall @ "path/to/the.paclet" << WolframLanguageForJupyter ConfigureJupyter["Add"] after I copy pasted it says 'PacletInstall' is not recognized as an internal or external command, operable program or batch file. the previous two step has worked, please help me. – random Sep 11 '22 at 12:28
26

Instructions for Linux (tried on Ubuntu/Mint). I tried this yesterday and ran into some issues I think deserve attention in a separate answer. This answer might also contain relevant information for debugging problems on other operating systems.

  • Make sure wolframscript works from your terminal.
  • Make sure Python and Jupyter are installed. Test that you can start a Jupyter notebook by running jupyter notebook. If you can't, take a look at the answer below:

https://stackoverflow.com/questions/35313876/after-installing-with-pip-jupyter-command-not-found

  • Clone or download the WolframLanguageForJupyter repository, following the same instructions from the other answers in this thread.

At this point you have two options. Either:

  1. You navigate to the WolframLanguageForJupyter code and execute the wolframscript file with ./configure-jupyter.wls add. In my own attempt, I got a message

    Jupyter installation on Environment["PATH"] not found

this can be remedied by using the syntax

configure-jupyter.wls add "/absolute/path/to/Wolfram Engine binary" "path/to/Jupyter binary"

instead. The path to the Jupyter binary for me was ~/.local/bin/jupyter (see also the SO answer linked above). The path to the Wolfram binary you can figure out by starting wolframscript and then evaluating FileNameJoin[{$InstallationDirectory, "Executables", "WolframKernel"}].

Or:

  1. You do the installation from within wolframscript:
    • Find out where your $UserBaseDirectory is: start wolframscript and then evaluate $UserBaseDirectory.
    • Navigate to this directory and copy the inner WolframLanguageForJupyter directory from the repository into the ./Applications directory. You should now have a directory structure that looks like: $UserBaseDirectory/Applications/WolframLanguageForJupyter/Kernel
    • (Re-)start wolframscript and run Needs["WolframLanguageForJupyter`"] (to load the package) and then ConfigureJupyter["Add"]. If you (still) get the error complaining about the Jupyter path, run ConfigureJupyter["Add", "JupyterInstallation" -> "path/to/Jupyter binary"] instead (see point 1 for the location of the jupyter binary).
Sjoerd Smit
  • 23,370
  • 46
  • 75
  • Sadly, this did not work for me on a headless Ubuntu 20.04.2 installation. The Wolfram Kernel tile shows up in the JupyterLab launcher, but the notebook or the console cannot start the kernel. Eventually it times out and disconnects. – András Aszódi Jul 20 '21 at 15:50
25

Instructions for macOS:

  • Make sure you installed wolframscript along with Mathematica or the Wolfram Engine. There is a separate installer for it in the disk image.

  • Install Jupyter. Detailed instructions are at https://jupyter.org/install I used Anaconda Python for this (conda install jupyter in the terminal if it's not already installed—but with Anaconda it should be).

  • Clone the WolframLanguageForJupyter repository. Open a terminal, enter the directory where you want it, then run git clone https://github.com/WolframResearch/WolframLanguageForJupyter.git. See the green button on GitHub for more help.

  • Enter the repository's directory, then run ./configure-jupyter.wls add

  • Run jupyter notebook to start the system. Note: Do not use jupyter lab because currently WolframLanguageForJupyter does not work well with it.

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
16

There is a new repo: https://github.com/njpipeorgan/wolfram-language-notebook

The author's introduction:

Using Wolfram Notebooks in VS Code

https://zhuanlan.zhihu.com/p/438701709

Translation:


The release of Wolfram Engine in 2019 marks the separation of the Wolfram language's runtime library and its notebook interface. The subtlety of this separation is that the Wolfram Engine is free, yet essentially has the functionality of both the kernel and the front end (just not the full notebook interface). That is, we can simply create an interface that can be adapted to the kernel to get a similar experience to using Mathematica [1].

Recently, I wrote a VS Code extension, Wolfram Language Notebook (Github), which makes it easy to write and run code in VS Code using the notebook interface. You can install this extension in VS Code's Marketplace at

Wolfram Language Notebook - Visual Studio Marketplace

marketplace.visualstudio.com/items?itemName=njpipeorgan.wolfram-language-notebook

To use this extension, you just need to install Wolfram Engine or Wolfram Mathematica[2] (v12.0+). If you can run wolframscript from the command line or shell, you are ready to go. If you want to use the remote kernel, then you need to install Engine on the remote machine, and just have ssh[3] on the local machine.

How to use it

First create a new notebook: Search for and run Create New Wolfram Language Notebook in the Command Palette, or just create a new file with the .wlnb suffix.

Next, run the Manage Kernels command and select Use wolframscript. this will add wolframscript to the kernel configuration and then connect to this kernel; the status of the connection will be shown in the status bar.

You can then add code units, write some Wolfram Language code, and run it.

Main features

Syntax highlighting: The notebook will highlight some simple Wolfram Language syntax, common built-in functions, and the full names of special characters (such as [Alpha]).

Auto-completion and function descriptions: The notebook prompts for auto-completion of built-in functions. Inputting or hovering over built-in functions will show their usage descriptions.

Output rendering: The notebook renders common expressions to HTML and images to bitmaps.

Export notebooks: You can export .wlnb files to Wolfram notebooks, which include Markdown, input, and output.

Remote kernel: Notebooks can be configured with a remote kernel, and then booted and connected to the kernel via ssh. All calculations will be done remotely, but the code and output will be saved locally.

Principle and Development

Structure of Wolfram Language Notebook

The Wolfram Language Notebook interface is based on the VS Code Notebook API, which is not yet fully finalized and includes an interface for passing messages between the notebook interface, renderer, and controller. As a result, the extension can only send results from the kernel in one direction and cannot receive feedback from the notebook, so some important features (such as Manipulate) are not yet available. This issue will be addressed in a later release.

The rendering of Graphics and Graphics3D is another area that needs improvement. Because of the many options, rendering expressions directly is not a realistic approach, so the current approach is to export them as bitmaps and display them [4]. In a future version, there may be a better way to display these images. (If you have a good method, feel free to contact me.)

Wolfram Engine

You can download the Wolfram Engine here, register your Wolfram ID, and get a license. The use of the Wolfram Language is described here, and the examples in it can basically be run in the Wolfram Language Notebook, except for the interactive interface and natural language input.

Although you can use the Wolfram Language Notebook itself in almost any way, computations performed through the Wolfram Engine are still limited by the Wolfram Engine license.

AsukaMinato
  • 9,758
  • 1
  • 14
  • 40
14

I am trying to pick the best from all solutions we have now (Wolfram Notebook for VS Code extension for example), and follow the idea as Mathematica, where every graphics are just powerful syntax sugar

My preliminary results are there Wolfram Engine JS Frontend

enter image description here

Kirill Vasin
  • 1,235
  • 12
  • 14
  • This looks very interesting ... – user1066 Jan 14 '23 at 23:09
  • Very cool! I've noticed that you're interpreting InputForm of an expression instead of its boxes, good enough for a proof of concept of course, but to make the best of FrontEnd and make it right, a JS interpreter should work with box expressions. – swish Jan 27 '23 at 08:24
  • 1
    @swish, thanks :) You are right. It is more about proof of concept. I will polish it to the state, when it can be as useful as Jupiter/VS Code extension, add a bunch of easy views to Graphics, Matrix objects to show the potential of it. Then may be the community will be interested in helping to make it right, since doing it alone is a torture sometimes ;D @@AsukaMinato actually helps me a lot in adding new features to Graphics3D objects. Mb I will try to present this project at Wolfram Conference (lol), to involve more people into that. – Kirill Vasin Jan 27 '23 at 10:02
  • @KirillVasin lol – AsukaMinato Feb 06 '23 at 13:44
9

i'd like to add for the setup on Windows for Anaconda.

After Anaconda has been installed,

  1. open Anaconda Powershell Prompt

  2. run wolframscript

  3. and follow the installation process of Method 2 (https://github.com/WolframResearch/WolframLanguageForJupyter)

i did this without specifying any path for python or jupyter and it works. it seems the path has been set already after opening Anaconda Powershell Prompt.

slphyx
  • 91
  • 2
3

If you mean front-end in the strict sense, i. e. the visual notebook interface for interactivity, the following is not for you. But if all you want is displaying visualizations / graphics (incl. typeset expressions), you could use some of the windowing functionality together with J/Link, as I explain in my video here: https://www.youtube.com/watch?v=S1maEG-0nvE. Because J/Link works just fine from the engine.

Andreas Lauschke
  • 4,009
  • 22
  • 20
  • It would be good to include the pertinent information in the video you linked in your answer here, as the link could rot, and the video is 1.5 hours long. – Julia Nov 28 '22 at 20:40
3

For Linux only: https://github.com/Ludwiggle/JWLX

Pros: code auto-completion, neat separation between Wolfram kernel and Jupyter kernel, special functions to handle Dynamics in the browser.

Fortsaint
  • 2,060
  • 15
  • 17