JuliaPy / pyjuliapkg

Manage your Julia dependencies from Python
MIT License
45 stars 12 forks source link

Both julia and juliaup are in my path, but still juliapkg downloads a new version of julia #14

Closed pauwiersma closed 1 year ago

pauwiersma commented 1 year ago
(ewatercycle_spyder) tesla-k20c@teslak20c:~$ julia --version
julia version 1.5.4
(ewatercycle_spyder) tesla-k20c@teslak20c:~$ juliaup status
 Default  Channel  Version                Update
-----------------------------------
       *  1.5      1.5.4+0.x64.linux.gnu
          1.6.7    1.6.7+0.x64.linux.gnu
(ewatercycle_spyder) tesla-k20c@teslak20c:~$ python
Python 3.10.2 | packaged by conda-forge | (main, Feb  1 2022, 19:28:35) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> **import juliapkg**
>>> juliapkg.status()
JuliaPkg Status
/home/tesla-k20c/.conda/envs/ewatercycle_spyder/julia_env/pyjuliapkg/juliapkg.json
Not resolved (resolve for more information)
Julia (^1.5)
>>> juliapkg.resolve()
[juliapkg] Locating Julia ^1.6.1
[juliapkg] Querying Julia versions from https://julialang-s3.julialang.org/bin/versions.json
[juliapkg] Using Julia 1.8.5 at /home/tesla-k20c/.conda/envs/ewatercycle_spyder/julia_env/pyjuliapkg/install/bin/julia

I need julia version 1.5, but even though julia and juliaup are in my path juliapkg installs a new version. What am I missing here? Thanks in advance.

cjdoris commented 1 year ago

Hi, sorry for the slow reply but from your other issue it looks like you've figured this out now so closing.

pauwiersma commented 1 year ago

Hi no problem, thanks for replying. I'm not sure if this issue is fixed though. From the documentation I had the impression that any Julia installation that is in the PATH will be selected, without first checking juliapkg.json. This is still not happening in my case. But if juliapkg.json is always checked and the version specified there is looked for in the PATH, then it did work and this issue can indeed be closed.

cjdoris commented 1 year ago

JuliaPkg always checks juliapkg.json and will refuse to use an incompatible version of Julia. Hence the readme says "If julia is in your PATH, and is compatible, that is used."

pauwiersma commented 1 year ago

Got it, thanks!

dpinol commented 5 months ago

In my case I had no juliapkg.json, I had julia 1.9 on my PATH, and it still tried to upgrade. I can understand this behaviour, but I think it should be documented. thanks