# Best way to configure a project-dependent PyCall dependency?

**URL:** <https://discourse.julialang.org/t/best-way-to-configure-a-project-dependent-pycall-dependency/119802>\
**Category:** Package Management\
**Created:** [September 24, 2024, 9:34am UTC](https://discourse.julialang.org/t/best-way-to-configure-a-project-dependent-pycall-dependency/119802 "2024-09-24T09:34:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabrio\_Rizzuti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gabrio_rizzuti/32/212164_2.png) [@Gabrio\_Rizzuti](https://discourse.julialang.org/u/Gabrio_Rizzuti)\
**Post date:** [September 24, 2024, 9:34am UTC](https://discourse.julialang.org/t/best-way-to-configure-a-project-dependent-pycall-dependency/119802/1 "2024-09-24T09:34:33Z")

</div>

First of all, sorry if this too much of a basic question, but I coudn’t find an answer despite multiple searches.

I’m trying to develop a glue package that exposes some Python functionalities to Julia. Simple stuff.

I assume there is a pre-existing conda environment and I’d like to add PyCall as a dependency for this project and point it to this environment.

Is there a simple way to do this without changing the behaviour of PyCall globally? So far, building PyCall by playing with environment variables will modify PyCall for _all_ my projects.

Otherwise, are there alternative solutions to this problem?

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [September 24, 2024, 10:31am UTC](https://discourse.julialang.org/t/best-way-to-configure-a-project-dependent-pycall-dependency/119802/2 "2024-09-24T10:31:52Z")

</div>

I think PythonCall.jl might be a solution to your problem, because its handling of environments is more local (but I’m not 100% certain). These days it is often presented as a more mature alternative to PyCall.jl anyway, so worth looking into.

> **[GitHub - JuliaPy/PythonCall.jl: Python and Julia in harmony.](https://github.com/JuliaPy/PythonCall.jl)**
>
> Python and Julia in harmony.

---

<div class="post-metadata">

**Author:** ![ako](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@ako](https://discourse.julialang.org/u/ako)\
**Post date:** [September 25, 2024, 2:54am UTC](https://discourse.julialang.org/t/best-way-to-configure-a-project-dependent-pycall-dependency/119802/3 "2024-09-25T02:54:35Z")

</div>

+1 for PythonCall.

The best option IMO is to use it with CondaPkg.jl for dependencies (see [Guide · PythonCall & JuliaCall](https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#python-deps) for details). This way is more useful if you need CI, deploys, etc.

Please don’t hesitate to ask here if you found issues.
