Using Enthought Python / EDM with VS Code on a Mac

This article supplements either Enthought training class setup instructions, or the article Using the Enthought Deployment Manager (EDM) with the Visual Studio Code (VS Code) IDE

 

Install the Enthought Deployment Manager (EDM)

Recent EDM installers for the Mac are not signed. This is because of changed Apple signing procedures, which we have no current plans to implement.

If you have admin rights to the machine, we recommend that you install the latest version. One method is to right-click on the downloaded .pkg file, click Open while holding down the Shift key, then "Yes" to "are you sure?" Or you can install EDM 2.1.0 which is signed with Apple's previous procedure, and should suffice for many purposes. For the differences, see http://docs.enthought.com/edm/dev/history.html .

Install Visual Studio Code (VS Code)

Microsoft provides the VS Code installer for macOS as a .zip file containing "Visual Studio Code.app"  When unzipping, please drag this application to your Mac Applications folder rather than leaving it in your Downloads folder.

Optional FYI: Launching VS Code from Terminal

Enthought integration on Mac no longer requires launching VS Code from a Terminal. Therefore, this section only applies to situations where you wish do do so as a convenience, for example using Terminal, rather than the VS Code GUI, to open a file into the VS Code editor.

By default on macOS, VS Code does not enable launching from Terminal. You can enable this either by following these instructions from Microsoft, or by adding a "soft link" to VS Code in a directory that is already on your PATH. To add such a link, copy/paste the following long command into a Terminal, then enter your macOS login password when prompted:

sudo ln -s "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" /usr/local/bin/code

Whichever way you enable it, you can then launch VS Code by opening a Mac Terminal window and entering a command like this:

code  myscript.py

[Fixed] Python graphics on macOS Big Sur

This only applies to Python environments built from pre-2021 packages, and not updated.

If you are using Enthought Python to create graphics (plotting or GUI) using the widely-used Qt graphics backend, as is standard in Enthought training courses, and you still have a qt version older than 5.12 installed, and for some reason you cannot update the packages in this Python environment, then you will need to set the environment variable QT_MAC_WANTS_LAYER=1.  A simple way to do this is: in Terminal, before starting VS Code in Terminal, enter this command:

export QT_MAC_WANTS_LAYER=1

 

Please do not enter support requests in article comments

Please use article comments for suggestions to improve the article. For individual support requests, please follow these guidelines.

Have more questions? Submit a request

Comments

Powered by Zendesk