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

[Waiting for upstream] Revert pinning Miniconda3-4.5.4 (Python 3.6) on Windows #125

Closed
tkf opened this issue Sep 22, 2018 · 7 comments
Closed

Comments

@tkf
Copy link
Member

tkf commented Sep 22, 2018

This if block I introduced in #124 should be removed once conda can install Python 3.7 packages on Windows properly from Anaconda's default channel:

Conda.jl/src/Conda.jl

Lines 131 to 137 in 7094e2a

if MINICONDA_VERSION == "3"
# Quick fix for:
# * https://github.com/JuliaLang/IJulia.jl/issues/739
# * https://github.com/ContinuumIO/anaconda-issues/issues/10082
# * https://github.com/conda/conda/issues/7789
res = "https://repo.continuum.io/miniconda/Miniconda$(MINICONDA_VERSION)-4.5.4-"
end

Also, this line should be changed to Conda.add("python", env):

Conda.add("python=3.6", env) # 3.7 doesn't work on Windows at the moment

@tkelman Do you know where is the upstream issue we should watch? Is it conda/conda#7789?

@tkelman
Copy link
Contributor

tkelman commented Sep 22, 2018

This isn't an upstream bug any more, it's a behavior change that they're no longer adding to path. Conda.jl needs to activate environments before trying to use things from them.

@tkf
Copy link
Member Author

tkf commented Sep 22, 2018

Is it possible to activate an environment within a process already running? I think PyCall.jl needs to do that (JuliaPy/PyCall.jl#556 (comment)). Is there equivalent of activate_this.py (of virtualenv) in conda?

@tkf
Copy link
Member Author

tkf commented Sep 22, 2018

conda doens't have activate_this.py: conda/conda#2411

@tkf
Copy link
Member Author

tkf commented Sep 22, 2018

I think there are two problems:

  1. conda install ... etc. does not work without activation. This would be easy to solve once conda run returns (resolve #2682 add conda run experimental support conda/conda#7320; presumably, we can just do conda run conda install ...). Unfortunately, it seems Windows support was not added by resolve #2682 add conda run experimental support conda/conda#7320.

  2. PyCall.jl can't import Python packages depending on shared libraries. This probably means we have to modify $PATH at PyCall.__init__()...? Does it even work?

I don't have Windows machine to easily explore the solutions for them so probably I shouldn't have started poking around this problem :)

@stevengj
Copy link
Member

stevengj commented Sep 23, 2018

  1. For running conda, I think it is fine to modify the PATH.

  2. This is only a problem on Windows, right? PyCall configured with Conda.jl (PyCall.conda == true) could call SetDllDirectory or AddDllDirectory on Windows to modify the DLL search path at runtime.

@tkf
Copy link
Member Author

tkf commented Sep 23, 2018

This is only a problem on Windows, right?

Yes, I think so. For *nix, looking at conda shell.posix activate ... output, it only modifies PATH (not LD_LIBRARY_PATH etc.). So using AddDllDirectory in Windows sounds like a good solution.

I just looked at how conda activate command is implemented. I think we just need to add those paths:

            yield prefix.rstrip("\\")
            yield join(prefix, 'Library', 'mingw-w64', 'bin')
            yield join(prefix, 'Library', 'usr', 'bin')
            yield join(prefix, 'Library', 'bin')
            yield join(prefix, 'Scripts')
            yield join(prefix, 'bin')

--- https://github.com/conda/conda/blob/4.6.0b0/conda/activate.py#L399-L404

@tkf
Copy link
Member Author

tkf commented Feb 12, 2020

It looks like #170 fixed this issue. Closing...

@tkf tkf closed this as completed Feb 12, 2020
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

Successfully merging a pull request may close this issue.

3 participants