fsprojects / IfSharp

F# for Jupyter Notebooks
Other
442 stars 71 forks source link

Unable to install #230

Closed Karrq closed 5 years ago

Karrq commented 5 years ago

Description

Unable to install the notebook using the zipped installer.

Repro steps

Please provide the steps required to reproduce the problem

  1. Unzip latest release

  2. Run ifsharp.exe

Expected behavior

Installation of notebook

Actual behavior

Unhandled Exception: System.Exception: Unable to start Jupyter, please install Jupyter and ensure it is on the path
   at IfSharp.Kernel.App.StartJupyter() in C:\dev\IfSharp\src\IfSharp.Kernel\App.fs:line 261
   at Program.main(String[] args) in C:\dev\IfSharp\src\IfSharp\Program.fs:line 29

Known workarounds

None

Related information

I made sure jupyter is on path. I can start it from the command prompt or from powershell and the folder where the executable sits at is in both the user's and the system's PATH.

Karrq commented 5 years ago

After some more troubleshooting I was able to get IFSharp.exe to find jupyter by making a shortcut to the jupyter executable found in C:\\PythonInstallDir\\Scripts\\jupyter.exe in my user's home folder (C:\\Users\\MyUser). It then installed succesfully.

Upon trying to use the newly installed kernel with Jupyter Lab it seems to not work at all, making jupyter hang and throw a lot of errors in the web interface. Jupyter Notebook seems to work fine.

cgravill commented 5 years ago

Strange, you shouldn't need to add that shortcut. Which Python distribution are you using?

The last zip release is from a while back. It's missing a fix for JupyterLab so you'd have to build from master yourself if you want to use JupyterLab for the moment.

Karrq commented 5 years ago

I'm using Python 3.7.3 straight from the python software foundation (no Anaconda).

Good to know there's already a fix that's already done for the Lab incompatibility!

EDIT: Also am I supposed to keep the installer and everything else in the same folder where I run IFSharp.exe the first time? I thought I could just delete those file after the first run...

cgravill commented 5 years ago

Some folks have definitely been able to use a straight Python installer though I use Anaconda myself. It's fairly direct what it's doing:

https://github.com/fsprojects/IfSharp/blob/de9561b91924442538c6a35efb45ce150cdc581a/src/IfSharp.Kernel/App.fs#L243-L255

If you run a jupyter notebook on the default terminal, does it load? Are you able to create an F# notebook?

You only have to run the exe once, launching Jupyter is just a convenience that works for most folks.

On the second question: due to the way Jupyter works then you must keep the folder in the location you ran it from.

For example, I have a configuration file: C:\Users\XYZUSER\AppData\Roaming\Jupyter\kernels\ifsharp\kernel.json

Which configures the location of kernel which Jupyter launches:

{
  "display_name": "F#",
  "argv": [ "E:\/dev\/IfSharp\/src\/IfSharp\/bin\/Debug\/ifsharp.exe", "{connection_file}"],
  "language": "fsharp"
}

There's a few discussions about how to make the installation process more comfortable e.g. #228

Karrq commented 5 years ago

If you run a jupyter notebook on the default terminal, does it load?

Yes, I was able to run it straight from the terminal, that's how I usually start jupyter.

I followed the backtrace as well, that's also why I thought about making the shortcut in my home dir, since the working directory is set to that.

Thank you for answering my concern on the files after the install.

cgravill commented 5 years ago

There might be more information on the exceptions, perhaps a permissions issue? So far we've not printed it out as it's always turned out to be a pathing issue that went away on reinstall.

If you were to build yourself could find if there's any additional information. We could possibly just print but for most people it might be confusing noise.

cgravill commented 5 years ago

I'm going to close this for now, but if you get more information happy to look at it again later.