0

installed Python 3.7.3 and Anaconda and tried to activate it in the Anaconda Prompt.

activate %PATH%

but i get the error

activate does not accept more than one argument

What can I do about it ?

Da Nickste
  • 61
  • 1
  • 2
  • 8
  • 1
    Why you're passing your PATH variable to the activate command? you shall pass the conda.sh path to that. – Farhood ET Jun 09 '19 at 07:52
  • So I tried : activate C:\Users\Ich\Anaconda3\etc\profile.d\conda.sh .But then i get the error "Not a conda environment" – Da Nickste Jun 09 '19 at 07:56
  • Possible duplicate? https://stackoverflow.com/questions/20081338/how-to-activate-an-anaconda-environment – Finomnis Jun 09 '19 at 08:00

4 Answers4

1

I think you didn't quite understand how conda works.

In conda, you need to first create your own environment. In this case, let's call it my_env.

conda create -n my_env python

Then, you can activate that environment with

conda activate my_env

Also, pay attention that the conda precedes the activate, using activate directly is obsolete.

Finomnis
  • 18,094
  • 1
  • 20
  • 27
0

If you have space in path, please try this

activate "C:\Users\USER\New Project\"

Generally you have to specify the conda env full path. enter image description here

Uzzal Podder
  • 2,925
  • 23
  • 26
  • same error "activate does not accept more than one argument ..." – Da Nickste Jun 09 '19 at 08:03
  • I generally activate conda using full path . have a look https://stackoverflow.com/questions/46929791/activating-conda-environment-with-its-full-path – Uzzal Podder Jun 09 '19 at 08:03
  • I have added a photo in edited answers. it works for me – Uzzal Podder Jun 09 '19 at 08:09
  • 1
    You only have to specify the full path if you don't use the default path. Otherwise you can just have the environment name as argument. – Finomnis Jun 09 '19 at 08:10
  • For demonstration I have showed you this image. But, in my work I have three servers, and a common shared filesystem. In that file system I keep my conda environment. when I try to access from other two server, I have no options to add `short environment name`, but `full path`. The other two server has only conda installed, but no information about the conda environment in the shared folder. I activate using full path. – Uzzal Podder Jun 09 '19 at 08:13
  • 1
    I don't think conda is meant to share environments between machines ... It only works if the different machines have the *exact* same setup. Isn't the beauty of conda that you can reproduce the same environment without needing a shared folder? – Finomnis Jun 09 '19 at 08:37
0

yes writing your argument in a closed quote worked for me if there is a space in between characters. So here's what I did with my issue:

>>> conda activate "C:\Users\Name\Desktop\sample_project_1\env"
JayPeerachai
  • 3,499
  • 3
  • 14
  • 29
0

If you use Linux you can start conda with command (assuming that conda was installed @ ~/miniconda3/)

source ~/miniconda3/bin/activate
or
source [conda_install_path]/bin/activate 
or
source [conda_install_path]/bin/activate base

By default, (base) virtual environment is loaded. You can switch to a different environment by

conda activate [env_name]

A sorter path is to type directly

source [conda_install_path]/bin/activate [env_name]

As usual, you can avoid re-typing activation commands every time by augmenting the .bash_rc script