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

Installation Manager #1776

Closed
pottendo opened this issue Oct 22, 2021 · 3 comments
Closed

Installation Manager #1776

pottendo opened this issue Oct 22, 2021 · 3 comments

Comments

@pottendo
Copy link

pottendo commented Oct 22, 2021

Hi,

below the output when launching VSCode + platformio addon.
My system: Ubuntu 20.04, latest updates.
I've used VSCode and platformio heavily before on this machine, but after the latest updates, VSCode + pio failed to start, as it could recreate the penv.

So I've tried to install the penv by hand (without vscode, etc.), cleaned .platformio before, by using the commands:
$ python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
Installer version: 1.0.3
Platform: Linux-5.11.0-39-generic-x86_64-with-glibc2.33
Python version: 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/pottendo/.platformio/penv
/usr/bin/python3
Error: Could not create PIO Core Virtual Environment. Please report to https://github.com/platformio/platformio-core-installer/issues
Traceback (most recent call last):
File "", line 105, in
File "", line 101, in main
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/tmp/tmpp_zbtz_d']' returned non-zero exit status 1.

Unfortunately the installer is not very verbose about the reason, why the creation failed.
I tried to remove all artifacts of previous installations as good as I can:

  • .platformio
  • .vscode
    Ubuntu pio packages (sudo apt remove platformio)

Here the strace output of running the script get-platformio.py by hand:
https://pastebin.com/zayhJ2XV
(note that I've stripped out the quite long middle part - in case of need I can provide the full log)

thx for any support!

%23 Description of problem
Leave a comment...

BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN

%23 Configuration

VSCode: 1.61.2
PIO IDE: v2.3.4
System: Linux, 5.11.0-39-generic, x64

%23 Exception

Error: Error: Could not create PIO Core Virtual Environment. Please report to https://github.com/platformio/platformio-core-installer/issues
-> Installer version: 1.0.3
Platform: Linux-5.11.0-39-generic-x86_64-with-glibc2.33
Python version: 3.9.5 (default, May 11 2021, 08:20:37) 
[GCC 10.3.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/pottendo/.platformio/penv
/usr/bin/python3

  at /opt/home/pottendo/.vscode/extensions/platformio.platformio-ide-2.3.4/node_modules/platformio-node-helpers/dist/index.js:1:769806
  at ChildProcess.a (/opt/home/pottendo/.vscode/extensions/platformio.platformio-ide-2.3.4/node_modules/platformio-node-helpers/dist/index.js:1:771396)
  at ChildProcess.emit (events.js:315:20)
  at ChildProcess.EventEmitter.emit (domain.js:467:12)
  at maybeClose (internal/child_process.js:1048:16)
  at Socket.<anonymous> (internal/child_process.js:439:11)
  at Socket.emit (events.js:315:20)
  at Socket.EventEmitter.emit (domain.js:467:12)
  at Pipe.<anonymous> (net.js:673:12)
@pottendo
Copy link
Author

hi,
I somehow 'solved' my immediate problem:
Using `--verbose':
$ python3 ./get-platformio.py --verbose
Installer version: 1.0.3
Platform: Linux-5.11.0-39-generic-x86_64-with-glibc2.33
Python version: 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/pottendo/.platformio/penv
DEBUG: Current environment PATH /home/pottendo/bin:/home/pottendo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/opt/android-sdk-linux_86/platform-tools:/opt/android-ndk-r8d:/usr/local/sbt/bin:/home/pottendo/sripts:/home/pottendo/.platformio/penv/bin
DEBUG: Checking a Python candidate /usr/bin/python3
DEBUG: The Python 3.9.5 (/usr/bin/python3) interpreter is compatible.

[...]
DEBUG: Creating virtual environment: /bin/python3 /home/pottendo/.platformio/.cache/tmp/virtualenv.pyz /home/pottendo/.platformio/penv
DEBUG: Could not create virtualenv with downloaded script. Error: Command '['/bin/python3', '/home/pottendo/.platformio/.cache/tmp/virtualenv.pyz', '/home/pottendo/.platformio/penv']' returned non-zero exit status 1.
/usr/bin/python3
DEBUG: Could not find portable Python for linux_x86_64
Error: Could not create PIO Core Virtual Environment. Please report to https://github.com/platformio/platformio-core-installer/issues

So I changed to ~/.platformio/ and issued the command by hand:
$ python3 .cache/tmp/virtualenv.pyz pwd
created virtual environment CPython3.9.5.final.0-64 in 203ms
creator CPython3Posix(dest=/opt/home/pottendo/.platformio, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/opt/home/pottendo/.local/share/virtualenv)
added seed packages: pip==21.2.4, setuptools==58.1.0, wheel==0.37.0
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

and found that some directories appeared in ,platformio, so I restarted the initially downloaded script:
$ python3 ./get-platformio.py --verbose
Installer version: 1.0.3
Platform: Linux-5.11.0-39-generic-x86_64-with-glibc2.33
Python version: 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/pottendo/.platformio/penv
DEBUG: Current environment PATH /home/pottendo/bin:/home/pottendo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/opt/android-sdk-linux_86/platform-tools:/opt/android-ndk-r8d:/usr/local/sbt/bin:/home/pottendo/sripts:/home/pottendo/.platformio/penv/bin
DEBUG: Checking a Python candidate /usr/bin/python3
DEBUG: The Python 3.9.5 (/usr/bin/python3) interpreter is compatible.
DEBUG: Checking a Python candidate /bin/python3
DEBUG: The Python 3.9.5 (/bin/python3) interpreter is compatible.
DEBUG: Checking a Python candidate /home/pottendo/.platformio/penv/bin/python3
DEBUG: The Python 3.9.5 (/home/pottendo/.platformio/penv/bin/python3) interpreter is compatible.
DEBUG: Checking a Python candidate /home/pottendo/.platformio/penv/bin/python
DEBUG: The Python 3.9.5 (/home/pottendo/.platformio/penv/bin/python) interpreter is compatible.
DEBUG: Using /usr/bin/python3 Python for virtual environment.
DEBUG: Creating virtual environment: /usr/bin/python3 -m venv /home/pottendo/.platformio/penv
DEBUG: Creating virtual environment: /usr/bin/python3 -m virtualenv -p /usr/bin/python3 /home/pottendo/.platformio/penv
DEBUG: Creating virtual environment: virtualenv -p /usr/bin/python3 /home/pottendo/.platformio/penv
DEBUG: Creating virtual environment: /usr/bin/python3 -m virtualenv /home/pottendo/.platformio/penv
DEBUG: Creating virtual environment: virtualenv /home/pottendo/.platformio/penv
DEBUG: Could not create virtualenv with local packages Trying download virtualenv script and using it. Error: [Errno 2] No such file or directory: 'virtualenv'
DEBUG: Downloading virtualenv package archive
DEBUG: Creating virtual environment: /usr/bin/python3 /home/pottendo/.platformio/.cache/tmp/virtualenv.pyz /home/pottendo/.platformio/penv
Updating Python package manager (PIP) in a virtual environment
DEBUG: Creating pip.conf file in /home/pottendo/.platformio/penv
DEBUG: Downloading 'get-pip.py' installer...
DEBUG: Installing pip
PIP has been successfully updated!
[...]

and it worked.

You may close this ticket - though it's a bit strange for me.

thx, pottendo

@ivankravets
Copy link
Member

Did you install sudo apt-get install python3-venv #85 ?

If no, please install, run rm -rf ~/.platformio/penv and restart VSCode. Does it work now?

@ivankravets
Copy link
Member

See the solution in #1774

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

No branches or pull requests

2 participants