linuxdeploy-plugin-conda icon indicating copy to clipboard operation
linuxdeploy-plugin-conda copied to clipboard

Env var for using specific Python version

Open TheLastProject opened this issue 7 years ago • 11 comments

It'd be great to have something like CONDA_PYTHON_VERSION or so to be able to explicitly request for example 3.6 instead of 3.7. In my case, one of my dependencies doesn't build on 3.7 yet, and conda upgraded from 3.6 to 3.7, so now my build is broken with seemingly nothing I can do.

TheLastProject avatar Oct 12 '18 19:10 TheLastProject

Good idea.

Right now, we're downloading some "miniconda v3 latest" script. Any idea how we could request a version explicitly?

TheAssassin avatar Oct 12 '18 19:10 TheAssassin

Miniconda's version script differs from Python's. See https://repo.continuum.io/miniconda/.

TheAssassin avatar Oct 12 '18 19:10 TheAssassin

You can use conda create -n envname anaconda python=3.6 and instead of using activate use activate envname. Would probably only be a very small change actually.

TheLastProject avatar Oct 12 '18 19:10 TheLastProject

Actually, I think anaconda shouldn't be in that command. Documentation is a bit weird.

TheLastProject avatar Oct 12 '18 19:10 TheLastProject

I see. I will test a bit.

Shall we recognize and support Python 2 as well?

TheAssassin avatar Oct 12 '18 19:10 TheAssassin

Well, that'll make things slightly more complex I suppose, but it's a logical next step letting people use 2 for "latest python 2"

TheLastProject avatar Oct 12 '18 19:10 TheLastProject

My idea was to download the Python 2 miniconda script if the version begins with 2, and if it's exactly 2 just use the latest, otherwise install a version explicitly.

TheAssassin avatar Oct 12 '18 20:10 TheAssassin

Sounds good yeah

TheLastProject avatar Oct 12 '18 20:10 TheLastProject

Let's first focus on the Python 3 aspects.

TheAssassin avatar Oct 12 '18 20:10 TheAssassin

Tested adding a call like conda install python=<version>. This doesn't "just work" with older versions like 3.4:

Warning: 'conda-forge' already in 'channels' list, moving to the top
Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - conda[version='>=4.5.11'] -> pycosat[version='>=0.6.3'] -> python[version='>=3.6,<3.7.0a0']
  - python=3.4
Use "conda info <package>" to see the dependencies for each package.

I don't know how to map "conda script version" to "works for python version". Ideas welcome.

TheAssassin avatar Oct 12 '18 20:10 TheAssassin

My idea was more based around #5.

TheLastProject avatar Oct 12 '18 21:10 TheLastProject