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

Failed to install Platformio IDE in vscode #1114

Closed junbao-zhou closed 5 years ago

junbao-zhou commented 5 years ago

Problem

Installing PlatformIO Core...
Please do not close this window and do not open other folders until this process is completed.
Failed to install PlatformIO IDE.

What I Have Tried

What I Have Found

What I Have Installed in My Computer

edalongeville commented 5 years ago

I have the exact same problem. Here's what VSCode says:

Traceback (most recent call last):
  File "/home/eric/.local/bin/platformio", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/eric/.platformio/penv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/home/eric/.platformio/penv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/home/eric/.platformio/penv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/eric/.platformio/penv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/home/eric/.platformio/penv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/eric/.platformio/penv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'platformio==4.0.3' distribution was not found and is required by the application

I rolled back to the 1.8.3 version and it works.

ivankravets commented 5 years ago

@edalongeville see https://github.com/platformio/platformio-vscode-ide/issues/1007

ivankravets commented 5 years ago

@BowmanChow It can be linked with broken Python installation. Please open VSCode > Help > Developer tools > Console. Do you see any errors?

junbao-zhou commented 5 years ago

@ivankravets Thank you very much. Now I can see errors.

The error occurs when running commands:

conda create --yes --quiet python=2 pip --prefix C:\Users\Bowman\.platformio\penv

The errors are as follows

Error: 
Conda Virtualenv:  
[WinError 127] The specified procedure could not be found 
[WinError 127] The specified procedure could not be found 
[WinError 127] The specified procedure could not be found 
[WinError 127] The specified procedure could not be found 
[WinError 127] The specified procedure could not be found 
[WinError 127] The specified procedure could not be found 
[WinError 127] The specified procedure could not be found 
[WinError 127] The specified procedure could not be found 
[WinError 127] The specified procedure could not be found       at o.runCommand 
(c:\Users\Bowman\.vscode\extensions\platformio.platformio-ide-1.9.0\node_modules\platformio-node-helpers\dist\index.js:1:29676)     at ChildProcess.h 
(c:\Users\Bowman\.vscode\extensions\platformio.platformio-ide-1.9.0\node_modules\platformio-node-helpers\dist\index.js:1:6150)  at ChildProcess.emit (events.js:182:13)     at ChildProcess.cp.emit 
(c:\Users\Bowman\.vscode\extensions\platformio.platformio-ide-1.9.0\node_modules\c...
ivankravets commented 5 years ago

@BowmanChow can you fix your conda installation? It's better to remove it and never use again. Please use original and official Python interpreter from https://www.python.org/

So, uninstall this conda and use Python 3.8. Please don't forget to check box with adding Python to PATH.

junbao-zhou commented 5 years ago

@ivankravets Thank you very much. I have fixed my conda installation. Your suggestions are really helpful.

jaime385 commented 4 years ago

I do really appreciate the help of both of you guys... In my case, I had the same issue of BowmanChow but I had to open the command prompt (since I am using windows) and delete manually a carpet just like this:

Windows

RD /S /Q " C:\Users\UserName.platformio

When I did so, In addition to installing the official python version (Link: https://www.python.org/downloads/) because I had also installed the Conda interpreter of python and uninstalled it the problem was solved.

Greetings guys. Thanks a lot.

XiaoboD commented 4 years ago

@BowmanChow What do you mean by "fix conda installation"? Does it means uninstall it? What should I do if I don't want to uninstall conda?

ivankravets commented 4 years ago

@XiaoboD do you use the latest conda? Please upgrade it.

future-device-labo commented 3 years ago

公式型 Python 3.9 を使用していますが 同様のエラーが発生してしまうようになりました