JuliaPy / PythonCall.jl

Python and Julia in harmony.
https://juliapy.github.io/PythonCall.jl/stable/
MIT License
722 stars 61 forks source link

CondaPkg opt out doesn't work #301

Closed aditya-sengupta closed 4 months ago

aditya-sengupta commented 1 year ago

Affects: PythonCall

Describe the bug Opting out of CondaPkg.jl by setting an environment variable as stated in the documentation doesn't work.

Steps to reproduce: in a directory with a Python venv, run

ENV["JULIA_CONDAPKG_BACKEND"] = "Null"
ENV["JULIA_PYTHONCALL_EXE"] = "./.venv/bin/python"
using PythonCall
pyexec("import sys; print(sys.executable)", Main)

Expected output is /path/to/pwd/.venv/bin/python, actual output is /path/to/pwd/.CondaPkg/env/bin/python.

Your system Please provide detailed information about your system:

(testproject) pkg> status Project TestProject v0.1.0 Status ~/projects/testproject/Project.toml [15e1cf62] NPZ v0.4.3 [6099a3de] PythonCall v0.9.12 [276daf66] SpecialFunctions v2.2.0 [bc48ee85] Tullio v0.3.5



**Additional context**
I'm doing this so I can import a Python library on a local path and keep using modified versions of it, like with `conda develop` or `pip install -e`. I initially got it working by installing in the venv and pyimporting from there, but that doesn't seem to work now. If there's a way to do `conda develop`-style importing from CondaPkg I'd be okay with that too!
cjdoris commented 1 year ago

I can't reproduce this issue. My guess is that you already have PythonCall loaded in the Julia session before you run that code. Perhaps you have using PythonCall in your startup.jl?

github-actions[bot] commented 10 months ago

This issue has been marked as stale because it has been open for 60 days with no activity. If the issue is still relevant then please leave a comment, or else it will be closed in 7 days.

github-actions[bot] commented 10 months ago

This issue has been closed because it has been stale for 7 days. You can re-open it if it is still relevant.

aditya-sengupta commented 4 months ago

Was going back through my old issues and I also found I couldn't reproduce this - I think you were probably right that I had run something in my Julia session before.