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

Linux: apt-get install python3-venv #85

Open
Yugo19 opened this issue Sep 12, 2020 · 14 comments
Open

Linux: apt-get install python3-venv #85

Yugo19 opened this issue Sep 12, 2020 · 14 comments

Comments

@Yugo19
Copy link

Yugo19 commented Sep 12, 2020

Solution

Some Linux distributives have a limited Python3 installed by default. Please install the following package and restart the IDE:

sudo apt-get install python3-venv

If you use a custom Python version, then

sudo apt-get install python3.xx-venv

where python3.xx equals the version of your Python interpreter (check it via python3 --version). For example, python3.10-venv for Python 3.10.

Now, please check your Python installation:

python3 -c "import venv; import ensurepip; print('Congrats! Python `venv` is already installed!')"

Finally, Restart VSCode.


%23 Description of problem
Leave a comment...

BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN

%23 Configuration

VSCode: 1.49.0
PIO IDE: v2.0.1
System: Linux, 4.19.0-10-amd64, x64

%23 Exception

Error: Error: Can not install PlatformIO Core due to a missed `distutils` package in your Python installation.
Please install this package manually using the OS package manager. For example:

$ apt-get install python3-distutils

(MAY require administrator access `sudo`)
-> Installer version: 0.3.4
Platform: Linux-4.19.0-10-amd64-x86_64-with-glibc2.28
Python version: 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/yugo/.platformio/penv

  at /home/yugo/.vscode/extensions/platformio.platformio-ide-2.0.1/node_modules/platformio-node-helpers/dist/webpack:/platformio-node-helpers/src/proc.js:138:23
  at ChildProcess.c (/home/yugo/.vscode/extensions/platformio.platformio-ide-2.0.1/node_modules/platformio-node-helpers/dist/webpack:/platformio-node-helpers/src/proc.js:124:5)
  at ChildProcess.emit (events.js:223:5)
  at ChildProcess.EventEmitter.emit (domain.js:475:20)
  at maybeClose (internal/child_process.js:1021:16)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
@ivankravets ivankravets changed the title Installation Manager Linux: apt-get install python3-distutils Sep 16, 2020
@ivankravets ivankravets reopened this Oct 16, 2020
@ivankravets ivankravets changed the title Linux: apt-get install python3-distutils Linux: 'apt-get install python3-venv' Nov 16, 2020
@ivankravets ivankravets pinned this issue Nov 16, 2020
@d42ohpaz
Copy link

d42ohpaz commented Feb 22, 2021

What's the command for MacOS Catalina? When I try to install PlatformIO on MacOS, I get the following errors:

Error: Error: Can not install PlatformIO Core due to a missed `distutils` package in your Python installation.
Please install this package manually using the OS package manager. For example:

$ apt-get install python3-distutils

(MAY require administrator access `sudo`)
 -> Installer version: 0.3.5
Platform: macOS-10.15.7
Python version: 3.9.1 (v3.9.1:1e5d33e9b9, Dec  7 2020, 12:10:52) 
[Clang 6.0 (clang-600.0.57)]
Python path: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
Creating a virtual environment at /Users/kstanl27/.platformio/penv

	at /Users/kstanl27/.vscode/extensions/platformio.platformio-ide-2.2.1/node_modules/platformio-node-helpers/dist/index.js:1:879275
	at Chi...
Error: Error: Can not install PlatformIO Core due to a missed `distutils` package in your Python installation. Please install this package manually using the OS package manager. For example:  $ apt-get install python3-distutils  (MAY require administrator access `sudo`)  -> Installer version: 0.3.5 Platform: macOS-10.15.7 Python version: 3.9.1 (v3.9.1:1e5d33e9b9, Dec  7 2020, 12:10:52)  [Clang 6.0 (clang-600.0.57)] Python path: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 Creating a virtual environment at /Users/kstanl27/.platformio/penv  	at /Users/kstanl27/.vscode/extensions/platformio.platformio-ide-2.2.1/node_modules/platformio-node-helpers/dist/index.js:1:879275 	at Chi...
onDidChangeNotification @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:738
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Error: Error: Can not install PlatformIO Core due to a missed `distutils` package in your Python installation.Please install this package manually using the OS package manager. For example:$ apt-get install python3-distutils(MAY require administrator access `sudo`) -> Installer version: 0.3.5Platform: macOS-10.15.7Python version: 3.9.1 (v3.9.1:1e5d33e9b9, Dec  7 2020, 12:10:52) [Clang 6.0 (clang-600.0.57)]Python path: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3Creating a virtual environment at /Users/kstanl27/.platformio/penv	at /Users/kstanl27/.vscode/extensions/platformio.platformio-ide-2.2.1/node_modules/platformio-node-helpers/dist/index.js:1:879275	at ChildProcess.c (/Users/kstanl27/.vscode/extensions/platformio.platformio-ide-2.2.1/node_modules/platformio-node-helpers/dist/index.js:1:879169)	at ChildProcess.emit (events.js:315:20)	at maybeClose (internal/child_process.js:1021:16)	at Socket.<anonymous> (internal/child_process.js:443:11)	at Socket.emit (events.js:315:20)	at Pipe.<anonymous> (net.js:674:12)
b @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60

Obviously there is no sudo apt-get install on mac. :)

Edit: I've already install Python3 via homebrew to no avail.

This was referenced Mar 22, 2021
@platformio platformio deleted a comment from thefat32 Jul 28, 2023
@platformio platformio deleted a comment from DrDimedrol Jul 28, 2023
@platformio platformio deleted a comment from SaeedHassan243 Jul 28, 2023
@platformio platformio deleted a comment from James-Livesey Jul 28, 2023
@platformio platformio deleted a comment from freynder Jul 28, 2023
@platformio platformio deleted a comment from patvdleer Jul 28, 2023
@platformio platformio deleted a comment from lukew151 Jul 28, 2023
@platformio platformio deleted a comment from lukew151 Jul 28, 2023
@platformio platformio deleted a comment from lukew151 Jul 28, 2023
@platformio platformio deleted a comment from lukew151 Jul 28, 2023
@platformio platformio deleted a comment from lukew151 Jul 28, 2023
@platformio platformio deleted a comment from AeroSynth Jul 28, 2023
@Mathe13
Copy link

Mathe13 commented Jul 28, 2023

The Python 3.8.10

Have you read the original comment #85 (comment) ?

It must be the following command in your case with default Python 3.8

apt-get install python3.8-venv

already used that comand

apt search python3.8 | grep -e venv -e ensurepip

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

python3.8-venv/focal-updates,focal-security,now 3.8.10-0ubuntu1~20.04.8 amd64 [instalado]
  Interactive high-level object-oriented language (pyvenv binary, version 3.8)

@ivankravets
Copy link
Member

Please run the following commands and provide output:

rm -rf ~/.platformio/penv
python3  get-platformio.py --verbose

@Mathe13
Copy link

Mathe13 commented Jul 28, 2023

Please run the following commands and provide output:

rm -rf ~/.platformio/penv
python3  get-platformio.py --verbose
Installer version: 1.2.0
Platform: Linux-5.10.0-1014-oem-x86_64-with-glibc2.29
Python version: 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/matheus/.platformio/penv
DEBUG: Current environment PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DEBUG: Checking a Python candidate /usr/bin/python3.9
DEBUG: Error: The Python 3.9.5 (/usr/bin/python3.9) interpreter is not compatible.
Reason: Could not find Python `venv` module

Error: Can not install PlatformIO Core due to a missed `venv` module in your Python installation.
Please install this package manually using the OS package manager. For example:

$ apt-get install python3-venv

(MAY require administrator access `sudo`)
Traceback (most recent call last):
  File "get-platformio.py", line 105, in <module>
    sys.exit(main())
  File "get-platformio.py", line 101, in main
    subprocess.check_call(command)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/tmp/tmpdzdpyx9p', '--verbose']' returned non-zero exit status 1.

@Mathe13
Copy link

Mathe13 commented Jul 28, 2023

removing python3.9 it worked

@ivankravets
Copy link
Member

We have improved the installer and now it ignores broken Python installations and uses the compatible Pythons. See https://github.com/platformio/platformio-core-installer/releases/tag/v1.2.1

Hope this release will fix the issue on Linux.

@ivankravets
Copy link
Member

PlatformIO IDE for VSCode 3.3.1 is out! https://github.com/platformio/platformio-vscode-ide/releases/tag/v3.3.1

@ivankravets ivankravets changed the title Linux: 'apt-get install python3.XX-venv python3.XX-distutils' Linux: 'apt-get install python3-venv' Aug 3, 2023
@ivankravets ivankravets changed the title Linux: 'apt-get install python3-venv' Linux: apt-get install python3-venv Aug 3, 2023
cfoucher-laas pushed a commit to owntech-foundation/Core that referenced this issue Jul 9, 2024
…75)

I got hit by the absence of `venv` Python package which blocks the proper install of Platform IO on Linux (Ubuntu 22.04). See the forum discussion [PlatformIO IDE can’t find Python interpreter on Linux](https://community.platformio.org/t/platformio-ide-cant-find-python-interpreter-on-linux/24262).
Notice that [their doc](https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation) is below truth:

> Linux Users: To ensure a smooth experience with PlatformIO, it is essential to have the [python3-venv](platformio/platformio-core-installer#85) package installed on your system.

but it's not about smooth experience: it just blocks the install of PlatformIO core!
jalinei pushed a commit to owntech-foundation/Core that referenced this issue Aug 28, 2024
…75)

I got hit by the absence of `venv` Python package which blocks the proper install of Platform IO on Linux (Ubuntu 22.04). See the forum discussion [PlatformIO IDE can’t find Python interpreter on Linux](https://community.platformio.org/t/platformio-ide-cant-find-python-interpreter-on-linux/24262).
Notice that [their doc](https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation) is below truth:

> Linux Users: To ensure a smooth experience with PlatformIO, it is essential to have the [python3-venv](platformio/platformio-core-installer#85) package installed on your system.

but it's not about smooth experience: it just blocks the install of PlatformIO core!
jalinei pushed a commit to owntech-foundation/Core that referenced this issue Aug 28, 2024
…75)

I got hit by the absence of `venv` Python package which blocks the proper install of Platform IO on Linux (Ubuntu 22.04). See the forum discussion [PlatformIO IDE can’t find Python interpreter on Linux](https://community.platformio.org/t/platformio-ide-cant-find-python-interpreter-on-linux/24262).
Notice that [their doc](https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation) is below truth:

> Linux Users: To ensure a smooth experience with PlatformIO, it is essential to have the [python3-venv](platformio/platformio-core-installer#85) package installed on your system.

but it's not about smooth experience: it just blocks the install of PlatformIO core!
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

7 participants