Skip to content

Conversation

tkf
Copy link
Member

@tkf tkf commented Nov 8, 2018

If a package installed via Conda.add is not available for installed
Python version, conda may downgrade Python:
https://discourse.julialang.org/t/help-understanding-pycall-related-travis-failure/15957

This breaks PyCall because it stores the path to libpython etc. This patch provides a workaround to the issue by adding an API that wraps Conda.add and re-build PyCall if Python version is changed during installation of conda packages. I suggest to recommend this API over pyimport_conda.

Proposed API:

conda_add(packages::AbstractVector{<: AbstractString})

Install conda pakcages if PyCall is configured to use Conda.jl; otherwise this function does nothing. It is intended to be used from deps/build.jl of the packages depending on PyCall, for safely installing Python packages via conda. More precisely, this function detects if Python executable is re-installed during installing packages and then re-build PyCall if it happens.

fix JuliaPy/Conda.jl#127
fix JuliaPy/PyPlot.jl#382

If a package installed via `Conda.add` is not available for installed
Python version, `conda` may downgrade Python:
https://discourse.julialang.org/t/help-understanding-pycall-related-travis-failure/15957

This breaks PyCall because it stores the path to libpython etc.  This
patch provides a workaround to the issue by adding an API that wraps
`Conda.add` and re-build PyCall if Python version is changed during
installation of conda packages.

fix JuliaPy/Conda.jl#127

before = Conda.version("python")
for pkg in packages
Conda.add(pkg)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: switch to Conda.add(packages) once the Conda.jl version containing JuliaPy/Conda.jl#130 is released.

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

Successfully merging this pull request may close these issues.

Conda.add may downgrade Python automatically rebuild on Python update
1 participant