platformio / platformio-vscode-ide

PlatformIO IDE for VSCode: The next generation integrated development environment for IoT
https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide
Apache License 2.0
1.22k stars 195 forks source link

Error: Could not create PIO Core Virtual Environment #154

Closed 3lVv0w closed 4 years ago

3lVv0w commented 6 years ago

Hi,

Thanks for the report! We rewrote PlatformIO Core installer from the scratch. Please download and install the latest PlatformIO IDE for VSCode 2.0 Beta as described in Try Beta section on that page.

Please respond to this thread if it helped you or you still have an issue. We will reopen this issue again.

Regards, Your friends at PlatformIO

ivankravets commented 6 years ago

Please provide an output from a system Terminal

echo $PATH
echo $PYTHONPATH
python --version
pip --version
pip list
sclarke81 commented 6 years ago

I'm having this issue and I'm willing to help out to resolve it rather than just using the workaround. This issue is on a company computer so I can't let you remote to it, but I'm a developer so I'm willing to try things and report back.

Here's the output for the requested commands (done in PowerShell):

C:\Code> echo $env:Path
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86;C:\Program Fi
les (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft SDKs\Type
Script\3.0;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestW
indow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFounda
tion\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin\Roslyn;C:\Program F
iles (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visua
l Studio\Shared\Common\VSPerfCollectionTools\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools
\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE
\CommonExtensions\Microsoft\FSharp\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x86;C:\Program Files (x86)\W
indows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\\MSBuild\15.0\bin;C:\WINDOWS\Mic
rosoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\;C:\Program
Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\;C:\Python27\;C:\Python27\Scripts;C:\Program Files\
Basler\pylon 5\Runtime\Win32\;C:\Program Files\Basler\pylon 5\Runtime\x64\;C:\Program Files\Docker\Docker\Resources\bin;
C:\tools\activetcl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.
0\;C:\ProgramData\chocolatey\bin;C:\opt\bin;C:\Program Files (x86)\Renishaw\WiRE4;C:\Program Files\Microsoft SQL Server\
130\Tools\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;
C:\Program Files\OpenSSL\bin;C:\Program Files\WindowsPowerShell\Scripts;C:\Program Files\nodejs\;C:\Program Files (x86)\
Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Pro
gram Files (x86)\MATLAB\R2015b\runtime\win32;C:\Program Files (x86)\MATLAB\R2015b\bin;C:\Program Files\Java\jdk1.8.0_144
\bin;C:\Users\<username>\AppData\Local\Microsoft\WindowsApps;C:\Program Files\kdiff3;C:\Users\<username>\AppData\Roaming\npm
;C:\Users\<username>\AppData\Local\GitHubDesktop\bin;C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0;C:\Progra
m Files (x86)\Renishaw\WiRE 5.0.7642;C:\Program Files (x86)\GitExtensions\;C:\Program Files\Git\cmd;C:\WINDOWS\system32;
C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program
Files (x86)\Groovy\Groovy-2.5.2\bin;C:\Program Files\qemu;C:\Users\<username>\AppData\Local\Microsoft\WindowsApps;C:\Progr
am Files\kdiff3;C:\Users\<username>\AppData\Roaming\npm;C:\Users\<username>\AppData\Local\GitHubDesktop\bin;C:\Users\sc13747
1\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Oracle\VirtualBox;C:\Users
\<username>\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\<username>\.dotnet\tools;C:\Program Files\WindowsPowerShel
l\Modules\Pscx\3.3.1\Apps;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\
Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\
Microsoft\CMake\Ninja
C:\Code> echo $env:pythonpath
C:\Code> python --version
Python 2.7.15
C:\Code> pip --version
pip 9.0.3 from c:\python27\lib\site-packages (python 2.7)
C:\Code> 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.
pip (9.0.3)
setuptools (39.0.1)
ivankravets commented 6 years ago

@sclarke81 thank you so much for a willingness to help us! Let's do the same what our installer does:

  1. Please download and unpack somewhere https://pypi.python.org/packages/source/v/virtualenv/virtualenv-16.0.0.tar.gz
  2. Please remove C:/Users/<username>/.platformio/penv folder if exists
  3. Run this in your terminal
    python C:/place/where/you/unpacked/virtualenv/virtualenv.py C:/Users/<username>/.platformio/penv

Of course, please replace with valid paths. If don't provide further steps, it seems that you will fail on 3rd step. Please provide errors here.

P.S: If it works, you can continue from step No.2 http://docs.platformio.org/en/latest/installation.html#creating

sclarke81 commented 6 years ago

@ivankravets no problem. It's good to get to the bottom of these things.

I've followed the steps and it seems that it's an ssl issue installing PlatformIO into the virtual environment. See output below:

C:\Code> python C:\Users\<username>\Downloads\virtualenv-16.0.0\virtualenv.py C:\Users\<username>\.platformio\penv
New python executable in C:\Users\<username>\.platformio\penv\Scripts\python.exe
Installing setuptools, pip, wheel...done.
C:\Code> C:\Users\<username>\.platformio\penv\Scripts\activate.ps1
(penv) C:\Code> pip install -U platformio
Collecting platformio
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SS
LError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)'),)': /simple/platformio/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SS
LError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)'),)': /simple/platformio/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SS
LError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)'),)': /simple/platformio/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SS
LError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)'),)': /simple/platformio/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SS
LError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)'),)': /simple/platformio/
  Could not fetch URL https://pypi.org/simple/platformio/: There was a problem confirming the ssl certificate: HTTPSConn
ectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/platformio/ (Caused by SSLError(SSLError(1
, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)'),)) - skipping
  Could not find a version that satisfies the requirement platformio (from versions: )
No matching distribution found for platformio

I added a pip.ini file specifying my cert and proxy and it worked!

(penv) C:\Code> pip install -U platformio
Collecting platformio
  Downloading https://files.pythonhosted.org/packages/15/f6/6a837ec8ebf25d8737cc72faa6fccc023b325f9a19003cb374e5323d730f
/platformio-3.6.1-py27-none-any.whl (155kB)
    100% |################################| 163kB 1.8MB/s
Collecting bottle<0.13 (from platformio)
  Downloading https://files.pythonhosted.org/packages/bd/99/04dc59ced52a8261ee0f965a8968717a255ea84a36013e527944dbf3468c
/bottle-0.12.13.tar.gz (70kB)
    100% |################################| 71kB 1.4MB/s
Collecting click<6,>=5 (from platformio)
  Downloading https://files.pythonhosted.org/packages/8f/98/14966b6d772fd5fba1eb3bb34a62a7f736d609572493397cdc5715c14514
/click-5.1-py2.py3-none-any.whl (65kB)
    100% |################################| 71kB 1.1MB/s
Collecting semantic-version<3,>=2.5.0 (from platformio)
  Downloading https://files.pythonhosted.org/packages/72/83/f76958017f3094b072d8e3a72d25c3ed65f754cc607fdb6a7b33d84ab1d5
/semantic_version-2.6.0.tar.gz
Collecting pyserial!=3.3,<4,>=3 (from platformio)
  Downloading https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30
/pyserial-3.4-py2.py3-none-any.whl (193kB)
    100% |################################| 194kB 2.0MB/s
Collecting requests<3,>=2.4.0 (from platformio)
  Downloading https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8
/requests-2.20.0-py2.py3-none-any.whl (60kB)
    100% |################################| 61kB 1.4MB/s
Collecting colorama (from platformio)
  Downloading https://files.pythonhosted.org/packages/0a/93/6e8289231675d561d476d656c2ee3a868c1cca207e16c118d4503b25e2bf
/colorama-0.4.0-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests<3,>=2.4.0->platformio)
  Downloading https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655
/certifi-2018.10.15-py2.py3-none-any.whl (146kB)
    100% |################################| 153kB 2.0MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests<3,>=2.4.0->platformio)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8
/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |################################| 143kB 2.0MB/s
Collecting idna<2.8,>=2.5 (from requests<3,>=2.4.0->platformio)
  Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165
/idna-2.7-py2.py3-none-any.whl (58kB)
    100% |################################| 61kB 1.4MB/s
Collecting urllib3<1.25,>=1.21.1 (from requests<3,>=2.4.0->platformio)
  Downloading https://files.pythonhosted.org/packages/8c/4b/5cbc4cb46095f369117dcb751821e1bef9dd86a07c968d8757e9204c324c
/urllib3-1.24-py2.py3-none-any.whl (117kB)
    100% |################################| 122kB 1.9MB/s
Building wheels for collected packages: bottle, semantic-version
  Running setup.py bdist_wheel for bottle ... done
  Stored in directory: C:\Users\<username>\AppData\Local\pip\Cache\wheels\76\a0\b4\2a3ee1a32d0506931e558530258de1cc04b628e
ff1b2f008e0
  Running setup.py bdist_wheel for semantic-version ... done
  Stored in directory: C:\Users\<username>\AppData\Local\pip\Cache\wheels\60\bb\50\215d669d31f992767f5dd8d3c974e79261707ee
7f898f0dc10
Successfully built bottle semantic-version
Installing collected packages: bottle, click, semantic-version, pyserial, certifi, chardet, idna, urllib3, requests, col
orama, platformio
Successfully installed bottle-0.12.13 certifi-2018.10.15 chardet-3.0.4 click-5.1 colorama-0.4.0 idna-2.7 platformio-3.6.
1 pyserial-3.4 requests-2.20.0 semantic-version-2.6.0 urllib3-1.24

On opening VSCode I receive an exception from PIO:

Error: Error: Detected unknown package 'tool-pioplus'

    at C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\platformio-node-helpers\lib\index.js:14:11760
    at ChildProcess.y (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\platformio-node-helpers\lib\index.js:1:13369)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at ChildProcess.cp.emit (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
sclarke81 commented 6 years ago

I just tried removing the penv folder and starting VSCode now that I have the pip.ini in place. I receive the following exception:

Error: Failed to download file https://files.pythonhosted.org/packages/69/81/52b68d0a4de760a2f1979b0931ba7889202f302072cc7a0d614211bc7579/pip-18.0.tar.gz: Error: unable to get local issuer certificate
    at Object.<anonymous> (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\platformio-node-helpers\lib\index.js:14:32668)
    at _ (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\platformio-node-helpers\lib\index.js:1:67131)
    at Generator._invoke (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\platformio-node-helpers\lib\index.js:1:66919)
    at Generator.t.(anonymous function) [as throw] (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\platformio-node-helpers\lib\index.js:1:67310)
    at n (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\platformio-node-helpers\lib\index.js:14:34328)
    at C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.3\node_modules\platformio-node-helpers\lib\index.js:14:34447
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
ivankravets commented 6 years ago

I just tried removing the penv folder and starting VSCode now that I have the pip.ini in place. I receive the following exception:

In the last case, we use Node.JS to download a package. It means, that you need to set a proxy for VSCode.

ivankravets commented 6 years ago

I added a pip.ini file specifying my cert and proxy and it worked!

How does it look? Could you provide your settings?

sclarke81 commented 6 years ago

How does it look? Could you provide your settings?

This is my pip.ini file:

[global]
cert = C:\opt\certs\ZscalerRootCA1.pem
proxy = <address>:<port>

In the last case, we use Node.JS to download a package. It means, that you need to set a proxy for VSCode.

I already have the following settings in VSCode:

"http.proxy": "http://<address>:<port>/",
"http.proxyStrictSSL": false
sclarke81 commented 6 years ago

I've checked that the file is not blocked by our proxy by downloading it using a web browser. So I can successfully download:

https://files.pythonhosted.org/packages/69/81/52b68d0a4de760a2f1979b0931ba7889202f302072cc7a0d614211bc7579/pip-18.0.tar.gz
ivankravets commented 5 years ago

Could you open VSCode > Menu > Help > Toggle Developers Tools > Console. Do you see any errors? Please share here.

sclarke81 commented 5 years ago

Please see this comment.

rkit1 commented 5 years ago

I've managed to complete the process by temporarily renaming the python executable bundled with another piece of software I've had in my PATH.

ivankravets commented 5 years ago

@rkit1 could remove C:/Users/YourUserName/.platformio/penv folder and add back "python executable bundled with another piece of software"? I would like to see a full error output. Please share errors from VSCode > Menu > Help > Toggle Developer Tools > Console. Thanks!

rkit1 commented 5 years ago

default

ivankravets commented 5 years ago

@rkit1 Thanks! I see you have a custom Python in emacs folder. Could you run and paste an output here?

C:/Users/Victor/Documents/stuff/root/toolz/emacs/bin/python.exe --version
C:/Users/Victor/Documents/stuff/root/toolz/emacs/bin/python.exe -c "import functools; print(functools)"
rkit1 commented 5 years ago
C:\Users\Victor>C:/Users/Victor/Documents/stuff/root/toolz/emacs/bin/python.exe --version
Python 2.7.14

C:\Users\Victor>C:/Users/Victor/Documents/stuff/root/toolz/emacs/bin/python.exe -c "import functools; print(functools)"
<module 'functools' from 'C:\Users\Victor\Documents\stuff\root\toolz\emacs\lib\python2.7/functools.pyc'>
sclarke81 commented 5 years ago

@ivankravets is there anything else you'd like me to do on this?

ivankravets commented 5 years ago

@sclarke81 we did some improvements to our installer a few days ago. Could upgrade our extension to the latest version, and restart VSCode? Please check the same error console ` VSCode > Menu > Help > Toggle Developers Tools > Console.

ivankravets commented 5 years ago

@rkit1 I would like to reproduce this issue on my virtual windows machine. Did you install Python in C:/Users/Victor/Documents/stuff/root/toolz/emacs or you did install special Emacs? Where can I get it?

rkit1 commented 5 years ago

https://ftp.gnu.org/gnu/emacs/windows/emacs-26/emacs-26.1-x86_64.zip Unpacked and added emacs/bin to $PATH

sclarke81 commented 5 years ago

@ivankravets it seems to fail consistently on downloading a file (previously it alternated between different errors):

e.register @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4362
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] Git extension API method 'getGitPath' is deprecated.
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] Error: 'platformio' is not recognized as an internal or external command,
operable program or batch file.
Error: spawn platformio ENOENT
    at C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.6\node_modules\platformio-node-helpers\dist\index.js:1:6993
    at h (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.6\node_modules\platformio-node-helpers\dist\index.js:1:6004)
    at ChildProcess.r.on.e (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.6\node_modules\platformio-node-helpers\dist\index.js:1:5793)
    at emitOne (events.js:116:13)
    at ChildProcess.emit (events.js:211:7)
    at ChildProcess.cp.emit (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.6\node_modules\cross-spawn\lib\enoent.js:30:37)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] Error: unable to get local issuer certificate
    at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
    at emitNone (events.js:106:13)
    at TLSSocket.emit (events.js:208:7)
    at TLSSocket._finishInit (_tls_wrap.js:637:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] Error: unable to get local issuer certificate
    at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
    at emitNone (events.js:106:13)
    at TLSSocket.emit (events.js:208:7)
    at TLSSocket._finishInit (_tls_wrap.js:637:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] Error: unable to get local issuer certificate
    at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
    at emitNone (events.js:106:13)
    at TLSSocket.emit (events.js:208:7)
    at TLSSocket._finishInit (_tls_wrap.js:637:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] Error: unable to get local issuer certificate
    at TLSSocket.<anonymous> (_tls_wrap.js:1103:38)
    at emitNone (events.js:106:13)
    at TLSSocket.emit (events.js:208:7)
    at TLSSocket._finishInit (_tls_wrap.js:637:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:467:38)
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2429 Error: Failed to download file https://files.pythonhosted.org/packages/45/ae/8a0ad77defb7cc903f09e551d88b443304a9bd6e6f124e75c0fbbf6de8f7/pip-18.1.tar.gz: Error: unable to get local issuer certificate    at Object.t.download (C:\opt\.vscode\extensions\platformio.platformio-ide-1.4.6\node_modules\platformio-node-helpers\dist\index.js:1:29236)     at <anonymous>  at process._tickCallback (internal/process/next_tick.js:188:7)
t.onDidNotificationChange @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2429
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] rejected promise not handled within 1 second
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] ApplicationInsights:CorrelationIdManager Array(1)
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
/C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] ApplicationInsights:CorrelationIdManager Array(1)
t.log @ /C:/Users/<user>/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:294
ivankravets commented 5 years ago

@sclarke81 pip issue was fixed in https://github.com/platformio/platformio-node-helpers/commit/44473ecf730c689641f612693f07c7e28a013914

ivankravets commented 5 years ago

Please update to the latest 1.5.0 release and restart VSCode. Does it work now?

sclarke81 commented 5 years ago

Success! PIO is installing now, but when it tries to open PIO Home I get the Detected unknown package 'tool-pioplus' error. I've commented on #347 with details as that seemed the most appropriate place.

MoonCactus commented 5 years ago

Just in case it helps (as it ended up as a non-blocking to me), I experienced the "issue" this way:

I did not have to do any of the proposed solution (manually install a virtual env)

But after dismissing the error dialog, it told me:

So not really a bug, and possibly not even related to platformio at least in my case. It was easy to fix (just followed what's being said), and the initial error might only have been improved by stating that "This error may also happen after your version of atom was upgraded and existing module must be upgraded as well. Please " (i.e the following popup!).

All in all, you wanted feedback so here it is, but feel free to delete this post if it brings no added value I would feel no offense :)

PlatformIO IDE: v2.1.13

jeremie@alpha: $ python --version Python 2.7.15rc1

$ jeremie@alpha: pip --version pip 18.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

$jeremie@alpha: pip list Package Version


asn1crypto 0.24.0
Babel 2.6.0
backports.functools-lru-cache 1.5
beautifulsoup4 4.6.0
bottle 0.12.16
catkin-pkg 0.3.9
certifi 2018.11.29 chardet 3.0.4
cheroot 6.5.2
CherryPy 17.4.1
click 5.1
colorama 0.4.1
contextlib2 0.5.5
cryptography 2.1.4
defusedxml 0.5.0
dnspython 1.15.0
docutils 0.14
ecdsa 0.13
empy 3.3.2
enum34 1.1.6
esptool 2.6
future 0.17.1
html5lib 0.999999999 idna 2.6
ipaddress 1.0.17
jaraco.functools 1.20
Jinja2 2.8.1
keyring 10.6.0
keyrings.alt 3.0
lxml 4.2.1
MarkupSafe 1.1.0
more-itertools 4.3.0
numpy 1.13.3
olefile 0.45.1
paho-mqtt 1.4.0
Pillow 5.1.0
pip 18.1
platformio 3.6.3
portend 2.3
psutil 5.4.8
pyaes 1.6.1
pycairo 1.16.2
pycrypto 2.6.1
Pygments 2.2.0
pygobject 3.26.1
pylibacl 0.5.3
pyliblzma 0.5.3
pyserial 3.4
pysqlite 2.7.0
python-dateutil 2.6.1
pytz 2018.7
pyxattr 0.6.0
pyxdg 0.25
PyYAML 3.12
rdiff-backup 1.2.8
rdiffweb 0.10.8
requests 2.21.0
roman 2.0.0
rospkg 1.1.4
scour 0.36
SecretStorage 2.3.1
semantic-version 2.6.0
setuptools 39.0.1
six 1.11.0
SOAPpy 0.12.22
tempora 1.14
urllib3 1.24.1
webencodings 0.5
wheel 0.30.0
wstools 0.4.3
zc.lockfile 1.4

ivankravets commented 5 years ago

@MoonCactus Thank you for your report.

  1. Please remove global PIO Core from a system https://docs.platformio.org/en/latest/faq.html#multiple-pio-cores-in-a-system
  2. Please remove ~/.platformio folder and restart PlatformIO IDE.

Does it work now?

MoonCactus commented 5 years ago

@ivankravets actually it already works. I experienced the initial error mentioned in this thread, and I simply wanted to tell about my symptoms (and "fix", i.e. just ignore it and keep on with the automated upgrade!). That was mostly to help in case you wanted to try & reproduce the issue, as asked in the first post of the thread (though I suspect the reason of the error popping up on my pc was not the same as for @sclarke81). As a side note, I still have an older version of PIO core on my system, and there is a warning about that indeed. Removing the old one & settings would not really help... since everything works fine for me! ;) As a secondary side note: great work, great project, great reactivity, simpler and more reliable - I keep on promoting it whenever I can and I see people still fighting with the arduino ""IDE"" ;)

Drummondh commented 5 years ago

2 computers, both running Linux Mint 19.1 - same error on both. Error: Could not create PIO Core Virtual Environment. Please create it manually -> http://bit.ly/pio-core-virtualenv Error: Virtualenv Create: Traceback (most recent call last): File "/home/drum/.platformio/.cache/tmp-5617nrKRkQBJVvbv/virtualenv-16.7.5/virtualenv.py", line 24, in import distutils.spawn ModuleNotFoundError: No module named 'distutils.spawn' at t.value (/home/drum/.vscode/extensions/platformio.platformio-ide-1.9.0/node_modules/platformio-node-helpers/dist/index.js:1:31671)

Version: 1.39.2 Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390 Date: 2019-10-15T15:33:40.634Z Electron: 4.2.10 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Linux x64 4.15.0-65-generic

Drummondh commented 5 years ago

In addition trying to install platformio in VScode

notificationsAlerts.ts:40 Error: Could not create PIO Core Virtual Environment. Please create it manually -> http://bit.ly/pio-core-virtualenv Error: Virtualenv Create: Traceback (most recent call last): File "/home/drum/.platformio/.cache/tmp-5617nrKRkQBJVvbv/virtualenv-16.7.5/virtualenv.py", line 24, in import distutils.spawn ModuleNotFoundError: No module named 'distutils.spawn' at t.value (/home/drum/.vscode/extensions/platformio.platformio-ide-1.9.0/node_modules/platformio-node-helpers/dist/index.js:1:31671)

2 other errors from console ERR Cannot read property 'stack' of undefined: TypeError: Cannot read property 'stack' of undefined at t.catch.t (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:787:786)

ERR connect ECONNREFUSED 0.0.0.0:443: Error: connect ECONNREFUSED 0.0.0.0:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)

Let me know if there is anything else I can send.

ivankravets commented 5 years ago

See https://github.com/platformio/platformio-vscode-ide/issues/907

ivankravets commented 4 years ago

Please upgrade VSCode and PlatformIO IDE to the latest versions. Should be fixed.