3

Since the deprecation of Python 3.4, conda has removed it from its package list. Is there a way, however, that I can install it?

I need it in order to use software written in this older version.

EDIT: My question is different than the suggested duplicate one, because I am referring to deprecated and unsupported versions. I already know how to create a conda environment with a specific python version, but executing:

conda create --name py34env python=3.4

results in error (listed in the end), which is due to the lack of the package for Python 3.4 . One can see the currently supported versions of Python by executing: conda search python and can confirm that Python 3.4 is not on the list.

This is the output of the error when trying to create a Python 3.4 conda enviroment:

$ conda create --name py34env python=3.4
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - python=3.4

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.
pgmank
  • 5,303
  • 5
  • 36
  • 52
  • 1
    Possible duplicate of [How do I install a package for different Python versions in Anaconda?](https://stackoverflow.com/questions/43707369/how-do-i-install-a-package-for-different-python-versions-in-anaconda). Even though Anaconda/MiniConda no longer *run on* older Python versions (i.e., they can't be in **base** env), you can still create environments that run any version [in the repository](https://anaconda.org/anaconda/python/files), which includes everything from 3.3.0 on. In your case, `conda create -n py34 python=3.4` should get you started. – merv Aug 12 '19 at 22:54
  • 1
    Hello @merv, I have already tried the command you suggest and it results in an error because it seems that Anaconda has dropped support for Python 3.4 . See my edited question for more details. – pgmank Aug 15 '19 at 13:31
  • Thanks for adding the extra info! Yeah, I see now it's a Conda 4.7+ thing. – merv Aug 15 '19 at 15:19

1 Answers1

13

When Anaconda dropped it's free channel (technically, Conda 4.7+ just no longer looks there), this resulted in some older package versions that had never been ported to main no longer being accessible.

Option 1: Globally enable free channel searching

However, there is an option to restore access to the free channel, namely restore_free_channel.

# Not generally recommended
conda config --set restore_free_channel True
conda create -n py34 python=3.4

This isn't generally recommended (see blog post), but if you will be working in Python v3.4 frequently and will require other older compatible packages, it might be the best option.

Option 2: Temporarily include free channel

A more temporary solution is to include the free channel using the ad hoc --channel,-c argument. For example,

# slightly better
conda create -n py34 -c defaults -c free python=3.4

Note that I include defaults prior to free so that the latter will only be used if the package cannot be sourced from the former. This assumes the channel_priority setting is set to flexible (the default).

Option 3: Use Conda Forge

Alternatively, Conda Forge has Python v3.4.5, and that won't force you to change a global configuration option.

conda create -n py34 -c conda-forge python=3.4
merv
  • 67,214
  • 13
  • 180
  • 245
  • 3
    I believe that the second solution is the best one, since, as you noted, one does not have to change the global settings. Thanks @merv :) – pgmank Aug 18 '19 at 19:12