Code Monkey home page Code Monkey logo

Comments (13)

anigo333 avatar anigo333 commented on June 8, 2024 1

I followed https://github.com/dotnet/interactive/blob/HEAD/docs/jupyter-in-polyglot-notebooks.md and it worked for me. If you have already tried that, may be try the following in the .dip file and see if then python shows up as a code option.

#!connect jupyter --kernel-name pythonkernel --kernel-spec python3 (do this in csharp)

from interactive.

teodimache avatar teodimache commented on June 8, 2024 1

Good question, you made me go down the rabbit hole and figured out i was missing the iPython package. Thanks! :)
All is well now, I'm able to run Python code from the .NET Interactive kernel.

from interactive.

Regenhardt avatar Regenhardt commented on June 8, 2024

This indeed helped me fix an adjacent problem, terminal not recognizing python. Had to disable the python app execution aliases in windows settings.

Unfortunately this did not fix vscode not finding python.

Terminal:

> python --version
Python 3.11.7

VSCode dib file:

> #!connect jupyter --kernel-name pythonkernel --kernel-spec python3

The #!connect jupyter feature is in preview. Please report any feedback or issues at https://github.com/dotnet/interactive/issues/new/choose.

Error: System.ArgumentException: KernelSpec python3 not found
at Microsoft.DotNet.Interactive.Jupyter.ZMQ.JupyterConnection.CreateKernelConnectionAsync(String kernelSpecName) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive.Jupyter\ZMQ\JupyterConnection.cs:line 47
at Microsoft.DotNet.Interactive.Jupyter.JupyterKernelConnector.CreateKernelAsync(String kernelName) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive.Jupyter\JupyterKernelConnector.cs:line 27
at Microsoft.DotNet.Interactive.Jupyter.ConnectJupyterKernelCommand.ConnectKernelsAsync(KernelInvocationContext context, InvocationContext commandLineContext) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive.Jupyter\ConnectJupyterKernelCommand.cs:line 72
at Microsoft.DotNet.Interactive.CompositeKernel.<>c__DisplayClass21_0.<<AddKernelConnector>b__0>d.MoveNext() in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\CompositeKernel.cs:line 271
--- End of stack trace from previous location ---
at System.CommandLine.NamingConventionBinder.CommandHandler.GetExitCodeAsync(Object returnValue, InvocationContext context)
at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<AddMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationPipeline.<InvokeAsync>g__FullInvocationChainAsync|2_0(InvocationContext context)
at System.CommandLine.Parsing.ParseResultExtensions.InvokeAsync(ParseResult parseResult, IConsole console)
at Microsoft.DotNet.Interactive.Commands.DirectiveCommand.InvokeAsync(KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Commands\DirectiveCommand.cs:line 33
at Microsoft.DotNet.Interactive.Kernel.HandleAsync(KernelCommand command, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 330
at Microsoft.DotNet.Interactive.KernelCommandPipeline.<BuildPipeline>b__6_0(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation _) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 60
at Microsoft.DotNet.Interactive.KernelCommandPipeline.SendAsync(KernelCommand command, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 41

ms-toolsai.jupyter: v2023.11.1100101639

from interactive.

colombod avatar colombod commented on June 8, 2024

Are you using anaconda?

from interactive.

Regenhardt avatar Regenhardt commented on June 8, 2024

No, no virtual environments. Haven't installed anaconda here.

from interactive.

teodimache avatar teodimache commented on June 8, 2024

I have the same issue and I'm using miniconda which comes with a Python version 3.11.5. Also I don't have conda or python in the PATH env variable.

from interactive.

colombod avatar colombod commented on June 8, 2024

Doesn't mini onda come with default environment as root or base?

from interactive.

teodimache avatar teodimache commented on June 8, 2024

it does yes, it's called "base", and it's not complaining about that, it's complaining about the KernelSpec: "KernelSpec python3 not found"

from interactive.

colombod avatar colombod commented on June 8, 2024

can you run jupyter kernelspec list and see what are the kernel specs and share the paths?

from interactive.

colombod avatar colombod commented on June 8, 2024

@Regenhardt what do you see if you run the jupyter kernelspec list command?

from interactive.

Regenhardt avatar Regenhardt commented on June 8, 2024

I get jupyter : The term 'jupyter' is not recognized as the name of a cmdlet, function, script file, or operable program.[...].

I installed/upgraded the notebook package, pip list includes notebook 7.0.7 (previously it was 7.0.1).
python/pip work, ipynb works too. PATH contains both Python\ and Python\Scripts\. What am I missing?

from interactive.

colombod avatar colombod commented on June 8, 2024

I get jupyter : The term 'jupyter' is not recognized as the name of a cmdlet, function, script file, or operable program.[...].

I installed/upgraded the notebook package, pip list includes notebook 7.0.7 (previously it was 7.0.1). python/pip work, ipynb works too. PATH contains both Python\ and Python\Scripts\. What am I missing?

I usually install Jupyter using pip3 install jupyterlab can you try that?
if the Jupyter command is not resolved it means Jupyter server is not installed and you don't have kernel spec available

from interactive.

Regenhardt avatar Regenhardt commented on June 8, 2024

Doing that results in a whole lot of "Requirement already satisfied" messages, the first being:

Requirement already satisfied: jupyterlab in e:\programs\python\lib\site-packages (4.0.10)

from interactive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.