python interpreter and vscode in mac

99 Views Asked by At

I am having 2 problems.

I am working on a remote server with vscode. When I use the command code to launch the vscode, it only launches it when I am not connected to the server. I searched for solutions online most of them are for windows and not mac, I could not find an answer that solves my problem.

problem2: how can I download a specific python interpreter in vscode.

I used this code to create a virtual environment:

virtualenv -p /usr/bin/python3 py3env

but it does not allow me to specify the version of the python interpreter.

1

There are 1 best solutions below

2
Saxtheowl On

You could install the Remote-SSH extension for VSCode, it will allow you to connect to a remote server and have access to its files, you can install Remote-SSH from the VSCode MarketPlace

For the second problem first download the version of python you want here https://www.python.org/downloads/mac-osx/, then just do virtualenv -p /usr/bin/python3.7 py3env it will use python 3.7 in a virtual environment, for another version just replace python 3.7 in the command by the path of the appropriate python executable.