Installation on macOS Sequoia 15.2

I am trying to get started with PlatformIO but the installation of the Visual Studio Code extension fails. I’m running Visual Studio 1.96.4 and added the PlatformIO IDE extension 3.3.4. After the extension installs it downloads its own Python, PlatformIO Core and asks to restart Visual Studio. However, upon restart it does not detect PlatformIO Core and tries to install it over and over.

I opened a GitHub issue but maybe this forum can help me. I opened the Developer Tools console in VSCode and see this error:

Error: Error: Compatible PlatformIO Core not found.
Reason: Could not run `/Users/adrian/.platformio/penv/bin/platformio --help`.

It seems like the virtual environment is not correct, but I imagine that with millions of downloads, there is probably some version conflict. Does anyone has an idea what I can try to fix the problem?

  1. rm -rf /Users/adrian/.platformio/
  2. Execute super-quick installer script per https://docs.platformio.org/en/latest/core/installation/methods/installer-script.html#super-quick-macos-linux
  3. Relaunch VSCode

Thanks a lot @maxgerhardt for your help, unfortunately the problem persists. I put below the full log in case you see what could be wrong.

rm -rf /Users/adrian/.platformio
OK, folder is gone, curl from the docs to get the installation script also OK

~
python3 get-platformio.py
Installer version: 1.2.2
Platform: macOS-15.2
Python version: 3.11.11 (main, Jan 26 2025, 13:36:19) [Clang 16.0.0 (clang-1600.0.26.6)]
Python path: /Users/adrian/.pyenv/versions/3.11.11/bin/python
Creating a virtual environment at /Users/adrian/.platformio/penv
Updating Python package manager (PIP) in the virtual environment
Requirement already satisfied: pip in ./.platformio/penv/lib/python3.11/site-packages (24.0)
Collecting pip
  Downloading pip-25.0-py3-none-any.whl.metadata (3.7 kB)
Downloading pip-25.0-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 3.6 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-25.0
PIP has been successfully updated!
Virtual environment has been successfully created!
Installing PlatformIO Core
Collecting platformio
  Downloading platformio-6.1.16.tar.gz (239 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting bottle==0.13.* (from platformio)
  Downloading bottle-0.13.2-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting click<9,>=8.0.4 (from platformio)
  Downloading click-8.1.8-py3-none-any.whl.metadata (2.3 kB)
Collecting colorama (from platformio)
  Downloading colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting marshmallow==3.* (from platformio)
  Downloading marshmallow-3.26.0-py3-none-any.whl.metadata (7.3 kB)
Collecting pyelftools<1,>=0.27 (from platformio)
  Downloading pyelftools-0.31-py3-none-any.whl.metadata (381 bytes)
Collecting pyserial==3.5.* (from platformio)
  Downloading pyserial-3.5-py2.py3-none-any.whl.metadata (1.6 kB)
Collecting requests==2.* (from platformio)
  Downloading requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting semantic_version==2.10.* (from platformio)
  Downloading semantic_version-2.10.0-py2.py3-none-any.whl.metadata (9.7 kB)
Collecting tabulate==0.* (from platformio)
  Downloading tabulate-0.9.0-py3-none-any.whl.metadata (34 kB)
Collecting ajsonrpc==1.2.* (from platformio)
  Downloading ajsonrpc-1.2.0-py3-none-any.whl.metadata (6.9 kB)
Collecting starlette<0.40,>=0.19 (from platformio)
  Downloading starlette-0.39.2-py3-none-any.whl.metadata (6.0 kB)
Collecting uvicorn<0.31,>=0.16 (from platformio)
  Downloading uvicorn-0.30.6-py3-none-any.whl.metadata (6.6 kB)
Collecting wsproto==1.* (from platformio)
  Downloading wsproto-1.2.0-py3-none-any.whl.metadata (5.6 kB)
Collecting chardet<6,>=3.0.2 (from platformio)
  Downloading chardet-5.2.0-py3-none-any.whl.metadata (3.4 kB)
Collecting packaging>=17.0 (from marshmallow==3.*->platformio)
  Downloading packaging-24.2-py3-none-any.whl.metadata (3.2 kB)
Collecting charset-normalizer<4,>=2 (from requests==2.*->platformio)
  Downloading charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl.metadata (35 kB)
Collecting idna<4,>=2.5 (from requests==2.*->platformio)
  Downloading idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting urllib3<3,>=1.21.1 (from requests==2.*->platformio)
  Downloading urllib3-2.3.0-py3-none-any.whl.metadata (6.5 kB)
Collecting certifi>=2017.4.17 (from requests==2.*->platformio)
  Downloading certifi-2024.12.14-py3-none-any.whl.metadata (2.3 kB)
Collecting h11<1,>=0.9.0 (from wsproto==1.*->platformio)
  Downloading h11-0.14.0-py3-none-any.whl.metadata (8.2 kB)
Collecting anyio<5,>=3.4.0 (from starlette<0.40,>=0.19->platformio)
  Downloading anyio-4.8.0-py3-none-any.whl.metadata (4.6 kB)
Collecting sniffio>=1.1 (from anyio<5,>=3.4.0->starlette<0.40,>=0.19->platformio)
  Downloading sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB)
Collecting typing_extensions>=4.5 (from anyio<5,>=3.4.0->starlette<0.40,>=0.19->platformio)
  Downloading typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Downloading ajsonrpc-1.2.0-py3-none-any.whl (22 kB)
Downloading bottle-0.13.2-py2.py3-none-any.whl (104 kB)
Downloading marshmallow-3.26.0-py3-none-any.whl (50 kB)
Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
Downloading requests-2.32.3-py3-none-any.whl (64 kB)
Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Downloading tabulate-0.9.0-py3-none-any.whl (35 kB)
Downloading wsproto-1.2.0-py3-none-any.whl (24 kB)
Downloading chardet-5.2.0-py3-none-any.whl (199 kB)
Downloading click-8.1.8-py3-none-any.whl (98 kB)
Downloading pyelftools-0.31-py3-none-any.whl (180 kB)
Downloading starlette-0.39.2-py3-none-any.whl (73 kB)
Downloading uvicorn-0.30.6-py3-none-any.whl (62 kB)
Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Downloading anyio-4.8.0-py3-none-any.whl (96 kB)
Downloading certifi-2024.12.14-py3-none-any.whl (164 kB)
Downloading charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl (194 kB)
Downloading h11-0.14.0-py3-none-any.whl (58 kB)
Downloading idna-3.10-py3-none-any.whl (70 kB)
Downloading packaging-24.2-py3-none-any.whl (65 kB)
Downloading urllib3-2.3.0-py3-none-any.whl (128 kB)
Downloading sniffio-1.3.1-py3-none-any.whl (10 kB)
Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Building wheels for collected packages: platformio
  Building wheel for platformio (pyproject.toml) ... done
  Created wheel for platformio: filename=platformio-6.1.16-py3-none-any.whl size=420047 sha256=9fe4d6892002cf763345f9388e828900c2abaaa33481c8f658ed6155616bb4e9
  Stored in directory: /Users/adrian/Library/Caches/pip/wheels/5c/07/02/8eaf6e48aa4805731974ea928cf8c87a1f8b08c0678d1d223a
Successfully built platformio
Installing collected packages: pyserial, pyelftools, bottle, urllib3, typing_extensions, tabulate, sniffio, semantic_version, packaging, idna, h11, colorama, click, charset-normalizer, chardet, certifi, ajsonrpc, wsproto, uvicorn, requests, marshmallow, anyio, starlette, platformio
Successfully installed ajsonrpc-1.2.0 anyio-4.8.0 bottle-0.13.2 certifi-2024.12.14 chardet-5.2.0 charset-normalizer-3.4.1 click-8.1.8 colorama-0.4.6 h11-0.14.0 idna-3.10 marshmallow-3.26.0 packaging-24.2 platformio-6.1.16 pyelftools-0.31 pyserial-3.5 requests-2.32.3 semantic_version-2.10.0 sniffio-1.3.1 starlette-0.39.2 tabulate-0.9.0 typing_extensions-4.12.2 urllib3-2.3.0 uvicorn-0.30.6 wsproto-1.2.0

PlatformIO Core has been successfully installed into an isolated environment `/Users/adrian/.platformio/penv`!

The full path to `platformio.exe` is `/Users/adrian/.platformio/penv/bin/platformio`

If you need an access to `platformio.exe` from other applications, please install Shell Commands
(add PlatformIO Core binary directory `/Users/adrian/.platformio/penv/bin` to the system environment PATH variable):

See https://docs.platformio.org/page/installation.html#install-shell-commands

But then, problem still there. I noticed that this installation script did not download its own python 3.11.7, after installation the virtual environment is using the same python version that was used by the installer, 3.11.11 in my example.

~ 
source /Users/adrian/.platformio/penv/bin/activate

penv ~
python --version
Python 3.11.11

penv ~
/Users/adrian/.platformio/penv/bin/platformio --help
ModuleNotFoundError: Traceback (most recent call last):
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/platformio/__main__.py", line 103, in main
    cli()  # pylint: disable=no-value-for-parameter
    ^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 1081, in main
    with self.make_context(prog_name, args, **extra) as ctx:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 949, in make_context
    self.parse_args(ctx, args)
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 1653, in parse_args
    rest = super().parse_args(ctx, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 1417, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 2403, in handle_parse_result
    value = self.process_value(ctx, value)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 2365, in process_value
    value = self.callback(ctx, self, value)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/decorators.py", line 550, in show_help
    echo(ctx.get_help(), color=ctx.color)
         ^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 711, in get_help
    return self.command.get_help(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 1334, in get_help
    self.format_help(ctx, formatter)
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 1367, in format_help
    self.format_options(ctx, formatter)
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 1573, in format_options
    self.format_commands(ctx, formatter)
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/click/core.py", line 1626, in format_commands
    cmd = self.get_command(ctx, subcommand)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/platformio/cli.py", line 94, in get_command
    module = importlib.import_module(commands[cmd_name])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/adrian/.pyenv/versions/3.11.7/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/platformio/commands/ci.py", line 24, in <module>
    from platformio.project.commands.init import project_init_cmd, validate_boards
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/platformio/project/commands/init.py", line 31, in <module>
    from platformio.project.integration.generator import ProjectGenerator
  File "/Users/adrian/.platformio/penv/lib/python3.11/site-packages/platformio/project/integration/generator.py", line 19, in <module>
    import bottle
ModuleNotFoundError: No module named 'bottle'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `python -m pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq/index.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

Something else that I find strange is this:

penv ~
python -c "import bottle; print(bottle.__file__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'bottle'

penv ~
pip list
Package            Version
------------------ ----------
ajsonrpc           1.2.0
anyio              4.8.0
bottle             0.13.2
certifi            2024.12.14
chardet            5.2.0
charset-normalizer 3.4.1
click              8.1.8
colorama           0.4.6
h11                0.14.0
idna               3.10
marshmallow        3.26.0
packaging          24.2
pip                25.0
platformio         6.1.16
pyelftools         0.31
pyserial           3.5
requests           2.32.3
semantic-version   2.10.0
setuptools         65.5.0
sniffio            1.3.1
starlette          0.39.2
tabulate           0.9.0
typing_extensions  4.12.2
urllib3            2.3.0
uvicorn            0.30.6
wsproto            1.2.0

It seems that some packages, including bottle are probably not correctly installed in the virtual environment?

After more searching, I found out that the problem is that for some reason the SentinelOne software that my company uses is flagging bottle.py as malware. I’ve reported this to them, most likely there is no action needed from PlatformIO