Skip to content
Advertisement

Anaconda/conda/python/Windows: how to start and activate a conda environment?

I have Python 3.5 (3.5.6) installed via Anaconda, and now I’d like to be able to use Python 3.7, keeping 3.5 as the default (the one python "insert script name" would run on the command line). I commanded the computer to activate it, but it isn’t working.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:WINDOWSsystem32> conda create --name seiska python=3.7
WARNING: A space was detected in your requested environment path
'C:Program FilesAnaconda3envsseiska'
Spaces in paths can sometimes be problematic.
Solving environment: done

## Package Plan ##

  environment location: C:Program FilesAnaconda3envsseiska

  added / updated specs:
    - python=3.7


The following NEW packages will be INSTALLED:

    ca-certificates: 2018.03.07-0
    certifi:         2018.10.15-py37_0
    openssl:         1.1.1a-he774522_0
    pip:             18.1-py37_0
    python:          3.7.1-he44a216_5
    setuptools:      40.6.2-py37_0
    vc:              14.1-h0510ff6_4
    vs2015_runtime:  14.15.26706-h3a45250_0
    wheel:           0.32.3-py37_0
    wincertstore:    0.2-py37_0

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > activate seiska
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#

PS C:WINDOWSsystem32> activate seiska
PS C:WINDOWSsystem32> python
Python 3.5.6 |Anaconda 4.2.0 (64-bit)| (default, Aug 26 2018, 16:05:27) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Advertisement

Answer

In the Start menu you have to open “Anaconda Prompt” which is different from the Normal “Command Prompt”. Your environment gets activated from there. And then execute activate <env-name>

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement