Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative Path does not work with ENV["PYTHON"] #929

Closed
roflmaostc opened this issue Oct 18, 2021 · 2 comments
Closed

Relative Path does not work with ENV["PYTHON"] #929

roflmaostc opened this issue Oct 18, 2021 · 2 comments

Comments

@roflmaostc
Copy link

Doing

julia> ENV["PYTHON"] = "../thorlabs/thorlabs_env/bin/python"
"../thorlabs/thorlabs_env/bin/python"

julia> Pkg.build("PyCall")
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/299304989a5e6473d985212c28928899c74e9421/build.log`
    Building PyCall → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/169bb8ea6b1b143c5cf57df6d34d022a7b60c6db/build.log`
Precompiling project...
  1 dependency successfully precompiled in 4 seconds (216 already precompiled)

results in:

cat ~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/169bb8ea6b1b143c5cf57df6d34d022a7b60c6db/build.log                  [18-10-21 | 7:16:00]
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

# All requested packages already installed.

┌ Info: No system-wide Python was found; got the following error:
│ Base.IOError("could not spawn setenv(`../thorlabs/thorlabs_env/bin/python -c

[................]

└ using the Python distribution in the Conda package
[ Info: Running `conda install -y numpy` in root environment
[ Info: PyCall is using /home/fxw/.julia/conda/3/bin/python (Python 3.7.6) at /home/fxw/.julia/conda/3/bin/python, libpython = /home/fxw/.julia/conda/3/lib/libpython3.7m.so.1.0
[ Info: /home/fxw/.julia/packages/PyCall/BD546/deps/deps.jl has been updated
[ Info: /home/fxw/.julia/prefs/PyCall has been updated

Setting a full path

julia> ENV["PYTHON"] = "/home/fxw/thorlabs/thorlabs_env/bin/python"
"/home/fxw/Documents/Uni/my_projects/Duke_Sensor_Array/thorlabs/thorlabs_env/bin/python"

julia> Pkg.build("PyCall")
    Building Conda ─ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/299304989a5e6473d985212c28928899c74e9421/build.log`
    Building PyCall  `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/169bb8ea6b1b143c5cf57df6d34d022a7b60c6db/build.log`
Precompiling project...
  1 dependency successfully precompiled in 4 seconds (216 already precompiled)

results in

cat ~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/169bb8ea6b1b143c5cf57df6d34d022a7b60c6db/build.log                  [18-10-21 | 7:16:02]
[ Info: PyCall is using /home/fxw/thorlabs/thorlabs_env/bin/python (Python 3.9.7) at /home/fxw/Documents/Uni/my_projects/Duke_Sensor_Array/thorlabs/thorlabs_env/bin/python, libpython = /usr/lib/libpython3.9.so.1.0
[ Info: /home/fxw/.julia/packages/PyCall/BD546/deps/deps.jl has been updated
[ Info: /home/fxw/.julia/prefs/PyCall has been updated
@stevengj
Copy link
Member

It's not supposed to work. Paths in environment variables essentially always need to be absolute paths.

@roflmaostc
Copy link
Author

roflmaostc commented Oct 19, 2021

OK, good to know that.

I also opened issue so that other people can find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants