What kind of issue is this?
Configuration
Operating system: Win 10 x64
PlatformIO Version (platformio --version): 6.1.7a2
Description of problem
When PlatformIO is installed in the system-wide Python interpreter, executing pio upgrade --dev fails with a
ERROR: Could not install packages due to an OSError: [WinError 32] The process cannot access the file because it used by another process 'c:\\users\\max\\appdata\\roaming\\python\\python311\\scripts\\pio.exe'
Check the permissions.
error message. I think what's going on here is that, when pio upgrade --dev is executed, the pio.exe binary starts, but tries to replace itself through pip, while it's still running of course. This configuration however never failed on previous PlatformIO versions.
Manually executing
python -m pip --no-cache-dir install --upgrade C:\Users\Max\.platformio\.cache\piocoredevelop.zip
made the installation go through. However even after that (latest dev core installed) the pio upgrade --dev fails again.
Steps to Reproduce
- Install Python 3 (for me: 3.11.1)
- Install PlatformIO core systemwide through
python3 -m pip install platformio
- Add PlatformIO to PATH
- Execute
pio upgrade --dev
Actual Results
>pio upgrade --dev
Please wait while upgrading PlatformIO ...
Error: ['C:\\Program Files\\Python311\\python.exe', '-m', 'pip', '--no-cache-dir', 'install', '--upgrade', 'C:\\Users\\Max\\.platformio\\.cache\\piocoredevelop.zip']
Defaulting to user installation because normal site-packages is not writeable
Processing c:\users\max\.platformio\.cache\piocoredevelop.zip
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: bottle==0.12.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (0.12.23)
Requirement already satisfied: click<9,>=8.0.4 in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (8.1.3)
Requirement already satisfied: colorama in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (0.4.6)
Requirement already satisfied: marshmallow==3.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (3.19.0)
Requirement already satisfied: pyelftools<1,>=0.27 in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (0.29)
Requirement already satisfied: pyserial==3.5.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (3.5)
Requirement already satisfied: requests==2.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (2.28.1)
Requirement already satisfied: semantic_version==2.10.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (2.10.0)
Requirement already satisfied: tabulate==0.9.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (0.9.0)
Requirement already satisfied: aiofiles==22.1.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (22.1.0)
Requirement already satisfied: ajsonrpc==1.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (1.2.0)
Requirement already satisfied: starlette==0.23.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (0.23.1)
Requirement already satisfied: uvicorn==0.20.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (0.20.0)
Requirement already satisfied: wsproto==1.2.* in c:\users\max\appdata\roaming\python\python311\site-packages (from platformio==6.1.7a2) (1.2.0)
Requirement already satisfied: packaging>=17.0 in c:\users\max\appdata\roaming\python\python311\site-packages (from marshmallow==3.*->platformio==6.1.7a2) (22.0)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\max\appdata\roaming\python\python311\site-packages (from requests==2.*->platformio==6.1.7a2) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in c:\users\max\appdata\roaming\python\python311\site-packages (from requests==2.*->platformio==6.1.7a2) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\max\appdata\roaming\python\python311\site-packages (from requests==2.*->platformio==6.1.7a2) (1.26.13)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\max\appdata\roaming\python\python311\site-packages (from requests==2.*->platformio==6.1.7a2) (2022.12.7)
Requirement already satisfied: anyio<5,>=3.4.0 in c:\users\max\appdata\roaming\python\python311\site-packages (from starlette==0.23.*->platformio==6.1.7a2) (3.6.2)
Requirement already satisfied: h11>=0.8 in c:\users\max\appdata\roaming\python\python311\site-packages (from uvicorn==0.20.*->platformio==6.1.7a2) (0.14.0)
Requirement already satisfied: sniffio>=1.1 in c:\users\max\appdata\roaming\python\python311\site-packages (from anyio<5,>=3.4.0->starlette==0.23.*->platformio==6.1.7a2) (1.3.0)
Building wheels for collected packages: platformio
Building wheel for platformio (setup.py): started
Building wheel for platformio (setup.py): finished with status 'done'
Created wheel for platformio: filename=platformio-6.1.7a2-py3-none-any.whl size=416943 sha256=84dd60205eb7972f87355eaadae49a585a8172ceaec56728f29795629d81ea5f
Stored in directory: C:\Users\Max\AppData\Local\Temp\pip-ephem-wheel-cache-eoacdet2\wheels\a8\af\55\66057c9e9aa863b757914a32210d6610e46a13ff91f653fb13
Successfully built platformio
Installing collected packages: platformio
Attempting uninstall: platformio
Found existing installation: platformio 6.1.7a2
Uninstalling platformio-6.1.7a2:
ERROR: Could not install packages due to an OSError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: 'c:\\users\\max\\appdata\\roaming\\python\\python311\\scripts\\pio.exe'
Check the permissions.
* Upgrade using `pip install -U platformio`
* Try different installation/upgrading steps:
https://docs.platformio.org/page/installation.html
Expected Results
PlatformIO upgrade works.
If problems with PlatformIO Build System:
Not applicable
Additional info
>pio system info
-------------------------- --------------------------------------------------------------------
PlatformIO Core 6.1.7a2
Python 3.11.1-final.0
System Type windows_amd64
Platform Windows-10
File System Encoding utf-8
Locale Encoding cp1252
PlatformIO Core Directory C:\Users\Max\.platformio
PlatformIO Core Executable C:\Users\Max\AppData\Roaming\Python\Python311\Scripts\platformio.exe
Python Executable C:\Program Files\Python311\python.exe
Global Libraries 0
Development Platforms 11
Tools & Toolchains 65
-------------------------- --------------------------------------------------------------------
What kind of issue is this?
If you’ve found a bug, please provide an information below.
Configuration
Operating system: Win 10 x64
PlatformIO Version (
platformio --version): 6.1.7a2Description of problem
When PlatformIO is installed in the system-wide Python interpreter, executing
pio upgrade --devfails with aerror message. I think what's going on here is that, when
pio upgrade --devis executed, thepio.exebinary starts, but tries to replace itself throughpip, while it's still running of course. This configuration however never failed on previous PlatformIO versions.Manually executing
made the installation go through. However even after that (latest dev core installed) the
pio upgrade --devfails again.Steps to Reproduce
python3 -m pip install platformiopio upgrade --devActual Results
Expected Results
PlatformIO upgrade works.
If problems with PlatformIO Build System:
Not applicable
Additional info