
Anaconda powershell code#
In addition, I also had to make a few changes so the bash code worked in ZSH. For example, until recently, I had to manually copy the contents of the initialisation block from ~/.bashrc to ~/.zshrc. The problem comes when you’re not using a shell that Miniconda’s initialisation supports. Likewise, it will be added to ~/.zshrc if you’re using ZSH. Obviously, if you’re using bash, this will be added to your ~/.bashrc file. "/home/matheus/miniconda3/etc/profile.d/conda.sh"Įxport PATH="/home/matheus/miniconda3/bin:$PATH" _conda_setup="$('/home/matheus/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" # !! Contents within this block are managed by 'conda init' !! Specifically, it will add something like the following code block to it. If you agreed to let conda initialise in your shell, then it should have added some initialisation scripts to your “rc” file. If that’s not the case, then this section is for you. rcĪfter the installation, you should be able to run the command conda -version. Copying The Conda Initialisation Code To Your.

This will add the conda tool to your PATH, so you can use it in the terminal. Again, the script will prompt you whether you want to change the installation directory but don’t do it unless you have a good reason to.įinally, when the script asks you if you want to initialise Anaconda, type “yes”. At the time of writing, the Miniconda version is at 3, but it’s best to copy the link to the latest script and paste it into the commands above.Īll you have to do now is keep pressing enter, read the terms and conditions, and agree to it by typing “yes”. mkdir miniconda-temp & cd miniconda-tempĬhmod +x Miniconda3-latest-Linux-x86_64.shĪlthough I provided the link to Miniconda3-latest-Linux-x86_64.sh above, keep an eye out for changes in the version. Run the following commands in your terminal, preferably from your home directory. If you’re using a different architecture, I assume you know who you are 😉 If you don’t know which one is right for you, it’s probably the Miniconda 64-bit Linux one.
Anaconda powershell install#
Use it at your own risk! Installing Anaconda On LinuxĪlthough it’s a little bit more manual than the Windows installation, it’s also quite easy to install Anaconda with the Miniconda Linux script.įirstly, copy the link to the correct Miniconda install script. However, this will completely replace your Windows Python installation PATH (if you had one before Anaconda) with Anaconda’s default Python. There is an alternative to adding the Python directory: you could just add the conda.exe directory to the PATH variable, open a new Powershell session, and type conda init.

Or you could do a conda activate SOME_OTHER_ENV to switch.

However, you can always change the PATH values to change your default Python executable. Essentially, this only lets you work on one environment at a time by default. You probably noticed that we’re only adding the Python directory for a specific environment. Note On Adding Conda & Python To Environment Variables Simply the directory (without the python.exebit) and put it in your PATH.

Unsurprisingly, the above will give you the directory and path to my_env‘s python.exe. For example, run the following from Anaconda Powershell. In other words, we don’t add the conda.exe bit!įurthermore, to add the Python directory, you need to activate the environment you want, then find out the Python directory. You should add Some-Path-To\miniconda3\Scripts to the PATH. This will result in something like Some-Path-To\miniconda3\Scripts\conda.exe. To get the conda directory, open the Anaconda Powershell, then type the following. To use the Anaconda-managed Python, you will need to add your environment’s Python directory as well.For the Anaconda tools, you need to add the conda executable.If you would like to use the conda tool in Window’s command-line (cmd) or Powershell, you need to add a couple of directories to your environment PATH variable: Adding To Conda And Python To The Environment PATH Variable Figure 2: Finding the Anaconda command-line tools in Windows.
