Using anaconda environment in Atom Using anaconda environment in Atom python python

Using anaconda environment in Atom


In your Anaconda terminal, activate your Conda environment and then run atom --new-instance


If you want to run some python script on different python versions using Atom, I think the best solution is to use atom's Hydrogen package and installing a kernel for every conda env you need, to do it you should open Anaconda's prompt and:

  1. Install jupyter on every conda env you want to work with
  2. Activate the first env that you wish to use on Atom
  3. Create an Ipython kernel for that env with python -m ipykernel install --user --name YourEnvName
  4. Repeat this in all the envs you wish to work with

Sadly if you wish to use some atom's packages like flake8 or python-ide you need to launch atom (simply typing atom on ancaconda prompt) from a conda env that has all the requirements (like python-language-server) and then you can switch between kernels with ease.

If anybody knows how to make Atom and it's packages to recognize some env without launching atom from inside that env, please share :D


I had this same issue, and after some exploring, found that this worked well:

There is a file (I'm on macOS Catalina 10.15.3):

~/.atom/packages/platformio-ide-terminal/lib/platformio-ide-terminal.coffee

Look for the autoRunCommand section:

autoRunCommand:
title: 'Auto Run Command'
description: 'Command to run on terminal initialization.'
type: 'string'
default: ''

If you set the default to:

'export PATH=~/opt/anaconda3/bin:$PATH'

platformio will execute this command every time you start Atom, and it will use the default anaconda python, as specified in the new PATH.

You can then type "conda activate myenvironment" in the platformio terminal and it will work like normal (switch between environments, install packages, etc.). Hope this helps.