-
Notifications
You must be signed in to change notification settings - Fork 36
No module named 'nbformat' when following macOS VS Code installation instructions #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm seeing this behavior as well. My operating system is macOS 12.4 and I'm running VS Code 1.70.1.
|
The key here is to use the Python: Select Interpreter command in VS Code. This will then make sure that the iPython, Terminal, and Quarto subsystems are all using the same Python. |
Thanks @simonw for helping me to sort this. Someone asked a similar question on stackoverflow, and I posted your solution with acknowledgements. Quarto people, this should ideally work out of the box, and seems like an issue which could trip up a lot of users (seemingly a large proportion of Mac users). |
One problem which occurs frequently is that a newer version of Python gets installed (e.g. via a We specifically try to match the version of Python used by default in VS Code so that all Python actions (notebooks, running in the terminal, using Quarto, etc.) use the same version of Python. So while we could "make it work" by hunting around for a version of Python that has the Jupyter packages we'd then be out of sync w/ the rest of VS Code. I couple things I think we could do:
|
Bug description
I started at https://quarto.org/docs/get-started/ and used the macOS installer to install Quarto.
quarto --help
confirmed that this had worked.Then I installed the VS Code extension from https://marketplace.visualstudio.com/items?itemName=quarto.quarto
Everything seemed to work, until I clicked "Render" in VS Code and got this error:
I have many different versions of Python 3 installed on my machine. It was not at all obvious to me which one Quarto was using. After some investigation (described here) I figured out it was using this one:
So I ran this command to fix my problem:
After doing that the Render button worked.
Interestingly, the output of
quarto check
shows/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
as the version of Python - but executingsys.executable
in a cell in VS Code showed/Applications/Xcode.app/Contents/Developer/usr/bin/python3
instead. So there's a mismatch between Python versions here.My operating system is macOS 12.2.1 and I'm running VS Code 1.70.2.
quarto check
Outputquarto tools check
Output~ % quarto tools check [✓] Inspecting tools Tool Status Installed Latest chromium Not installed --- 869685 tinytex Up to date v2022.08 v2022.08
Checklist
quarto check
in the "Quarto Check Output" text area?quarto tools check
in the "Quarto Tools Check Output" text area?The text was updated successfully, but these errors were encountered: