Sample Header Ad - 728x90

Run terminal in VS Code in rosetta/intel mode

1 vote
0 answers
316 views
A dependency of my code (pyqt5) does not run on Apple Silicon:
Installing pyqt-qt5 (5.15.2): Failed
RuntimeError
Unable to find installation candidates for pyqt-qt5 (5.15.2)
and I'm having difficulties **running the terminal inside VS Code in Rosetta / "Intel mode"**. I'm using poetry to manage and install dependencies. ### What works: outside of VS Code I can use conda to manage the virtual environment, and set some environment variables that enforce "Intel mode":
CONDA_SUBDIR=osx-64 conda create -n my-intel-env python=3.11 -y
conda activate my-intel-env
conda env config vars set CONDA_SUBDIR=osx-64
conda deactivate
conda activate my-intel-env
pip install "poetry==1.5.1"
poetry install --with dev
pyqt5 installs without issue:
...
  • Installing pymiscutils (0.3.14)
  • Installing pyqt5 (5.15.9)
  • Installing requests-oauthlib (1.3.1)
...
### What I've tried: terminal settings I tried adding a terminal profile in VS Code's settings.json:
# settings.json
{
    ...
    "terminal.integrated.profiles.osx": {
        "bash_1": {
            "path": "/opt/homebrew/bin/bash"
        },
        "bash_2": {
            "path": "arch -x86_64 /opt/homebrew/bin/bash"
        },
        "zsh": {
          "path": "/usr/bin/zsh"
        }
    },
    ...
}
However, this does not work; the profile "bash_2" cannot be selected from the Terminal menu: ![Screenshot of the Terminal menu with the missing 'bash_2' option ][4] ### What I've also tried: running VS Code via Rosetta I tried to start the Intel version of VS Code, but this does not help; the terminal is a separate process and still does not run via Rosetta. ### What I can't do: upgrade I cannot force the dependency to use pyqt6 instead of pyqt5.
Asked by ElRudi (223 rep)
Sep 25, 2023, 09:50 AM
Last activity: Sep 28, 2023, 02:56 PM