Platformio ide не устанавливается
Before 2019.10.11, the platformio IDE extension worked well.
But after 2019.10.11, every time I open vscode I get this message.
What I Have Found
- After I uninstall platformio IDE and tried to reinstall it (of course I failed), I found the folder "C:\Users\Bowman.platformio"'s size is only 0KB, and it contains only one folder ".cache".
BowmanChow commented Oct 18, 2019
@ivankravets Thank you very much. Now I can see errors.
The error occurs when running commands:
The errors are as follows
ivankravets commented Oct 18, 2019
@BowmanChow It can be linked with broken Python installation. Please open VSCode > Help > Developer tools > Console. Do you see any errors?
Package Manager¶
[Error 5] Access is denied¶
PlatformIO installs all packages to “ core_dir /packages” directory. You MUST HAVE write access to this folder. Please note that PlatformIO does not require “sudo”/administrative privileges.
Solution 1: Remove folder¶
A quick solution is to remove “ core_dir /packages” folder and repeat installation/building/uploading again.
Solution 2: Antivirus¶
Some antivirus tools forbid programs to create files in the background. PlatformIO Package Manager does all work in the background: downloads package, unpacks archive in temporary folder and moves final files to “ core_dir /packages” folder.
Antivirus tool can block PlatformIO, that is why you see “[Error 5] Access is denied”. Try to disable it for a while or add core_dir directory to exclusion/whitelist.
Solution 3: Run from Terminal¶
As we mentioned in “Solution 2”, antivirus tools can block background file system operations. Another solution is to run PlatformIO Core (CLI) from a system terminal.
Open System Terminal, on Windows cmd.exe (not PlatformIO IDE Terminal)
Build a project and upload firmware using PlatformIO Core (CLI) which will download and install all dependent packages:
If “pio” command is not globally available in your environment and you use PlatformIO IDE , please use built-in PlatformIO Core (CLI) which is located in:
Windows: C:\Users\\.platformio\penv\Scripts\platformio Please replace with a real user name
You can add platformio and pio commands to your system environment. See Install Shell Commands .
the-j0k3r commented Jun 19, 2019 •
Again, apm is responsible for all installations, theres is nothing this project can do about it.
EDit: OK your Atom 1.39.0 is beta2 so it still has supported node/electron versions. or maybe not because you are customizing things.
Your debug log though says
2119 warn enoent ENOENT: no such file or directory, open 'C:\Users\admin\AppData\Local\Temp\apm-install-dir-119519-21132-1mbyks.z9usz\package.json'
and
2129 verbose argv "C:\Users\admin\AppData\Local\atom\app-1.39.0-beta2\resources\app\apm\bin\node.exe" "C:\Users\admin\AppData\Local\atom\app-1.39.0-beta2\resources\app\apm\node_modules\npm\bin\npm-cli.js" "--globalconfig" "C:\Users\admin\.atom\.apm\.apmrc" "--userconfig" "C:\Users\admin\.atom\.apmrc" "install" "https://www.atom.io/api/packages/platformio-ide-terminal/versions/2.9.1/tarball" "--runtime=electron" "--target=3.1.10" "--dist-url=https://atom.io/download/electron" "--arch=x64" "--global-style"
"--runtime=electron" "--target=3.1.10" is not supported by node-pty-prebuilt 0.7.6 max is 2.0.0
Additional info
I installed platformio-ide on ubuntu 15.04 mate smoothly.
On another PC with windows7 U. it worked the first time and on another laptop
windows7 with U. I had to struggle after various installations and removals, but is now working.
Only the latter laptop with windows 7 professional does not want platformio.
Whenever I try to download the package platformio-ide-terminal it refuses to download and shows me the following error message:
node-pty-prebuilt@0.7.6 install C:\Users\alhut\AppData\Local\Temp\apm-install-dir-119026-6712-62men8.flm04\node_modules\platformio-ide-terminal\node_modules\node-pty-prebuilt
prebuild-install || node scripts/install.js
and I don't know what to do.
P.S. This is the error message that appears with npm-install installed.
The text was updated successfully, but these errors were encountered:
Install Python Interpreter¶
PlatformIO Core (CLI) is written in Python that is installed by default on the all popular OS except Windows.
Please navigate to official website and Download the latest Python and install it. Please READ NOTES BELOW.
If you do not install SSL/TLS certificates, PlatformIO will not be able to download dependent packages, libraries, and toolchains.
Please select Add Python to Path (see below), otherwise, python command will not be available.
What is .pio directory¶
Advanced Serial Monitor with UI¶
PlatformIO Core provides CLI version ( pio device monitor ) of Serial Monitor. If you need advanced instrument with a rich UI, we recommend free and multi-platform CoolTerm serial port terminal application.
Please note that you need to manually disconnect (close serial port connection) in CoolTerm before doing uploading in PlatformIO. PlatformIO can not disconnect/connect to a target device automatically when CoolTerm is used.
the-j0k3r commented Jul 24, 2019 •
People report it here because node-pty-prebuilt is a dependency of this software. If node-pty-prebuilt doesn't work with current electron/node versions than this software has control over using a different dependency that does work.
@UziTech The issues reported here are not related to node-pty-prebuilt not supporting higher node/electron versions, (e.g. the report above perfect example its a node-gyp issue), and node-pty-prebuilt issues are a completely separate issue. As for what other dependency would work, please open a separate issue or PR. Also node-pty-prebuilt/node-gyp failures are to be reported to their respective projects. Reporting everything here is not helpful to anyone as this is not those projects.
imal1 commented Jun 19, 2019
So, I changed to Atom release version 1.38.2 and the installation was success, thanks.
Maybe its helpful to others who have a similar problem and some problems for Atom beta version should be reported to apm developers.
Installation¶
Multiple PlatformIO Cores in a system¶
Multiple standalone PlatformIO Core (CLI) in a system could lead to the different issues. We highly recommend to keep one instance of PlatformIO Core or use built-in PlatformIO Core in PlatformIO IDE :
PlatformIO IDE for Atom - Menu PlatformIO: Settings > PlatformIO IDE > Use built-in PlatformIO Core
If you need to have PlatformIO Core (CLI) globally in a system, please Install Shell Commands .
‘platformio’ is not recognized as an internal or external command¶
If you use PlatformIO IDE , please check in PlatformIO IDE Settings that “Use built-in PlatformIO Core” is enabled.
If you modify system environment variable PATH in your Bash/Fish/ZSH profile, please do not override global PATH . This line export PATH="/my/custom/path" is incorrect. Use export PATH="/my/custom/path":$PATH instead.
Please check that your board’s PID and VID are listed in the rules. You can list connected devices and their PID/VID using pio device list command.
Please open system Terminal and type
Restart “udev” management tool:
Ubuntu/Debian users may need to add own “username” to the “dialout” group if they are not “root”, doing this issuing
Similarly, Arch users may need to add their user to the “uucp” group
You will need to log out and log back in again (or reboot) for the user group changes to take effect.
After this file is installed, physically unplug and reconnect your board.
ImportError: cannot import name _remove_dead_weakref¶
Windows users can experience this issue when multiple Python interpreters are installed in a system and conflict each other. The easy way to fix this problem is uninstalling all Python interpreters using Windows Programs Manager and installing them manually again.
“Windows > Start Menu > Settings > System > Apps & Features”, select Python interpreters and uninstall them.
Install the latest Python interpreter, see Install Python Interpreter guide
Remove C:\Users\YourUserName\.platformio and C:\.platformio folders if exist (do not forget to replace “YourUserName” with the real user name)
General¶
the-j0k3r commented May 25, 2019
Any installation issues are to/should be reported to apm issue tracker platformio-ide-terminal cannot control apm which is responsible for installs of all atom plugins and their dependencies anyway, so thanks in advance for your understanding in these matters.
What I Have Installed in My Computer
Visual Studio 2019
Visual Studio 2017
The text was updated successfully, but these errors were encountered:
DeathExploit commented Jan 27, 2019 •
See thats the problem; I use python 3
jaime385 commented Dec 2, 2019 •
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:
Platformio-IDE Core Failed to Retrieve.
I tried everything but the problem persists.
I followed the installation guide and everything seems to be fine but when I start Atom, is the welcome screen of platformio-ide but can not download or to start the core.
performing pip in the end the result is this:
PS C:\Users\fdebernardi> pio
Traceback (most recent call last):
File "C:\Python27\Lib\runpy.py", line 174, in _run_module_as_main
File "C:\Python27\Lib\runpy.py", line 72, in run_code
exec code in run_globals
File "C:\Users\fdebernardi.atom\packages\platformio-ide\penv\Scripts\pio.exe_main.py", line 5, in
File "c:\users\fdebernardi.atom\packages\platformio-ide\penv\lib\site-packages\platformio_main_.py", line 24, in
from platformio import version, exception, maintenance
File "c:\users\fdebernardi.atom\packages\platformio-ide\penv\lib\site-packages\platformio\maintenance.py", line 25, in
from platformio.commands.lib import lib_update as cmd_lib_update
File "c:\users\fdebernardi.atom\packages\platformio-ide\penv\lib\site-packages\platformio\commands\lib.py", line 32, in
" library storage %s " % join(util.get_home_dir(), "lib"))
File "c:\users\fdebernardi.atom\packages\platformio-ide\penv\lib\site-packages\platformio\util.py", line 214, in get_home_dir
os.makedirs(home_dir)
File "c:\users\fdebernardi.atom\packages\platformio-ide\penv\lib\os.py", line 150, in makedirs
makedirs(head, mode)
File "c:\users\fdebernardi.atom\packages\platformio-ide\penv\lib\os.py", line 150, in makedirs
makedirs(head, mode)
File "c:\users\fdebernardi.atom\packages\platformio-ide\penv\lib\os.py", line 150, in makedirs
makedirs(head, mode)
File "c:\users\fdebernardi.atom\packages\platformio-ide\penv\lib\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 3] Impossibile trovare il percorso specificato: 'Q:\\ '
PS C:\Users\fdebernardi>
Steps to Reproduce
For each new installation before doing a file cleaning eliminating atom from the control panel and folders in appdata and .atom
What I Have Tried
Uninstall vscode and reinstall it
Uninstall platformio IDE and reinstall it
Downgrade vscode from 1.39 to 1.37
Downgrade platfotmio IDE from 1.90 to 1.83
pip --no-cache-dir install -U platformio
conda install platformio
pip uninstall platform and then pip install platformio
Restart the computer
Uninstall platformio IDE and delete all the folders and files whose names contain 'platformio', and than reinstall platformio
Run vscode as administrator and install platformio IDE
I still haven't fixed the problem now.
ivankravets commented Oct 18, 2019
What is PlatformIO?¶
This comment has been minimized.
imal1 commented Jun 19, 2019
I met the same issure. It may not be an apm issue. I have tried clean cache of atom, apm and node. But the installation was still failed.
these is VERSIONS:
apm 2.2.4
npm 6.2.0
node 8.9.3 x64
atom 1.39.0-beta2
python 2.7.16
git 2.20.1.windows.1
visual studio
node-gyp 5.0.0
Here's a part of DEBUG LOG:
2119 warn enoent ENOENT: no such file or directory, open 'C:\Users\admin\AppData\Local\Temp\apm-install-dir-119519-21132-1mbyks.z9usz\package.json'
2120 verbose enoent This is related to npm not being able to find a file.
2121 warn apm-install-dir-119519-21132-1mbyks.z9usz No description
2122 warn apm-install-dir-119519-21132-1mbyks.z9usz No repository field.
2123 warn apm-install-dir-119519-21132-1mbyks.z9usz No README data
2124 warn apm-install-dir-119519-21132-1mbyks.z9usz No license field.
2125 verbose stack Error: node-pty-prebuilt@0.7.6 install: prebuild-install || node scripts/install.js
2125 verbose stack Exit status 1
2125 verbose stack at EventEmitter. (C:\Users\admin\AppData\Local\atom\app-1.39.0-beta2\resources\app\apm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
2125 verbose stack at emitTwo (events.js:126:13)
2125 verbose stack at EventEmitter.emit (events.js:214:7)
2125 verbose stack at ChildProcess. (C:\Users\admin\AppData\Local\atom\app-1.39.0-beta2\resources\app\apm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2125 verbose stack at emitTwo (events.js:126:13)
2125 verbose stack at ChildProcess.emit (events.js:214:7)
2125 verbose stack at maybeClose (internal/child_process.js:925:16)
2125 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2126 verbose pkgid node-pty-prebuilt@0.7.6
2127 verbose cwd C:\Users\admin\AppData\Local\Temp\apm-install-dir-119519-21132-1mbyks.z9usz
2128 verbose Windows_NT 10.0.17134
2129 verbose argv "C:\Users\admin\AppData\Local\atom\app-1.39.0-beta2\resources\app\apm\bin\node.exe" "C:\Users\admin\AppData\Local\atom\app-1.39.0-beta2\resources\app\apm\node_modules\npm\bin\npm-cli.js" "--globalconfig" "C:\Users\admin\.atom\.apm\.apmrc" "--userconfig" "C:\Users\admin\.atom\.apmrc" "install" "https://www.atom.io/api/packages/platformio-ide-terminal/versions/2.9.1/tarball" "--runtime=electron" "--target=3.1.10" "--dist-url=https://atom.io/download/electron" "--arch=x64" "--global-style"
2130 verbose node v8.9.3
2131 verbose npm v6.2.0
2132 error code ELIFECYCLE
2133 error errno 1
2134 error node-pty-prebuilt@0.7.6 install: prebuild-install || node scripts/install.js
2134 error Exit status 1
2135 error Failed at the node-pty-prebuilt@0.7.6 install script.
2135 error This is probably not a problem with npm. There is likely additional logging output above.
2136 verbose exit [ 1, true ]
Please check it, thanks!
What I Have Found
- After I uninstall platformio IDE and tried to reinstall it (of course I failed), I found the folder "C:\Users\Bowman.platformio"'s size is only 0KB, and it contains only one folder ".cache".
the-j0k3r commented Jul 22, 2019
@maxjkim It means it wasnt able to download the packages. please report that to APM issue tracker.
Troubleshooting¶
the-j0k3r commented Feb 7, 2019 •
Also regarding python error
gyp ERR! stack Error: Python executable "D:\PythonExec\python.EXE" is v3.6.0, which is not supported by gyp.
So open a ticket @node-gyp and as a workaround downgrade python to 3.5.2 which I know works fine, but to be safe, go with python 2.7.
What I Have Tried
Uninstall vscode and reinstall it
Uninstall platformio IDE and reinstall it
Downgrade vscode from 1.39 to 1.37
Downgrade platfotmio IDE from 1.90 to 1.83
pip --no-cache-dir install -U platformio
conda install platformio
pip uninstall platform and then pip install platformio
Restart the computer
Uninstall platformio IDE and delete all the folders and files whose names contain 'platformio', and than reinstall platformio
Run vscode as administrator and install platformio IDE
I still haven't fixed the problem now.
ivankravets commented Oct 18, 2019
So, uninstall this conda and use Python 3.8. Please don't forget to check box with adding Python to PATH.
the-j0k3r commented Feb 7, 2019 •
@daviwil could answer this better since he is involved with both node-pty-prebuilt and apm though hes an extremely busy guy.
Command completion in Terminal¶
AugustoPiva commented Jul 23, 2019
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-pty-prebuilt@0.7.6 install: prebuild-install || node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-pty-prebuilt@0.7.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\augus.atom.apm_logs\2019-07-23T22_15_03_865Z-debug.log
Which problem I'm facing?
Program Memory Usage¶
PlatformIO calculates firmware/program memory usage based on the next segments:
The code segment, also known as a text segment or simply as text, is where a portion of an object file or the corresponding section of the program’s virtual address space that contains executable instructions is stored and is generally read-only and fixed size.
The .data segment contains any global or static variables which have a pre-defined value and can be modified. The values for these variables are initially stored within the read-only memory (typically within .text ) and are copied into the .data segment during the start-up routine of the program. Example,
Uninitialized data is usually adjacent to the data segment. The BSS segment contains all global variables and static variables that are initialized to zero or do not have explicit initialization in the source code. For instance, a variable defined as static int i; would be contained in the BSS segment.
The rough calculation could be done as:
PROGRAM (Flash) = .text + .data
DATA (RAM) = .bss + .data
If you need to print all memory sections and addresses, please use pio run --verbose command.
Recommended for reading:
What is .pioenvs directory¶
Please refer to build_dir .
Building¶
UnicodeWarning: Unicode equal comparison failed¶
Full warning message is “UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal”.
KNOWN ISSUE. Please move your project to a folder which full path does not contain non-ASCII chars.
UnicodeDecodeError: Non-ASCII characters found in build environment¶
KNOWN ISSUE. PlatformIO Core (CLI) currently does not support projects which contain non-ASCII characters (codes) in a full path or depend on the libraries which use non-ASCII characters in their names.
TEMPORARY SOLUTION
Use PlatformIO IDE , it will automatically install PlatformIO Core (CLI) in a root of system disk ( %DISK%/.platformio ) and avoid an issue when system User contains non-ASCII characters
Do not use non-ASCII characters in project folder name or its parent folders.
Also, if you want to place PlatformIO Core (CLI) in own location, see:
Set PLATFORMIO_CORE_DIR environment variable with own path
Configure custom location per project using core_dir option in “platformio.ini” (Project Configuration File) .
Before 2019.10.11, the platformio IDE extension worked well.
But after 2019.10.11, every time I open vscode I get this message.
Convert Arduino file to C++ manually¶
Some Cloud & Desktop IDE doesn’t support Arduino files ( *.ino and .pde ) because they are not valid C/C++ based source files:
Function declarations are omitted.
In this case, code completion and code linting do not work properly or are disabled. To avoid this issue you can manually convert your INO files to CPP.
For example, we have the next Demo.ino file:
Let’s convert it to Demo.cpp :
Declare each custom function (excluding built-in, such as setup and loop ) before it will be called.
The final Demo.cpp :
the-j0k3r commented Jun 19, 2019 •
Where node-pty-prebuilt has not published higher abi binaries for electron/node for beta Atom version in the given platform that should be reported to node-pty-prebuilt repo.
The problem is users report it to this repo, and we have literally no control over how apm/node-pty-prebuilt work or what they support to the applicable release.
Maybe its helpful to others who have a similar problem and some problems for Atom beta version should be reported to apm developers.
All such installation issues should be reported to apm, no exceptions, though I bet no one (that reports them issue here) does the right thing.
Im glad its working now.
What I Have Installed in My Computer
Visual Studio 2019
Visual Studio 2017
BowmanChow commented Oct 19, 2019
@ivankravets Thank you very much. I have fixed my conda installation. Your suggestions are really helpful.
3 Answers 3
I had exactly the same issue. Did pretty much the same topics you described. For me it was related to the anaconda software.
I uninstalled anaconda, uninstall/reinstall platformio in the visual studio environment and it worked.
I got the message that the platformio service was already started and that got me thinking.
Thank you very much. I have found the problem. My conda's version is 4.7.12, it seems to have some bugs and report "[WinError 127] the specified procedure could not be found" when installing or updating a package. Downgrade conda and the problem will be fixed.
thats no big deal i had the same issue. just go to help > Toggle developers and in that press console and search platformIo that will show the error most likely with python installation . you might wants to install some packages manually. i was using ubuntu. so python packages conflicts.
Today I tried and (initially) failed to install PlatformIO on a Linux Mint 20.2 Cinnamon machine. VSCode V1.61.2 was freshly installed, Python3 was installed.
Trying to install PlatformIO told me that the Python on the machine was not suitable and installation failed.
After enabling Developer mode in VSCode (Help | Toggle Developer Tools) and trying the install again, I found an error message that told me that the distutils package for Python was missing.
That is because I had not installed pip3.
In the terminal, run sudo apt install python3-pip
That gets you the appropriate packages and then PlatformIO will install properly.
We have a big database with Frequently Asked Questions in our Community Forums. Please have a look at it.
the-j0k3r commented Jan 27, 2019 •
When I had issues or discovered issues it was just a case of resetting Atom to defaults, and unistalling + deletion of the platformio-ide-terminal folder/remnants from Atom, then re-installing via apm.
This is the best Ive seen platformio-ide-terminal work with 2.9.0
Actual Results
Platformio-IDE CORE not installed.
Читайте также: