JuliaPy / PyCall.jl

Package to call Python functions from the Julia language
MIT License
1.47k stars 187 forks source link

PyCall build silenty fails to use virtualenv if ENV["PYTHON"] set incorrectly. #908

Open haberdashPI opened 3 years ago

haberdashPI commented 3 years ago

Hi there, I think it would be good to have a warning if ENV["PYTHON"] does not point to a python binary. I was setting it to the location of the virtual environment, without the bin/python appended to the end. This caused PyCall to build for the Conda.jl setup, without reporting why the virtual environment I wanted to use wasn't being picked up. It took me more time than I'm comfortable admitting to realize the problem 😬 .

This sounds pretty simple to fix. If it's agreeable, I'd be happy to write a small PR to add a warning when ENV["PYTHON"] (or ENV["PYCALL_JL_RUNTIME_PYTHON"]) do not point to a valid binary.