Atom - Change Script to run Anaconda after install platformio

1

I am trying to set up Atom with platformio and a number of other python plugins on Ubuntu. After installing platformio I have noticed that the default python that is run by the script package is the python 2.7 environment created within platformio, not the Anaconda package I have installed.

The default python version in my terminal is python 3 Anaconda, but at the moment I have to disable Platformio in atom for it to run any of my scripts. I have found some solutions online that involve changing the python.coffee file in the .atom config settings to python3. While this does stop the platformio python being used, this calls the default linux python distro, again not the anaconda environment that I have set up.

This different python version is also causing issues with other packages. Linter flake8 will not work at all when platformio is enabled - making me think there is some core atom setting that needs changing because of platformio rather than specifically a clash between it and script.

Any help on how I can configure the script package (or change platformio) so that it will run anaconda without having to disable other packages all the time would be really appreciated.

falcoso

Posted 2019-05-11T18:29:36.927

Reputation: 13

Answers

1

There is a file:

~/.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. 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.

lologop

Posted 2019-05-11T18:29:36.927

Reputation: 26