How to activate an Anaconda environment
If this happens you would need to set the PATH for your environment (so that it gets the right Python from the environment and Scripts\ on Windows).
Imagine you have created an environment called py33 by using:
conda create -n py33 python=3.3 anaconda
Here the folders are created by default in Anaconda\envs, so you need to set the PATH as:
set PATH=C:\Anaconda\envs\py33\Scripts;C:\Anaconda\envs\py33;%PATH%
Now it should work in the command window:
activate py33
The line above is the Windows equivalent to the code that normally appears in the tutorials for Mac and Linux:
$ source activate py33
More info:
https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/8T8i11gO39U
Does `anaconda` create a separate PYTHONPATH variable for each new environment?
Best way to activate my conda environment for a python script on a windows PC
Not a Windows user, but conda activate
is for interactive shell sessions. The conda run
command is for programmatic execution within an environment. So, you would have a script with a line like:
conda run -n my_env python your_script.py
or possibly
conda run -p /path/to/my_env python your_script.py
if trying to share the environment across users.
If the script requires interaction, you may need to add flags (like --live-stream
and/or --no-capture-output
). See conda run --help
.
How to activate an Anaconda environment from the command line?
To create an environment:
conda create --name myenv
NOTE: Replace myenv with the environment name.
When conda asks you to proceed, type y:
proceed ([y]/n)?for more detail click this
about activate this may help
to add anaconda to path
In Windows, you will have to set the path to the location where you installed Anaconda3 to.
For me, I installed anaconda3 into C:\Anaconda3. Therefore you need to add C:\Anaconda3 as well as C:\Anaconda3\Scripts\ to your path variable, e.g. set PATH=%PATH%;C:\Anaconda3;C:\Anaconda3\Scripts.
Related Topics
Use Bash Variable Within Slurm Sbatch Script
Asp Net Core Linux Err_Connection_Refused
Why Doesn't Set -E Cause a Failure with 'False || False && True'
"Echo" Output Different Answer by Sh and Bash
Sed: Matching on 2 Patterns on the Same Line
Arm: Disabling Mmu and Updating Pc
Will Process Lost Wake-Up Chance in a Preemptive Kernel
How Create a Bash Script with Another Bash Script
Bash Script - "Tar Czf ..." Command Ignore Parameters
Run Shell Command and Don't Wait for Return
Netcat Tcp Programming with Bash
How to Not Emit Local Symbols in Nasm So That Gdb Disas Won't Stop at Them
How to Delete Files Over (N) Days Old But Leave (N) Files Regardless of Age
Script to Check for Process & Restart Program If Not Found
Shell Script Error: "Head: Invalid Trailing Option -- 1"
How to Use the Parallel Command to Exploit Multi-Core Parallelism on My MACbook