platformio-core-installer icon indicating copy to clipboard operation
platformio-core-installer copied to clipboard

subprocess.CalledProcessError

Open reza21310 opened this issue 5 years ago • 111 comments

Solutions

There are a few workarounds for this issue. Please try them from 1 to 3. If first does not work, then next, etc.

Solution 1

  1. Press Windows
  2. Start typing: App Execution Aliases
  3. Disable Python and Python3
  4. Restart VSCode.

Solution 2

  1. Create .platformio folder in the root of C: drive (OS drive).
  2. Restart VSCode.

Solution 3

  1. Install PlatformIO Core manually
  2. Restart VSCode.

See example

Screen Shot 2021-01-15 at 20 22 12

Solution 4

  1. Navigate to %USERHOME% folder in a File Explorer and RIGHT click on .platformio folder -> Properties. If your account name contains NON-ASCII chars, the .platformio folder will be located in the ROOT of your system drive (for example, C:\.platformio):

Screen Shot 2020-11-05 at 14 55 51

  1. Go to the “Security” tab and click on the “Advanced” option:

security-tab

  1. In the Advanced Security Settings window, check the option “Replace all child object permission entries with inheritable permission entries from this object“:

advanced-security

  1. Now, click on “Apply” and “OK” to save your changes. Close the Explorer and restart your computer. Check if you can access the files on the external drive.

P.S: Credits go to https://thegeekpage.com/fix-the-requested-operation-requires-elevation-error-740-in-windows-10/ (4 Step)


%23 Description of problem Leave a comment...

BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN

  • https://github.com/platformio/platformio-vscode-ide/issues%3Fq=is%3Aissue

%23 Configuration

VSCode: 1.50.1 PIO IDE: v2.1.0 System: Windows_NT, 10.0.18362, x64

%23 Exception

Error: Traceback (most recent call last):
File "C:\Users\USER\.platformio\.cache\tmp\get-platformio-0.3.5.py", line 69, in <module>
  main()
File "C:\Users\USER\.platformio\.cache\tmp\get-platformio-0.3.5.py", line 61, in main
  bootstrap()
File "C:\Users\USER\.platformio\.cache\tmp\get-platformio-0.3.5.py", line 47, in bootstrap
  pioinstaller.__main__.main()
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\pioinstaller\__main__.py", line 122, in main
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\click\core.py", line 829, in __call__
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\click\core.py", line 782, in main
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\click\core.py", line 1236, in invoke
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\click\core.py", line 1066, in invoke
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\click\core.py", line 610, in invoke
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\click\decorators.py", line 21, in new_func
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\pioinstaller\__main__.py", line 52, in cli
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\pioinstaller\core.py", line 72, in install_platformio_core
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\pioinstaller\penv.py", line 75, in create_core_penv
File "C:\Users\USER\.platformio\.cache\tmp\.piocore-installer-f3auf236\tmplh2w1f4h\pioinstaller.zip\pioinstaller\penv.py", line 144, in add_state_info
File "C:\Users\USER\.platformio\python3\lib\subprocess.py", line 411, in check_output
  **kwargs).stdout
File "C:\Users\USER\.platformio\python3\lib\subprocess.py", line 512, in run
  output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['C:\\Users\\USER\\.platformio\\penv\\Scripts\\python.exe', '-c', "import sys





Hi i get this error when installing PlatformIO 

reza21310 avatar Oct 15 '20 13:10 reza21310

Do you use antivirus tools?

ivankravets avatar Oct 16 '20 10:10 ivankravets

I have exactly the same problem with configuration: VSCode: 1.50.1 PIO IDE: v2.1.3 System: Windows_NT x64, 10.0.19041

wleagle avatar Oct 20 '20 06:10 wleagle

My problem solved. It is caused by a space in my username. Space is not allowed in the file path of python.

wleagle avatar Oct 20 '20 08:10 wleagle

Just tried in a clean VM box and "Don Pedro" works as expected. Please destroy from your system insecure and danger software, such as dr.web, kasperskyi, avast, avg, mcafee, etc.

Screen Shot 2020-10-20 at 14 03 52

ivankravets avatar Oct 20 '20 11:10 ivankravets

I had no softwares installed like you mentioned, @ivankravets.

VSCode 1.50.1 Core 5.0.1, Home 3.3.0 Python 3.9 (latest)

ambarusa avatar Oct 20 '20 11:10 ambarusa

@ambarusa could you provide your output from VSCode's console? See my screenshot above. VSCode > Help > Developer tools > Console.

ivankravets avatar Oct 20 '20 11:10 ivankravets

console.ts:137 [Extension Host] Error: Traceback (most recent call last): File "C:\Users\Adam Ambarus.platformio.cache\tmp\get-platformio-0.3.5.py", line 69, in main() File "C:\Users\Adam Ambarus.platformio.cache\tmp\get-platformio-0.3.5.py", line 61, in main bootstrap() File "C:\Users\Adam Ambarus.platformio.cache\tmp\get-platformio-0.3.5.py", line 47, in bootstrap pioinstaller.main.main() File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\pioinstaller_main_.py", line 122, in main File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\click\core.py", line 829, in call File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\click\core.py", line 782, in main File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\click\core.py", line 1236, in invoke File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\click\core.py", line 1066, in invoke File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\click\core.py", line 610, in invoke File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\click\decorators.py", line 21, in new_func File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\pioinstaller_main_.py", line 52, in cli File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\pioinstaller\core.py", line 72, in install_platformio_core File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\pioinstaller\penv.py", line 75, in create_core_penv File "C:\Users\Adam Ambarus.platformio.cache\tmp.piocore-installer-4fiaxrjr\tmp1g1qxxyl\pioinstaller.zip\pioinstaller\penv.py", line 144, in add_state_info File "C:\Users\Adam Ambarus.platformio\python3\lib\subprocess.py", line 411, in check_output **kwargs).stdout File "C:\Users\Adam Ambarus.platformio\python3\lib\subprocess.py", line 512, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['C:\Users\Adam Ambarus\.platformio\penv\Scripts\python.exe', '-c', "import sys; version=sys.version_info; print('%d.%d.%d'%(version[0],version[1],version[2]))"]' returned non-zero exit status 101. -> Installer version: 0.3.5 Platform: Windows-10 Python version: 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] Python path: C:\Users\Adam Ambarus.platformio\python3\python.exe Creating a virtual environment at C:\Users\Adam Ambarus.platformio\penv at c:\Users\Adam Ambarus.vscode\extensions\platformio.platformio-ide-2.1.3\node_modules\platformio-node-helpers\dist\index.js:1:879089 at ChildProcess.c (c:\Users\Adam Ambarus.vscode\extensions\platformio.platformio-ide-2.1.3\node_modules\platformio-node-helpers\dist\index.js:1:878983) at ChildProcess.emit (events.js:223:5) at ChildProcess.cp.emit (c:\Users\Adam Ambarus.vscode\extensions\platformio.platformio-ide-2.1.3\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

I hope this is the error log you are interested in, for any additional info, contact me.

ambarusa avatar Oct 20 '20 11:10 ambarusa

Could you open your CMD terminal and type?

"C:\Users\Adam Ambarus\.platformio\penv\Scripts\python.exe" -c "import sys; version=sys.version_info; print('%d.%d.%d'%(version[0],version[1],version[2]))"

ivankravets avatar Oct 20 '20 11:10 ivankravets

Unable to create process using 'C:\Users\Adam Ambarus.platformio\python3\python.exe -c "import sys; version=sys.version_info; print('%d.%d.%d'%(version[0],version[1],version[2]))"'

I get this response in admin mode too.

ambarusa avatar Oct 20 '20 11:10 ambarusa

Unable to create process using

I'm not familiar with Windows OS. I used it 15 years ago last time. What is the reason that you can't call Python from the shell and I can do this from my Windows VM box? Do you use any extra software that protects you?

ivankravets avatar Oct 20 '20 11:10 ivankravets

this command works, if I'm using python.exe from ...\AppData\Local\Programs\Python\Python39

I will come up with more information, after investigation.

ambarusa avatar Oct 20 '20 11:10 ambarusa

@ambarusa were you able to figure this out? I'm having the same issue, except I had PlatformIO working in August, and an update broke it. Reinstalling VS Code and installing old versions of PlatformIO still do not succeed. Deleting the .platformio cache between uninstall and reinstall also does not help.

I do not have any antivirus other than Security Essentials. Disabling Security Essentials real-time protection does not allow for successful installation.

cheintz avatar Oct 24 '20 05:10 cheintz

Same issue here. Tried to disable anti-virus, remove .platformio and obsolete VS Code extension folders, but still prompts the same error.

Installing the core in penv via pip install -U platformio works, though. Is there any way to bypass the core installation, and have the VS Code extension to use a pre-installed PIO core, as a temporary workaround?

MacroYau avatar Oct 24 '20 08:10 MacroYau

It looks like an issue with a security policy that does not allow to run PlatformIO Core pio.exe that was installed via Node.JS process (VSCode uses it). Maybe, some Windows updates?

ivankravets avatar Oct 25 '20 12:10 ivankravets

So some combination of uninstalling an old Python, installing a new python, and stopping a program I use called ActualWindowManager, followed by reinstalling VS Code, allowed PlatformIO Core to install. I've never had a problem with ActualWindowManager before, including installing previous versions of PlatformIO (I know I had it working in late August).

I've gotta say, though, the sheer number of errors people are having points to this installation procedure being super brittle. The attitude of "we don't support having Conda installed" and "you must be doing something wrong" is also worrying. I realized this is freeware, but devs dismissing installation issues for something that is designed to be easy-to-use is pretty jarring.

cheintz avatar Oct 26 '20 00:10 cheintz

I managed to solve the problem. I found in the logs, that it throwed an The requested operation requires elevation - Error 740 in Windows 10

https://thegeekpage.com/fix-the-requested-operation-requires-elevation-error-740-in-windows-10/ Fix.3 and Fix.4 did the work.

ambarusa avatar Nov 04 '20 16:11 ambarusa

@ambarusa, thank you so much for the solution!!! I've just updated the initial comment.

P.S: Did you change that slider before? How did it happen?

ivankravets avatar Nov 04 '20 16:11 ivankravets

I managed to solve the problem. I found in the logs, that it throwed an The requested operation requires elevation - Error 740 in Windows 10

https://thegeekpage.com/fix-the-requested-operation-requires-elevation-error-740-in-windows-10/ Fix.3 and Fix.4 did the work.

Thanks @ambarusa! The same trick works for me. Specifically, I applied Fix 4 on the .platformio folder under my user folder.

MacroYau avatar Nov 05 '20 06:11 MacroYau

Thanks, @MacroYau !!! The guide has been updated in the top comment.

I still don't understand what is the reason. What is your Win 10 edition?

Could you open PlatformIO CLI in VSCode and type?

pio system info

Please share here.

ivankravets avatar Nov 05 '20 13:11 ivankravets

@ivankravets Here's my pio system info output:

--------------------------  ----------------------------------------------------------
PlatformIO Core             5.0.2
Python                      3.7.7-final.0
System Type                 windows_amd64
Platform                    Windows-10
File System Encoding        utf-8
Locale Encoding             cp1252
PlatformIO Core Directory   C:\Users\Macro Yau\.platformio
PlatformIO Core Executable  C:\Users\Macro Yau\.platformio\penv\Scripts\platformio.exe
Python Executable           c:\users\macro yau\.platformio\penv\scripts\python.exe
Global Libraries            0
Development Platforms       0
Tools & Toolchains          2
--------------------------  ----------------------------------------------------------

Hope it helps tracing down the issue. Thanks!

MacroYau avatar Nov 06 '20 01:11 MacroYau

@MacroYau What is your Win 10 edition?

ivankravets avatar Nov 06 '20 16:11 ivankravets

I managed to solve the problem. I found in the logs, that it throwed an The requested operation requires elevation - Error 740 in Windows 10

https://thegeekpage.com/fix-the-requested-operation-requires-elevation-error-740-in-windows-10/ Fix.3 and Fix.4 did the work.

What do I need to do (fix.3 and fix.4)? I'm a total noob at this

KEdwards79 avatar Nov 07 '20 12:11 KEdwards79

Please scroll up ⬆️ to the beginning. There is a solution for this issue.

ivankravets avatar Nov 07 '20 13:11 ivankravets

I followed the "properties ->advanced, etc...) but still get the same error. platformio will not install, says platformio is not recognized when I try to update all image

KEdwards79 avatar Nov 07 '20 23:11 KEdwards79

image and this when I first open VSC

KEdwards79 avatar Nov 07 '20 23:11 KEdwards79

I have now tried all 4 fixes and still get the same error

KEdwards79 avatar Nov 12 '20 19:11 KEdwards79

Are you running VSCode as Administrator?

On Thu, Nov 12, 2020, 21:53 KEdwards79 [email protected] wrote:

I have now tried all 4 fixes and still get the same error

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/platformio/platformio-core-installer/issues/221#issuecomment-726305189, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGWNTOJVWGDIJUDXAGWDKXDSPQ4NHANCNFSM4SR7WVTA .

ambarusa avatar Nov 12 '20 20:11 ambarusa

yep, even tried disabling my antivirus. It was working, then the other day I went to install a couple of recommended extensions and after that, Platform IO IDE would not load. Tried uninstalling VSC, the settings folder and the extensions folder, did a clean install, same results. About to just give up at this point lol

KEdwards79 avatar Nov 13 '20 10:11 KEdwards79

I have the same problem, nothing of the above works for me unfortunately.

brandesjj avatar Nov 15 '20 19:11 brandesjj

@MacroYau What is your Win 10 edition?

I am on Windows 10 Enterprise, version 2004 (build 19041.630).

MacroYau avatar Nov 16 '20 02:11 MacroYau