-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NuGet directives will get error #106
Comments
I'm not sure what's wrong with the NuGet functionality (I'll look into it) In the meantime, you can use Paket to do this: #load "Paket.fsx"
Paket.Version ["Newtonsoft.Json", "~> 9.0.1"] then: #r @"packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll" |
See also https://notebooks.azure.com/n/g2QclpAZ0P4/notebooks/fsharp-paket-template.ipynb for generating load scripts (@forki is making this easier) Correct link is https://notebooks.azure.com/library/fsharp-templates/html/fsharp-data-usa-states-example.ipynb |
I've just updated the documentation to use Paket, for example you can do this now: #load "Paket.fsx"
Paket.Package ["Newtonsoft.Json"; "FSharp.Compiler.Service"]
#r @"packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll"
#r @"packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.dll" @OverlyExcessive do you have a specific need for the NuGet client? It's implemented using a very old NuGet binary. We could try to update that and fix this in the process. There is some discussion of updating in #77 but nothing came of it so far. Personally I'd recommend completely switching to Paket, that's what I've done in my notebooks. |
@dsyme I get an Access Denied on that link: It might not be possible to share links like this to Azure Notebooks. |
@cgravill this is really interesting (and awesome!). |
@forki we very much appreciate pinning, and Paket in general. I think because we're creating the .lock file then even without specifying a version we're going to be stable which makes this strictly better than the previous raw NuGet (though that could specify a version as well). When implementing this we had a few discussions of if you should do all the dependencies externally. However, it's really nice to have your dependencies stated at the top of your notebook as it lets our scientists reliably share notebooks (if you specify versions). |
Yes. Inlining deps/references files in the notebook is awesome. If things
are pinned in the background then it's probably already fine. But I think
an optional lock file would still help a lot.
|
The lock file we install is: https://github.com/fsprojects/IfSharp/blob/4c7a387d5d38c44283a06619dc6df95e42ba1f51/src/IfSharp.Kernel/helpers/paket.lock which is now empty at install time. We previously took a more batteries included approach and installed fslab etc. Now we do it on-demand. One thing I really like is that it's done (by @sylvanc and @npmurphy) with .fsx and intended to be user serviceable. It's also fairly shallow wrappers around Paket.Core.dll which people can call into directly. It would be great to have your input on how best to interact with Paket. |
The current approach also allows: Paket.Version
[ "Some.Thing", "~> 3.4.5"
"Other.Thing", "~> 0.1.2"
] It's not a .lock file, of course :) But it does allow explicit versioning. As @cgravill said, we would of course be super keen on any ideas you have to improve this. |
@cgravill I wasn't aware that paket was included. That will work fine for me. Although it would have been nice if it would have added the references to the assemblies like the #N directive did. |
Excellent, Paket really is a much nicer way to go about adding dependencies. We might be able to bring back automatic references, I can see how it's useful and it's actually quite separate from how you acquire the nugets. @sylvanc what do you think about this and the #107 pull request? It would be really nice if we could automatically figure out the ordering of dlls, that's been hassle before with fsi for me. |
Looks like @forki is way ahead on this one: |
@cgravill @forki As an aside I'm really keen on using generated load scripts where possible. The API is a bit clunky but the path is much better in the long term than referencing DLLs under packages directly: e.g.
then
One reason is that this path is fully tested in Paket and scales to all Paket features, without creating new API surface area. I'm not using Note that in Azure Notebooks the SOURCE_DIRECTORY value is currently For Azure notebooks let's get this sorted out on Monday |
@cgravill Correct link is https://notebooks.azure.com/library/fsharp-templates/html/fsharp-data-usa-states-example.ipynb, thanks. The tables don't display properly in the preview, I've told the Azure Notebooks team about that |
Added #112 for the SOURCE_DIRECTORY issue |
What about to cancel "#N" directive if it is not working? http://numerics.mathdotnet.com/IFSharpNotebook.html And then (after error) I found this issue. |
Closing, as #107 provides conversion support. |
Have tried both on Azure Notebooks and running the latest docker image locally.
Steps to reproduce
In a new cell:
#N "Newtonsoft.Json"
Results
NuGet error: Unable to find package 'Newtonsoft.Json'.
The text was updated successfully, but these errors were encountered: