# Error Connecting Julia to Python Jupyter Notebook

**URL:** <https://discourse.julialang.org/t/error-connecting-julia-to-python-jupyter-notebook/109226>\
**Category:** New to Julia\
**Created:** [January 25, 2024, 12:07am UTC](https://discourse.julialang.org/t/error-connecting-julia-to-python-jupyter-notebook/109226 "2024-01-25T00:07:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdas123](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdas123/32/32142_2.png) [@bdas123](https://discourse.julialang.org/u/bdas123)\
**Post date:** [January 25, 2024, 12:07am UTC](https://discourse.julialang.org/t/error-connecting-julia-to-python-jupyter-notebook/109226/1 "2024-01-25T00:07:32Z")

</div>

When I run the code from a Python 3.6.9 Jupyter Notebook, the kernel dies:

```julia
from julia.api import Julia
jl = Julia(compiled_modules=False)
from julia import Main

```

My goal is to have a Julia subroutine that will be called in the middle of Python code.

---

<div class="post-metadata">

**Author:** ![James\_Rioux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/james_rioux/32/206585_2.png) [@James\_Rioux](https://discourse.julialang.org/u/James_Rioux)\
**Post date:** [May 28, 2024, 3:29pm UTC](https://discourse.julialang.org/t/error-connecting-julia-to-python-jupyter-notebook/109226/2 "2024-05-28T15:29:07Z")

</div>

Did you ever figure out how to make this work? I am trying to do the same thing but am getting kernel restarts when running any of the commands

> jl = Julia() # with or without compiled\_modules=False  
> from julia import Pkg  
> from julia import Main

All of these run fine from a python session outside jupyter, so I don’t think it’s anything fundamentally wrong with the Julia installation. I can run JuliaInfo from within the notebook, and things like bindir and libpython\_path look correct. Any suggestions on fixing or debugging this would be appreciated!
