Invalid decimal Literal in uuid.py

Hey I am using STM32F401CC with a stlink and I get this error when I try to upload code

[env:genericSTM32F401CC]
platform = ststm32
board = genericSTM32F401CC
framework = stm32cube
debug_tool = stlink
upload_protocol = stlink

On the CLI, what does pio system info output? Is it using your system-wide python3 install or, as is recommended, a local python environment? Issues like these say it’s an incompatibility with the used Python version.

An especial smoking gun is that ~/.local/lib/python3.10 should not show up in the stacktrace as a used python package if PlatformIO was installed via installer script – it should only use its own packages in ~/.platformio.

I got this output

Previously I used the install script after that all the pip installs were going to ~/.platformio/package directory, I thought that was weird so I removed that and just did pip install platformio

Can you tell me what the install script does to the global python environment.

No that’s exactly what the installer script is supposed to do – create a Python environment isolated from your system’s python environment.

I see two possibilities: To run PlatformIO from your system’s python, update the uuid library so that it can be properly imported (pip3 install --upgrade uuid I guess), or remove the global PlatformIO installation again (pip remove platformio) and install it via the docs, then add it do your PATH.

But it seems it’s causing some problems with packages, why I install any pip package it installs to the ~/.platformio directory, and any pip package I install is not readable by the jupyter notebook kernel, I have to delete the ~/.platformio directory then run the pip install again then its available, just tell me is there a way to turn off the platform io virtual environment, when I want to use platormio I can turn it on other time I can turn it off.

Or please guide me, if I am doing anything wrong, just guide me with some resources where I can understand whats happening, I found on internet to run this

~ ❯ pip -V
pip 22.3.1 from /home/anurag/.platformio/penv/lib/python3.10/site-packages/pip (python 3.10)

The main problem I am facing it with pip packages.

This too

~ ❯ which pip   
/home/anurag/.platformio/penv/bin/pip

~ ❯ which python
/home/anurag/.platformio/penv/bin/python

That should not happen if the instructions were followed properly. They don’t add the PlatformIO python to the $PATH, only a symbolic link to the pio executables are created in ~/.local/bin.

In a regular terminal:

max@max-VirtualBox:~$ pip3 -V
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
max@max-VirtualBox:~$ pip -V
pip 20.3.4 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
max@max-VirtualBox:~$ which pip
/usr/local/bin/pip
max@max-VirtualBox:~$ which python3
/usr/bin/python3
max@max-VirtualBox:~$ which pio
/home/max/.local/bin/pio
max@max-VirtualBox:~$ pio --version
PlatformIO Core, version 6.1.5
max@max-VirtualBox:~$ echo $PATH
/home/max/.local/bin:/home/max/Downloads/cross-pi-gcc-10.2.0-0/bin/:/home/max/.local/bin:/home/max/.local/bin:/home/max/.cargo/bin:/home/max/Downloads/cross-pi-gcc-10.2.0-0/bin/:/home/max/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

Double check that ~/.platformio... is not in your $PATH, remove it if needed from ~/.profile / ~/.bash_profile and perform the installation steps exactly as in the guide.

Note: It is expected that when you use VSCode and the “PlatformIO Core CLI”, that this opens inside the PlatformIO environment.
grafik

max@max-VirtualBox:~/x16-demo$ pip -V
pip 22.3.1 from /home/max/.platformio/penv/lib/python3.10/site-packages/pip (python 3.10)

Sorry for replying after a really long time, yeah now it’s fixed as I use the symbolic link method.
I added it to my PATH because the installer said to do so.

Thank you for helping me out :slight_smile: