# Bad interaction between IJulia and PythonCall (CondaPkg)?

**URL:** <https://discourse.julialang.org/t/bad-interaction-between-ijulia-and-pythoncall-condapkg/132109>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 4, 2025, 5:31pm UTC](https://discourse.julialang.org/t/bad-interaction-between-ijulia-and-pythoncall-condapkg/132109 "2025-09-04T17:31:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [September 4, 2025, 5:31pm UTC](https://discourse.julialang.org/t/bad-interaction-between-ijulia-and-pythoncall-condapkg/132109/1 "2025-09-04T17:31:38Z")

</div>

- IJulia in global environment
- A project environment that depends on PythonCall (and not IJulia)

Because the limitation of IJulia, at the beginning of a Jupyter notebook, I have to do:

```julia-auto
using Pkg
Pkg.activate(<pkg dir>)

```

Now, it appears that `using PythonCall` would fail in the notebook, unless I run:

```julia-auto
using CondaPkg
CondaPkg.resolve()

# load PythonCall

```

Here’s the problem, after doing the above, now this fails:

```julia-auto
julia --project=<pkg dir>
using PythonCall

```

and again, I have to do `CondaPkg.resolve()` in this REPL, which now makes the Jupyter notebook fail the next time.

So it seems to be some cache invalidation between the two ways of interacting with CondaPkg – is there a solution?

In both cases, the error looks like:

```julia-auto
julia> using PythonCall
    CondaPkg Found dependencies: /home/jiling/BjetTLA/CondaPkg.toml
ERROR: InitError: expected package `Measurements [eff96d63]` to exist in the manifest (use `resolve` to populate the manifest)
Stacktrace:
  [1] pkgerror(::String, ::Vararg{String})
    @ Pkg.Types ~/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/Types.jl:68
  [2] package_info
    @ ~/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:56 [inlined]
  [3] #9
    @ ./none:0 [inlined]
  [4] iterate
    @ ./generator.jl:48 [inlined]
  [5] Dict{Base.UUID, Pkg.API.PackageInfo}(kv::Base.Generator{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}})
    @ Base ./dict.jl:95
  [6] dict_with_eltype
    @ ./abstractdict.jl:636 [inlined]
  [7] dict_with_eltype
    @ ./abstractdict.jl:643 [inlined]
  [8] Dict
    @ ./dict.jl:117 [inlined]
  [9] dependencies
    @ ~/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:86 [inlined]
 [10] dependencies()
    @ Pkg.API ~/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/src/API.jl:83
 [11] _resolve_find_dependencies(io::Any, load_path::Any)
    @ CondaPkg ~/.julia/packages/CondaPkg/JnPvc/src/resolve.jl:363
 [12] resolve(; force::Bool, io::IO, interactive::Bool, dry_run::Bool)
    @ CondaPkg ~/.julia/packages/CondaPkg/JnPvc/src/resolve.jl:845
 [13] resolve()
    @ CondaPkg ~/.julia/packages/CondaPkg/JnPvc/src/resolve.jl:764
 [14] envdir()
    @ CondaPkg ~/.julia/packages/CondaPkg/JnPvc/src/env.jl:70
 [15] init_context()
    @ PythonCall.C ~/.julia/packages/PythonCall/IOKTD/src/C/context.jl:63

```

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 4, 2025, 6:28pm UTC](https://discourse.julialang.org/t/bad-interaction-between-ijulia-and-pythoncall-condapkg/132109/2 "2025-09-04T18:28:22Z")

</div>

Can’t you just add IJulia to your project environment, and then [install a custom kernel](https://julialang.github.io/IJulia.jl/stable/manual/installation/#Installing-and-customizing-kernels) that runs IJulia with `--project=...` to start it in your project environment?

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [September 4, 2025, 9:26pm UTC](https://discourse.julialang.org/t/bad-interaction-between-ijulia-and-pythoncall-condapkg/132109/3 "2025-09-04T21:26:38Z")

</div>

i guess I personally can but it’s quite convoluted for other users that rely on the environmentally installed IJulia
