Visual C++ runtime error with pioplus

When attempting to run pioplus.exe, (or associated commands such as pio account login) I get the following error box popping up:

This is obviously a very unhelpful message, but I wonder if you can give some hints as to how I might resolve this. I am using Windows x64, IDE 2.0.0-beta6, core 3.4.0b12.

I also get this error every time I launch Atom.
I’ve tried everything I can find online to fix this and nothing has worked.
I’ve been getting this error for about a month.

What is your Python version?

python --version

The desktop machine where I have this problem has Python 2.7.x installed globally, but the python used by platformio is the one automatically installed by the atom platformio package. Under a platformio atom terminal, I looked at the path. I see that ~\.platformio\penv\Scripts is at the start of the path, but the ~\.platformio\penv does not seem to be included. So perhaps pioplus is finding an incorrect python binary or associated dll somewhere else in my path.

On my laptop, where my system python is 3.5, I do not experience this problem.

This a virtual environment. Could you provide full output of

python --version

Python 2.7 on my system

I need a full version. Is it greater than 2.7.9?

I’m guessing 2.7.0

C:>python --version
Python 2.7

C:>python -V
Python 2.7

C:>python -c "print import(‘sys’).version"
2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]

C:>python -c “print import(‘sys’).version_info[:3]”
(2, 7, 0)

I updated to python 2.7.9 and it looks like the problem went away.

You can use the latest 2.7.13 version. I added error message when Python < 2.7.4 is used. See

@ivankravets: The problem disappeared when I removed my system python from the path. It was Python 2.7.13, which is exactly the same version as the platformio penv. So the problem was some kind of unwanted interaction with the system installed python.

Now under the platformio prompt, I cannot run python --version, because the penv is not in my path (but platformio seems to work fine). Is this expected behaviour? I think if the path to the penv binary files were appended to the start of the path, then the system python should not be able to cause any problems.

The problem still exists even though I have python 2.7.10 installed on my PC.

Python update to 2.7.13 didn’t help.

@yachnyymaxim My workaround was to remove system python 2 from the path. Recent versions of platformio atom plugin install their own minimal python distribution, and having a system-wide python also in the path seems to cause a conflict.

Please provide an output from system Terminal cmd

echo %PATH%
python --version
pip --version
pip list

echo %PATH%
C:\Python27\Lib\site-packages\PyQt4;C:\PROGRA~1\IMAGIN~1\TOOLCH~1\mips-img-elf\2015.01-7\bin;C:\PROGRA~1\IMAGIN~1\TOOLCH~1\mips-mti-elf\2015.01-7\bin;c:\Program Files (x86)\AMD APP\bin\x86_64;c:\Program Files (x86)\AMD APP\bin\x86;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\CooCox\CoIDE_V2Beta\bin;C:\MinGW\msys\1.0\bin;C:\MinGW\mingw32\bin;C:\MinGW\bin;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft Network Monitor 3;C:\Program Files\doxygen\bin;C:\Program Files (x86)\CMake\bin;C:\Program Files\LLVM\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Go\bin;C:\Python27;C:\Python27\DLLs;C:\Python27\Scripts;C:\Python27\Lib\site-packages\vtk;C:\Python27\gnuplot\binary;C:\Python27\Lib\site-packages\osgeo;C:\Program Files (x86)\pythonxy\SciTE-3.5.1-4;C:\Program Files (x86)\pythonxy\console;C:\Program Files (x86)\pythonxy\swig;C:\Program Files (x86)\pythonxy\gettext\bin;C:\Program Files\nodejs;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Amazon\AWSCLI;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\PuTTY;C:\Program Files (x86)\Skype\Phone;C:\Program Files\Mercurial;C:\Python36\Scripts;C:\Python36;C:\Program Files (x86)\Atmel\sam-ba_2.13\drv;C:\Program Files (x86)\Atmel\sam-ba_2.13;C:\Espressif\xtensa-lx106-elf\bin;D:\PortablePrograms\ctags58;C:\Users\myachniy\AppData\Roaming\npm;C:\Users\myachniy\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Kst-2.0.8\bin;C:\Program Files\Git\bin;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\myachniy.atom\packages\platformio-ide\penv\Scripts;D:\PortablePrograms\gcc-arm-none-eabi-6-2017-q2-update-win32\bin;C:\Users\myachniy\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\SEGGER\JLink_V614c;

python --version
Python 2.7.13

pip --version
pip 9.0.1 from C:\Python27\lib\site-packages (python 2.7)

pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
-curses (2.2)
aafigure (0.5)
alabaster (0.7.6)
alembic (0.7.6)
apipkg (1.4)
apptools (4.3.0)
arrow (0.10.0)
astroid (1.3.6)
astropy (1.0.3)
atom (0.3.10)
autopep8 (1.3.1)
Babel (1.3)
backports.datetime-timestamp (1.0.2.dev0)
backports.functools-lru-cache (1.0.2.dev0)
backports.method-request (1.0.1.dev0)
backports.shutil-get-terminal-size (1.0.0)
backports.ssl-match-hostname (3.4.0.2)
Beaker (1.7.0)
BeautifulSoup (3.2.1)
beautifulsoup4 (4.3.2)
blinker (1.4.dev0)
blockcanvas (4.0.3)
blosc (1.2.7)
bloscpack (0.7.2)
bottle (0.12.13)
Bottleneck (1.0.0)
CacheControl (0.11.5)
cchardet (0.3.5)
cdecimal (2.3)
certifi (2017.4.17)
cffi (1.1.2)
chaco (4.5.0)
chardet (3.0.4)
click (5.1)
codetools (4.2.0)
colorama (0.3.9)
configobj (5.0.6+xy.1)
configparser (3.5.0b2)
cov-core (1.15.0)
coverage (3.7.1)
cryptography (1.0.dev1)
cssselect (0.9.1)
cvxopt (1.1.7)
cvxpy (0.2.24)
cx-Freeze (4.3.4)
cyordereddict (0.2.3.dev7)
Cython (0.22.1)
cytoolz (0.7.3)
datrie (0.7.1.dev37)
decorator (3.4.2)
distlib (0.2.0)
docutils (0.12)
docutils-aafigure (0.3)
ecdsa (0.13.1.dev0)
ecos (1.1.1)
ed25519ll (0.6)
egenix-mx-base (3.2.8)
enable (4.5.1)
enaml (0.9.8)
enamllexer (0.0.0)
encore (0.6.0)
enum34 (1.0.4)
envisage (4.4.0)
ets (4.4.4)
etsdevtools (4.0.2)
etsproxy (0.1.2)
execnet (1.3.1.dev11+n2a4d009856d7)
Fabric (1.10.2)
fabric-virtualenv (0.2.1)
fasteners (0.14.1)
faulthandler (2.4)
ffnet (0.8.0)
fonttools (2.4)
formlayout (1.0.15)
funcsigs (0.4)
future (0.16.0)
futures (3.0.3)
fuzzywuzzy (0.15.0)
GDAL (1.11.2)
gevent (1.0.2)
gevent-websocket (0.9.5)
graphcanvas (4.0.2)
greenlet (0.4.7)
grin (1.2.1+xy1)
guidata (1.6.1)
guiqwt (2.3.2)
h5py (2.5.0)
html5lib (0.99999)
idna (2.5)
intelhex (2.1)
ipaddress (1.0.7)
ipdb (0.8.1)
ipdbplugin (1.4.2)
ipython (2.4.1)
jaraco.apt (1.0)
jaraco.classes (1.2)
jaraco.collections (1.1)
jaraco.context (1.3)
jaraco.functools (1.3)
jaraco.structures (1.0)
jaraco.text (1.4)
jaraco.ui (1.3.1)
jaraco.windows (3.4)
jdcal (1.0)
jedi (0.9.0)
Jinja2 (2.7.3)
junit-xml (1.7)
keyring (5.3)
kiwisolver (0.1.3)
libnacl (1.4.3)
linecache2 (1.0.0)
lockfile (0.12.2)
logilab-common (0.63.2)
lxml (3.4.4)
mahotas (1.3.0)
Mako (1.0.1)
MarkupSafe (0.23)
matplotlib (1.4.3)
mayavi (4.4.2)
mbed-cli (1.1.1)
mbed-greentea (1.2.5)
mbed-host-tests (1.1.7)
mbed-ls (1.2.13)
MDP (3.3)
mock (1.0.1)
modernize (0.4)
monotonic (1.3)
more-itertools (2.3.dev0)
ndg-httpsclient (0.4.0)
netCDF4 (1.1.8)
netifaces (0.10.4)
networkx (1.9.1)
nose (1.3.7)
nose-cov (1.6)
nose-fixes (1.3)
numexpr (2.4.3)
numpy (1.9.2)
numpydoc (0.6.dev0)
oauthlib (0.7.3.dev0)
objgraph (2.0.1.dev0)
opencv-python (2.4.11)
openpyxl (2.2.4)
packaging (15.2)
pandas (0.16.2)
paramiko (1.15.2)
pathlib (1.0.1)
patsy (0.3.0)
pdfrw (0.2)
pep8 (1.6.2)
Pillow (2.8.2)
pip (9.0.1)
platformio (3.4.1a6)
ply (3.6)
Polygon (2.0.5)
pp (1.6.4)
prettytable (0.7.2)
psutil (3.0.1)
py (1.4.30)
py2exe (0.6.9)
pyamg (2.2.1)
pyasn1 (0.1.8)
pyasn1-modules (0.0.6)
PyAudio (0.2.8)
pycares (0.7.0)
pycodestyle (2.3.1)
pycparser (2.14)
pycrypto (2.6.1)
pycurl (7.19.5.1)
pydicom (0.9.9)
pyemf (2.0.0)
pyface (4.6.0.dev13)
pyflakes (0.9.2)
Pygments (2.0.2)
pygraphviz (1.3.dev0)
pyhdf (0.8.3)
PyHyphen (2.0.5)
PyICU (1.9.2+xy.1)
PyJWT (1.3.1.dev2)
pylint (1.4.3)
pymc (2.3.4)
pyMinuit (1.2.1)
pyOCD (0.8.1a1)
pyodbc (3.0.11b7)
PyOpenGL (3.1.0)
PyOpenGL-accelerate (3.1.0)
pyOpenSSL (0.15.1)
pyparallel (0.2)
pyparsing (2.0.3)
pyPdf (1.13)
PyPDF2 (1.24)
PyQt4 (4.11.3)
pyreadline (2.0.6+xy.1)
pyserial (3.4)
PyStemmer (1.3.0)
pytest (2.7.3.dev0)
pytest-bench (0.3.0)
pytest-cache (1.0)
pytest-cov (1.8.1)
pytest-faulthandler (0.2.1)
pytest-flakes (1.0.0)
pytest-pep8 (1.0.6)
pytest-runner (2.5.1)
pytest-xdist (1.13.dev1)
python-dateutil (2.6.1)
pytz (2015.4)
PyVISA (1.7)
PyWavelets (0.2.2)
pywin (0.3.1)
pywin32 (219)
pywinauto (0.4.2)
pywinusb (0.4.2)
PyYAML (3.11)
pyzmq (14.7.0)
reportlab (3.2.0)
requests (2.18.2)
requests-oauthlib (0.5.0)
rope (0.10.2)
rst2pdf (0.93)
sampy (1.2.1)
scandir (1.1.1.dev7)
scikit-image (0.11.3)
scikit-learn (0.16.1)
scimath (4.1.2)
scipy (0.15.1)
scons (2.5.1)
scp (0.10.2)
scs (1.1.4)
seaborn (0.5.1)
semantic-version (2.6.0)
SendKeys (0.3)
setuptools (20.10.1)
simplejson (3.7.3)
singledispatch (3.4.0.3)
six (1.10.0)
snowballstemmer (1.2.1.dev1)
Sphinx (1.3.2)
sphinx-rtd-theme (0.1.8)
sphinxcontrib-aafig (1.0)
sphinxcontrib-plantuml (0.6)
spyder (2.3.5.2)
SQLAlchemy (1.0.6)
statsmodels (0.6.1)
svg2rlg (0.3)
svglib (0.6.3)
sympy (0.7.6)
tables (3.2.0)
Tempita (0.5.2)
termcolor (1.1.0)
toolz (0.7.2)
tornado (4.2)
traceback2 (1.4.0)
traits (4.5.0)
traitsui (4.5.1)
TTFQuery (1.0.5)
ujson (1.33)
uncertainties (2.4.6.1)
unittest2 (1.0.1)
urllib3 (1.22)
veusz (1.23.1)
virtualenv (13.0.3)
virtualenvwrapper-win (1.2.1)
ViTables (2.2a1)
VPython (5.74)
VTK (6.20)
websocket-client (0.40.0)
wheel (0.24.0)
Whoosh (2.7.0)
wincertstore (0.2)
winpdb (1.4.8)
wsaccel (0.6.2)
wxPython (2.8.12.1)
wxPython-common (2.8.12.1)
xhtml2pdf (0.0.7.dev0)
xlrd (0.9.3)
xlwt (1.0.0)
yappi (0.94)
yg.lockfile (2.0)
zc.lockfile (1.1.0)

@davidpowell
I can’t do this since I’m using another tool (scons) separately from Platformio.

Could you temporary remove Python 3.6 from PATH? Also, please provide an output of

echo %PYTHONPATH%

Could you temporary remove Python 3.6 from PATH?
This doesn’t help - I’m getting the same error.

I have no environment variable named PYTHONPATH defined. Is it needed?

Have you resolved this issue?