linuxdeploy / linuxdeploy-plugin-conda

Python plugin for linuxdeploy. Sets up miniconda in an AppDir and installs user specified packages.
MIT License
29 stars 13 forks source link

Env var for using specific Python version #3

Open TheLastProject opened 5 years ago

TheLastProject commented 5 years ago

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.

TheAssassin commented 5 years ago

Good idea.

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

TheAssassin commented 5 years ago

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

TheLastProject commented 5 years ago

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 commented 5 years ago

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

TheAssassin commented 5 years ago

I see. I will test a bit.

Shall we recognize and support Python 2 as well?

TheLastProject commented 5 years ago

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"

TheAssassin commented 5 years ago

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.

TheLastProject commented 5 years ago

Sounds good yeah

TheAssassin commented 5 years ago

Let's first focus on the Python 3 aspects.

TheAssassin commented 5 years ago

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.

TheLastProject commented 5 years ago

My idea was more based around #5.