platformio-vscode-ide icon indicating copy to clipboard operation
platformio-vscode-ide copied to clipboard

PermissionError: [Errno 13] Permission denied

Open redlooney opened this issue 5 years ago • 8 comments

Temporary solution

  1. Please check that antivirus tools do not block PlatformIO installer
  2. Try to kill all python.exe processes and restart VSCode.

Restart VSCode.


%23 Description of problem Leave a comment...

BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN

  • https://github.com/platformio/platformio-vscode-ide/issues

%23 Configuration

VSCode: 1.39.2 PIO IDE: v1.9.2 System: Windows_NT, 10.0.17763, x64

%23 Exception

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 "C:\Users\Gus\.platformio\.cache\tmp-131728a1FlsIuAE0A\virtualenv-16.7.5\virtualenv.py", line 2632, in <module>
    main()
  File "C:\Users\Gus\.platformio\.cache\tmp-131728a1FlsIuAE0A\virtualenv-16.7.5\virtualenv.py", line 870, in main
    symlink=options.symlink,
  File "C:\Users\Gus\.platformio\.cache\tmp-131728a1FlsIuAE0A\virtualenv-16.7.5\virtualenv.py", line 1156, in create_environment
    install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
  File "C:\Users\Gus\.platformio\.cache\tmp-131728a1FlsIuAE0A\virtualenv-16.7.5\virtualenv.py", line 1526, in install_python
    shutil.copyfile(executable, py_executable)
  File "C:\Users\Gus\.platformio\python37\lib\shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Gus\\.platformio\\penv\\Scripts\\python.exe'

Using base prefix 'C:\\Users\\Gus\\.platformio\\python37'
New python executable in C:\Users\Gus\.platformio\penv\Scripts\python.exe

	at t.value (c:\Users\Gus\.vscode\extensions\platformio.platformio-ide-1.9.2\node_modules\platformio-node-helpers\dist\index.js:1:32251)

redlooney avatar Oct 20 '19 08:10 redlooney

Do you use Antivirus tools in a system?

ivankravets avatar Oct 20 '19 09:10 ivankravets

Machine reboot fixed it for me. https://github.com/platformio/platformio-vscode-ide/issues/1216

FireDeveloper avatar Oct 20 '19 10:10 FireDeveloper

I uninstalled vscode, uninstalled all python versions I had installed, rebooted my pc, and reinstalled vscode, on first launch it downloaded platformio and all worked then,

kristapsdravnieks avatar Oct 21 '19 12:10 kristapsdravnieks

Ok.

EngAdriano avatar Oct 21 '19 14:10 EngAdriano

On an interesting note. For me, this was caused by a file being set with admin privileges. This was not by me so somehow the IDE set the file to admin... After copying out the file and then back in the error went away.

SpaceCadet-Code avatar Dec 10 '19 21:12 SpaceCadet-Code

I removed my virtualenv folder in the project itself but my VSC settings where still pointing to the executable of python which i threw away. After selecting the system python version I could create my venv again.

image image

0x78f1935 avatar Mar 02 '20 20:03 0x78f1935

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 avatar Jun 03 '20 11:06 ivankravets

Hi I still have this issue. Tried to reinstall Visual Studio code + Platformio. But the issue is still there. regards Waldemar

baerwa avatar Dec 03 '20 16:12 baerwa