Code Monkey home page Code Monkey logo

pixi-kernel's Introduction

Pixi Kernel

Pixi Badge Binder GitHub Actions Ruff

Per-directory Pixi environments with multi-language Jupyter kernels.

JupyterLab launcher screen showing Pixi Kernel

Pixi Kernel supports Python 3.8+ and Pixi 0.18+ using pyproject.toml and pixi.toml configurations.

Disclaimer: This project is not affiliated with Pixi, and not an official Pixi plugin.

Quick Start

This assumes you want a Python kernel. For other languages, check the Kernel support table and replace ipykernel with the desired kernel package.

  1. Install Pixi and pixi-kernel alongside JupyterLab using pixi, pip or any other conda or pip-based package manager.
  2. Restart JupyterLab.
  3. Create a new directory and initialize a Pixi project with pixi init and pixi add ipykernel.
  4. Restart the kernel and you are good to go.

See the Pixi docs for more information on how to use Pixi.

Kernel support

Pixi Kernel supports the following kernels:

Language Kernel Package name
Bash Bash Kernel bash_kernel
C++ Xeus Cling xeus-cling
Python IPython Kernel ipykernel
R IR Kernel r-irkernel

Support for other kernels and languages can be added by opening an issue or a pull request. Check the contributing guide for more information on adding new kernels.

mybinder.org

You can try Pixi Kernel on mybinder.org by clicking the badge at the top of this README. Check pixi-kernel-binder for how to set up a Binder repository with Pixi Kernel.

Limitations

Pixi Kernel does not support using Pixi environments other than the default one. If you have an idea how to support this, please open an issue or check the contributing guide to open a pull request.

Related

pixi-kernel's People

Contributors

renan-r-santos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

abkfenris

pixi-kernel's Issues

Not working with R kernel without lib paths

Hi Renan! Really awesome that you're getting the multi-kernel support up and running!

I'm having issues getting the R kernel working without specifying the R_LIBS/R_LIBS_USER paths first. I think you should probably be able to use the kernel even without manually having to specify that yourself. Do you think there could be a way around that?
Otherwise, I think it would be worth documenting.

Steps to reproduce:

pixi init
pixi add jupyter pixi-kernel r-irkernel r-base
pixi run jupyter lab

Then start a notebook with a Pixi-R kernel. I get the following output:

[I 2024-04-12 20:16:28.141 ServerApp] [pixi-kernel] found Pixi 0.19.1
[I 2024-04-12 20:16:28.177 ServerApp] [pixi-kernel] project manifest path: /Users/roaldarbol/Downloads/test-jupy/pixi.toml
[I 2024-04-12 20:16:28.178 ServerApp] [pixi-kernel] launching kernel: ['pixi', 'run', '--manifest-path=/Users/roaldarbol/Downloads/test-jupy/pixi.toml', 'R', '--slave', '-e', "'IRkernel::main()'", '--args', '/Users/roaldarbol/Library/Jupyter/runtime/kernel-8327278f-a84f-4ed3-81b4-13999f630639.json']
[I 2024-04-12 20:16:28.208 ServerApp] Kernel started: 8327278f-a84f-4ed3-81b4-13999f630639
Warning: namespacepbdZMQis not available and has been replaced
by .GlobalEnv when processing object ‘.pbd_envError in library.dynam(lib, package, package.lib) : 
  shared objectdigest.dylibnot found
Calls: loadNamespace -> namespaceImport -> loadNamespace -> library.dynam
Execution halted
[I 2024-04-12 20:16:34.188 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new random ports
[I 2024-04-12 20:16:34.228 ServerApp] [pixi-kernel] found Pixi 0.19.1
[I 2024-04-12 20:16:34.259 ServerApp] [pixi-kernel] project manifest path: /Users/roaldarbol/Downloads/test-jupy/pixi.toml
[I 2024-04-12 20:16:34.259 ServerApp] [pixi-kernel] launching kernel: ['pixi', 'run', '--manifest-path=/Users/roaldarbol/Downloads/test-jupy/pixi.toml', 'R', '--slave', '-e', "'IRkernel::main()'", '--args', '/Users/roaldarbol/Library/Jupyter/runtime/kernel-8327278f-a84f-4ed3-81b4-13999f630639.json']
Warning: namespacepbdZMQis not available and has been replaced
by .GlobalEnv when processing object ‘.pbd_envError in library.dynam(lib, package, package.lib) : 
  shared objectdigest.dylibnot found
Calls: loadNamespace -> namespaceImport -> loadNamespace -> library.dynam
Execution halted
[I 2024-04-12 20:16:40.271 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (2/5), new random ports
[I 2024-04-12 20:16:40.300 ServerApp] [pixi-kernel] found Pixi 0.19.1
[I 2024-04-12 20:16:40.333 ServerApp] [pixi-kernel] project manifest path: /Users/roaldarbol/Downloads/test-jupy/pixi.toml
[I 2024-04-12 20:16:40.333 ServerApp] [pixi-kernel] launching kernel: ['pixi', 'run', '--manifest-path=/Users/roaldarbol/Downloads/test-jupy/pixi.toml', 'R', '--slave', '-e', "'IRkernel::main()'", '--args', '/Users/roaldarbol/Library/Jupyter/runtime/kernel-8327278f-a84f-4ed3-81b4-13999f630639.json']
Warning: namespacepbdZMQis not available and has been replaced
by .GlobalEnv when processing object ‘.pbd_envError in library.dynam(lib, package, package.lib) : 
  shared objectdigest.dylibnot found
Calls: loadNamespace -> namespaceImport -> loadNamespace -> library.dynam
Execution halted
[I 2024-04-12 20:16:46.343 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (3/5), new random ports
[I 2024-04-12 20:16:46.388 ServerApp] [pixi-kernel] found Pixi 0.19.1
[I 2024-04-12 20:16:46.422 ServerApp] [pixi-kernel] project manifest path: /Users/roaldarbol/Downloads/test-jupy/pixi.toml
[I 2024-04-12 20:16:46.422 ServerApp] [pixi-kernel] launching kernel: ['pixi', 'run', '--manifest-path=/Users/roaldarbol/Downloads/test-jupy/pixi.toml', 'R', '--slave', '-e', "'IRkernel::main()'", '--args', '/Users/roaldarbol/Library/Jupyter/runtime/kernel-8327278f-a84f-4ed3-81b4-13999f630639.json']
Warning: namespacepbdZMQis not available and has been replaced
by .GlobalEnv when processing object ‘.pbd_envError in library.dynam(lib, package, package.lib) : 
  shared objectdigest.dylibnot found
Calls: loadNamespace -> namespaceImport -> loadNamespace -> library.dynam
Execution halted
[I 2024-04-12 20:16:52.434 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (4/5), new random ports
[I 2024-04-12 20:16:52.476 ServerApp] [pixi-kernel] found Pixi 0.19.1
[I 2024-04-12 20:16:52.508 ServerApp] [pixi-kernel] project manifest path: /Users/roaldarbol/Downloads/test-jupy/pixi.toml
[I 2024-04-12 20:16:52.508 ServerApp] [pixi-kernel] launching kernel: ['pixi', 'run', '--manifest-path=/Users/roaldarbol/Downloads/test-jupy/pixi.toml', 'R', '--slave', '-e', "'IRkernel::main()'", '--args', '/Users/roaldarbol/Library/Jupyter/runtime/kernel-8327278f-a84f-4ed3-81b4-13999f630639.json']
Warning: namespacepbdZMQis not available and has been replaced
by .GlobalEnv when processing object ‘.pbd_envError in library.dynam(lib, package, package.lib) : 
  shared objectdigest.dylibnot found
Calls: loadNamespace -> namespaceImport -> loadNamespace -> library.dynam
Execution halted
[I 2024-04-12 20:16:58.520 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (5/5), new random ports
[I 2024-04-12 20:16:58.561 ServerApp] [pixi-kernel] found Pixi 0.19.1
[I 2024-04-12 20:16:58.592 ServerApp] [pixi-kernel] project manifest path: /Users/roaldarbol/Downloads/test-jupy/pixi.toml
[I 2024-04-12 20:16:58.592 ServerApp] [pixi-kernel] launching kernel: ['pixi', 'run', '--manifest-path=/Users/roaldarbol/Downloads/test-jupy/pixi.toml', 'R', '--slave', '-e', "'IRkernel::main()'", '--args', '/Users/roaldarbol/Library/Jupyter/runtime/kernel-8327278f-a84f-4ed3-81b4-13999f630639.json']
Warning: namespacepbdZMQis not available and has been replaced
by .GlobalEnv when processing object ‘.pbd_envError in library.dynam(lib, package, package.lib) : 
  shared objectdigest.dylibnot found
Calls: loadNamespace -> namespaceImport -> loadNamespace -> library.dynam
Execution halted
[W 2024-04-12 20:17:04.603 ServerApp] AsyncIOLoopKernelRestarter: restart failed
[W 2024-04-12 20:17:04.603 ServerApp] Kernel 8327278f-a84f-4ed3-81b4-13999f630639 died, removing from map.
[W 2024-04-12 20:17:28.229 ServerApp] Timeout waiting for kernel_info reply from 8327278f-a84f-4ed3-81b4-13999f630639

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.