is it possible to run the terminal through rosetta for arm?

Answered

I have mac with arm, and the arm version of vs code. However, many of the packages don't work native. I have gotten everything up and running running the mac terminal through rosetta, but don't see an option to run the vs code terminal through rosetta on it's own. Is that possible?

2
12 comments

Hi Jason,

This is the PyCharm forum, not VS Code.
Please contact the VS Code team using one of the options mentioned in their documentation https://code.visualstudio.com/docs/supporting/faq#_technical-support

0

Sergey Karpov

Sorry about that.  I've been trying to get either to work, and misspoke.   Is it possible for PC?

0

You can configure terminal shell in Preferences | Tools | Terminal like you do normally to run it in Rosetta.

1

Who ever lands here via Google, set the "shell path" under preferences - tools - terminal:

env /usr/bin/arch -x86_64 /bin/zsh --login
21

Serge, can you confirm how you do this through Preferences | Tools | Terminal? I’m not seeing an option for Rosetta / ARM.

0

redaxmedia solution worked perfectly. Could you help me understand what the lines are doing? How does the env command work?

0

The solution of redaxmedia didn't work for me, but creating a Shell Script Run Configuration using a Script text did the job for me:

env /usr/bin/arch -x86_64 /bin/zsh -c "python3 -m my_package"

2

Edit - Changing the terminal also applied for the test runner 
Thanks redaxmedia, I can now start the terminal with arch==i386. How can I do the same when using PyCharm run command (for example to run tests)?

1

I used redaxmedia solution, the terminal works fine, but PyChram is not enabling my Python virtual environment.

which python
/Users/my_user/.pyenv/shims/python

instead of: 

which python
/Users/my_user/workspace/package_name/venv/bin/python

any ideas on how to fix it?

Thanks 

4

Slanton I am running

source ./venv/bin/activate
0

Change shell path to "env /usr/bin/arch -x86_64 /bin/zsh" seems to solves the issue (allowing using zsh and activating the virtual env)

0

I used redaxmedia solution, it worked, but I also had the problem with virtualenv not being activated automatically. However, I noticed that $VIRTUAL_ENV variable gets populated by PyCharm, so I added the following to ~/.zshrc:

if [ -n $VIRTUAL_ENV ]; then
  if [ -f "$VIRTUAL_ENV/bin/activate" ]; then
       source "$VIRTUAL_ENV/bin/activate"
  fi
fi
0

Please sign in to leave a comment.