13

I have miniconda 3 installation and want to create conda environment with Python 3.4. I used the command: conda create -n myenv python=3.4 and get the error:

PackagesNotFoundError: The following packages are not available from current channels:
  - python=3.4

I tried to change the version to 3.7, typing conda create -n myenv python=3.7 There was no error with version 3.7. So the problem seems to be related with the older versions of python.

This is the full output with the error message:

Collecting package metadata (current_repodata.json): done
Solving environment: failed
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/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/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.
ABC
  • 175
  • 1
  • 1
  • 8
  • In your anaconda prompt, type in `conda search python`. Are there versions for 3.4 in there? – Clusks Jul 02 '19 at 11:18
  • No, actually, there is no version 3.4 at all. I thought there should be any python version in the default channels. If 'https://repo.anaconda.com/pkgs' is the default channel at all. – ABC Jul 02 '19 at 11:46

4 Answers4

26

The reason you are not able to install python 3.4 package is that it is not available in the default channel of anaconda from where you are trying to install.

However, I just checked that it is available in the conda-forge channel. So, it can be installed as below:

conda create -n myenv python=3.4 -c conda-forge

Ashwin Geet D'Sa
  • 3,227
  • 14
  • 32
1

It seems to me that Python 3.4 is not available in any of your listed repositories. I've tried to create an environment with it in Anaconda and it worked. Try to update Miniconda first:

conda update -n base -c defaults conda

If it does not work, look for a repository containing Python 3.4 and add it to your list of repositories.

W Barreto
  • 358
  • 2
  • 10
  • I updated Miniconda as suggested and after that, Anaconda Prompt disappeared from the Windows Start Menu. So, now I cannot even open it. I tried restarting the computer but this did not help. – ABC Jul 02 '19 at 12:01
  • That is very odd. Have you checked whether still installed? If that's the case, you can link it back to the start menu. – W Barreto Jul 02 '19 at 13:25
  • Yes, I believe it is still installed. I still have my C:\Users\petar\Miniconda3 folder and a lot of stuff in there including python.exe. How to find the files which start Anaconda prompt and Anaconda PowerShell Prompt so that I can re-create shortcuts in the start menu? – ABC Jul 02 '19 at 14:30
  • They should be in 'C:\Users\"Username"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\"Conda folder" ' – W Barreto Jul 02 '19 at 14:40
  • OK, this is the path to the start menu folder. But where are the executable files which the shortcuts should point at to? – ABC Jul 03 '19 at 05:40
  • The executables are in C:\Users\"Username"\AppData\Local\Continuum\anaconda3 but the prompt for example you can only access via shortcut as Anaconda's prompt is basically cmd.exe with Anaconda's parameters. If you simply copy the shortcuts back to the start menu, you should be fine. – W Barreto Jul 03 '19 at 07:51
  • There is no sub folder called Continuum in C:\Users\"Username"\AppData\Local. Maybe my Miniconda is corrupted and it is better to uninstall it and install a fresh copy. By the way, you suggested to 'look for a repository containing Python 3.4'. How to do that? – ABC Jul 03 '19 at 12:01
  • AppData is usually a hidden folder so you will not be able to see it if your Explorer is configured not to show hidden files/folders. Repositories are the web addresses where the apps/libraries are stored. Your Anaconda installation has a list of repositories and each repository has files/libraries that are called by Anaconda when you type "conda install ...". If Python 3.4 is not available when you create a new environment, it may not be in any of the repositories available, which I find quite odd. Have you tried "conda create --name myenv python=3.4"? – W Barreto Jul 03 '19 at 14:04
  • A know about hidden folders. I went to C:\Users\"Username"\AppData\Local and there were no Continuum sub-folder there. No, I cannot try it because I cannot open Anaconda prompt. – ABC Jul 04 '19 at 08:43
  • I found how to restore the Windows Start Menu shortcut to Anaconda Prompt. This discussion provided the answer: https://github.com/ContinuumIO/anaconda-issues/issues/8794. See the comment by owen-synergy on Jul 23. – ABC Sep 03 '19 at 14:16
0

what you can try is update and search python interpreter versions:

Step1:

conda update conda

Step2:

conda search "^python$"

It will list all the available versions:

python                     3.4.0                         0  defaults
python                     3.4.1                         0  defaults
python                     3.4.1                         1  defaults
python                     3.4.1                         2  defaults
python                     3.4.1                         3  defaults
python                     3.4.1                         4  defaults
python                     3.4.2                         0  defaults
python                     3.4.3                         0  defaults
python                     3.4.3                         2  defaults
python                     3.4.4                         0  defaults
python                     3.4.4                         5  defaults
python                     3.4.5                         0  defaults

Then install based on the existing versions.

Haifeng Zhang
  • 24,348
  • 16
  • 55
  • 104
0

You can try this if its helpful..

  1. open Anaconda Navigator
  2. Go to Environment tab
  3. Click on "+Create"
  4. Choose your preference python package, give it name and save it.
  5. Open Anaconda prompt and type (base) C:\User\XXXX > conda info --envs
  6. You will your environment name therein
  7. To activate that environment type (base) C:\User\XXXX > conda activate "your env. name"
  8. You will find your environment been activated. And now line will show like ("your env. name")C:\User\XXXX >
  9. Enjoy !