Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOError: PackageManager is unable to install tool #61

Closed
tekk opened this issue Dec 14, 2017 · 25 comments
Closed

IOError: PackageManager is unable to install tool #61

tekk opened this issue Dec 14, 2017 · 25 comments

Comments

@tekk
Copy link

tekk commented Dec 14, 2017

This is a known bug with Microsoft VSCode and we depend on it microsoft/vscode#36630

Temporary solution


>pio platform install espressif32
Please wait while upgrading PlatformIO...
Platform Espressif 32
--------
Updating espressif32                     @ 0.11.0         [Up-to-date]
Updating tool-esptoolpy                  @ 1.20100.0      [Up-to-date]
Updating framework-arduinoespressif32    @ 1.3.2          [Up-to-date]
Uninstalling toolchain-xtensa32 @ 2.50200.0:    [OK]

PlatformIO has been successfully upgraded to 3.5.0rc6!


*************************************************************************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for IoT development > http://platformio.org/platformio-ide
- support us with PlatformIO Plus > https://pioplus.com
*************************************************************************************************************************************

PlatformManager: Installing espressif32
espressif32 @ 0.11.0 is already installed
PackageManager: Installing toolchain-xtensa32 @ ~1.50200.2
Downloading  [------------------------------------]    0%
Please manually remove file `C:\Users\tekks\.platformio\packages\_tmp_installing-au4eow-package\toolchain-xtensa32-windows-1.50200.2.tar.gz`
Warning! Package Mirror: [Error 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\tekks\\.platformio\\packages\\_tmp_installing-au4eow-package\\toolchain-xtensa32-windows-1.50200.2.tar.gz'
Looking for other mirror...
Downloading  [------------------------------------]    0%
Please manually remove file `C:\Users\tekks\.platformio\packages\_tmp_installing-zzgqel-package\toolchain-xtensa32-windows-1.50200.2.tar.gz`
Warning! Package Mirror: [Error 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\tekks\\.platformio\\packages\\_tmp_installing-zzgqel-package\\toolchain-xtensa32-windows-1.50200.2.tar.gz'
Looking for other mirror...
Error: Could not install 'toolchain-xtensa32' with version requirements '~1.50200.2' for your system 'windows_amd64'.
If you use Antivirus, it can block PlatformIO Package Manager. Try to disable it for a while.
@ivankravets
Copy link
Member

What are your OS version and locale?

@ivankravets
Copy link
Member

ivankravets commented Dec 14, 2017

This is a VSCode Terminal bug. I played a few hours on a remote machine (some of our users provided remote access) with this issue yesterday. The problem is linked with Python Socket library. I don't know how does it relate to VSCode Terminal extension but it raises IOError: [Errno 0] Error exception with a simple Python script:

from urllib2 import urlopen

url = "http://dl.platformio.org/packages/toolchain-xtensa-windows-1.40802.0.tar.gz"

r = urlopen(url)
i = 0
for chunk in r.read(1024):
    i += 1
    print i

If you run this script on an affected machine using native CMD terminal or even our Terminal for Atom, there is no issue.

I have a few VM machines with different Window versions and can't reproduce it.

We will provide a step-by-step guide in our docs for VSCode in "Know issues" section and explain how to use installed PIO Core with native cmd tool for the first time (to download dependent toolchains).

Related issues: https://community.platformio.org/t/packagemanager-is-unable-to-install-tool/2662


@Tyriar do you have any ideas? We experience this problem a long time. I know you use pty.js the same as we do in Atom, why it works with Atom but does not work with VSCode?

@ivankravets ivankravets changed the title Unable to install platform espressif32 PackageManager is unable to install tool Dec 14, 2017
@ivankravets
Copy link
Member

@Tyriar
Copy link

Tyriar commented Dec 14, 2017

@ivankravets VS Code now uses node-pty which has diverged significantly from pty.js, maybe the problem is in one of the changes?

@ivankravets
Copy link
Member

@Tyriar would you like to have access to the affected machine and debug this issue? I can agree that with our user.

Thanks!

@tekk
Copy link
Author

tekk commented Dec 14, 2017 via email

@ivankravets
Copy link
Member

@tekk please open PIO IDE Terminal in VSCode and type pio upgrade. You should be upgraded to 3.5.0rc7. Try to build a project again. Which errors do you see now?

@Tyriar
Copy link

Tyriar commented Dec 14, 2017

@ivankravets I think this class of issues can probably be reproduced easily, I don't have time to investigate atm though unfortunately.

@tekk
Copy link
Author

tekk commented Dec 14, 2017

Installing PlatformIO Core...
Please don't close this window and don't open other folders until this process is completed.

...

> Executing task: C:\Python27\Scripts\platformio.exe run <


*************************************************************************************************************************************
If you like PlatformIO, please:
-Error: Traceback (most recent call last):
  File "c:\python27\lib\site-packages\platformio\__main__.py", line 107, in main
    cli(None, None, None)
  File "c:\python27\lib\site-packages\click\core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "c:\python27\lib\site-packages\click\core.py", line 680, in main
    rv = self.invoke(ctx)
  File "c:\python27\lib\site-packages\click\core.py", line 1024, in invoke
    Command.invoke(self, ctx)
  File "c:\python27\lib\site-packages\click\core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python27\lib\site-packages\click\core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "c:\python27\lib\site-packages\click\decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\python27\lib\site-packages\platformio\__main__.py", line 76, in cli
    maintenance.on_platformio_start(ctx, force, caller)
  File "c:\python27\lib\site-packages\platformio\maintenance.py", line 49, in on_platformio_start
    after_upgrade(ctx)
  File "c:\python27\lib\site-packages\platformio\maintenance.py", line 146, in after_upgrade
    click.style("https://twitter.com/PlatformIO_Org", fg="cyan"))
  File "c:\python27\lib\site-packages\click\utils.py", line 314, in echo
    file.write(message)
  File "c:\python27\lib\site-packages\click\_compat.py", line 560, in _safe_write
    return _write(s)
  File "c:\python27\lib\site-packages\colorama\ansitowin32.py", line 40, in write
    self.__convertor.write(text)
  File "c:\python27\lib\site-packages\colorama\ansitowin32.py", line 141, in write
    self.write_and_convert(text)
  File "c:\python27\lib\site-packages\colorama\ansitowin32.py", line 166, in write_and_convert
    self.write_plain_text(text, cursor, start)
  File "c:\python27\lib\site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
    self.wrapped.write(text[start:end])
  File "c:\python27\lib\site-packages\click\_compat.py", line 97, in write
    return self.buffer.write(str(x))
IOError: [Errno 0] Error

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  http://docs.platformio.org/en/latest/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio/issues

============================================================

The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

@platformio platformio deleted a comment from tekk Dec 14, 2017
@platformio platformio deleted a comment from tekk Dec 14, 2017
@ivankravets
Copy link
Member

@tekk here is temporary solution http://docs.platformio.org/en/latest/ide/vscode.html#known-issues. You need to do that one time. Let's wait when @Tyriar will fix this issue with VSCode. Otherwise, please switch to Atom where all work without any problems.

@tekk
Copy link
Author

tekk commented Dec 14, 2017

Yup I've already did that. It's a pitty that VS Code integration is so poor compared to Atom. I prefer VS Code... Thanks anyway.

@ivankravets
Copy link
Member

We depend on a few blocked issues by @microsoft for a few months. I think they will fix them next year or in 2020. The process is very slow. I even do not know when this issue with terminal and IOError: [Errno 0] Error will be fixed.

@ivankravets
Copy link
Member

@tekk

  1. Close Atom and VSCode.
  2. Kill process with python and pioplus
  3. Open OS Control Panel, uninstall ALL Pythons from a system
  4. Remove C:\Python27 folder if exists
  5. Remove %HOME_DIR%/.platformio folder.
  6. Open Atom. Build project. Now, use VSCode.

@ivankravets
Copy link
Member

@Tyriar how can we disable VSCode terminal for tasks? I remember 1.0.0 version of tasks.json has used default Output Panel. Starting from 2.0.0 VSCode switched to a terminal which leads to a ton of problems. I don't see in API how to disable terminal for tasks. Our source code for Tasks.


I see ~5,000 IOError exceptions in our telemetry stats reported by hundred users who use VSCode+Windows for the last days. It seems that we should disable our extension for Windows users to avoid misunderstanding with this issue.

Also, all Python users are affected who use sockets or multithread features.

/cc @dbaeumer

Thanks!

@tekk
Copy link
Author

tekk commented Dec 15, 2017

@ivankravets I did exactly the steps you wrote. (I had 3 different pythons on my system and there was C:\python27 dir still after uninstalling them).

I ran Atom. It installed PlatformIO Core. After restarting, PlafrormIO Home page was stuck (kept loading forever). So after some 5-10 minutes I closed it.
I've tried to build my project, it built it with no problems.
Restarted Atom, to see what version of PIO I currently have (the Home page loaded up OK).
Home 0.5.3·Core 3.5.0rc8

Now I closed Atom, and opened VSCode.
PIO Home opened. Loaded in just a few seconds and version was also
Home 0.5.3·Core 3.5.0rc8

Then I tried to compile under VSCode and it also compiled fine.
Excellent. 👍

Last thing I wanted to try is to update espressif32 platform from terminal as this was failing before on VSCode.
I opened PlatformIO: New terminal:

>pio platform install espressif32
PlatformManager: Installing espressif32
espressif32 @ 0.11.0 is already installed
PackageManager: Installing toolchain-xtensa32 @ ~1.50200.2
Downloading  [------------------------------------]    0%
Error: Please read http://bit.ly/package-manager-ioerror
Warning! Package Mirror: [Errno 0] Error
Looking for other mirror...
Downloading  [------------------------------------]    0%
Error: Please read http://bit.ly/package-manager-ioerror
Warning! Package Mirror: [Errno 0] Error
Looking for other mirror...
Error: Could not install 'toolchain-xtensa32' with version requirements '~1.50200.2' for your system 'windows_amd64'.
If you use Antivirus, it can block PlatformIO Package Manager. Try to disable it for a while.

Is this that Known Issue? Even after this the project compiled fine.
I'm happy that I have working VSCode + PIO again!
Thank you very much for your effort and help! 👍 I was already tired of reinstalling over and over again...

This solved my issues with VSCode and Atom.

@dbaeumer
Copy link

@ivankravets contributed tasks can only be executed in the terminal. There is no support to execute them in the deprecated output runner. Task contribution via extensions is a feature that got introduced with running tasks in the terminal and was never available with task being executed in the output channel.

@ivankravets
Copy link
Member

@dbaeumer Thanks! Now we have a clear picture. I'll add information to our site and warning in our extension that we don't support VSCode for Windows in a case with this bug.

Happy Holidays!

@platformio platformio deleted a comment from tekk Dec 15, 2017
@platformio platformio deleted a comment from tekk Dec 15, 2017
@platformio platformio deleted a comment from tekk Dec 15, 2017
@tekk
Copy link
Author

tekk commented Dec 15, 2017

Please don't abandon VSCode.

@Tyriar
Copy link

Tyriar commented Dec 18, 2017

FYI the Windows team has fixed this, it will take time to get the update out though microsoft/vscode#36630

@ivankravets
Copy link
Member

Thanks, @Tyriar for the info!

@ivankravets ivankravets changed the title PackageManager is unable to install tool IOError: PackageManager is unable to install tool Jan 18, 2018
@Ravenheart
Copy link

It is now march 2018 and this bug is still not fixed, the PlatformIO IDE comparison chart clearly shows VSCode as the better host IDE and yet something as simple as installing a package basically renders the whole project unusable.

@ivankravets
Copy link
Member

@Ravenheart Thank you very much for the NEGATIVE review https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide#review-details. Please read this issue carefully, we can't fix it because the bug is linked with @microsoft (not with @platformio)

P.S: microsoft/vscode#36630

@Tyriar
Copy link

Tyriar commented Mar 3, 2018

@Ravenheart yes there is nothing @ivankravets or even the VS Code team can do about this, it's a regression in Windows which is already fixed but takes a long time to roll out due to the complexity of the project.

@ivankravets
Copy link
Member

Temporary workaround for VSCode issue in platformio/platformio-core@59fe190

@ivankravets
Copy link
Member

Please re-run in terminal pio upgrade --dev. Should work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants