I'm working with vscode in jupyter notebooks and when executing a code the text suddenly looks out of range, before it looked normal, I tried reinstalling vscode.
This is the view I have from the github repository, before it looked like this in vscode:
Before
in vscode suddenly it started to look like this:
After
before they told me that the font is the problem and that I should edit the json of the configuration, however, the json is only with the theme for vscode since I have uninstalled everything related and I have reinstalled it, and it still continues the same
It's related to VSCode, you can wait for the update of VSCode. You can refer to this page for more details.
Your font has changed from fixed width to variable width. This is something you will find in settings.json but should change via VSCode's settings page. Search for "font" and select an appropriate option - perhaps Courier.
Related
[Working on Windows 11, Python 3.9.7]
I just installed the MikTex Console, and the settings show that keys xelatex and xelatex-dev are present (see bottom of image below):
Now, in a markdown cell of a Jupyter Notebook, I introduce an image (stored on my personal Desktop):
![1%20cbGPF1go7MMWvHif7-2hAw.png](attachment:1%20cbGPF1go7MMWvHif7-2hAw.png)
When I run the cell, I get the perfect image in the Notebook:
So, everything seems to behave well, BUT, when I just want to save the Notebook as PDF via LateX,as indicated in the image below:
then I get a 500 : Internal Server Error, saying:
nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex notebook.tex -quiet" command:
Does somebody know what is this "xelatex notebook.tex -quiet" command ? How is it related to LateX? Is it something missing in the settings of the MikTex Console? Do you know how could I fix this kind of error?
the provided error is quite succinct, there should have been things after the command:, something like
This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
! Undefined control sequence.
Responding to your questions anyway, the xelatex notebook.tex -quiet is the command run when you click "save as PDF via LaTeX", XeLaTeX itself is an enhancment of LaTeX (which itself enhanced TeX).
The main objective of XeLaTeX is to provide better encoding and font support than LaTeX does. see here.
On how to fix the error, I would recommand to make a "save as LaTeX (.tex)" and try running xelatex notebook.tex directly in a console. It should show you the exact error that is happening. This issue on jupyter GitHub makes me guess it is either a dependency problem or a unsupported syntax problem.
If needed you can comment/update your question with more specific logs
I am trying to use the Interactive window of VSCode, but it loads the wrong version of Python. I want it to load the version of the virtual environment (shown bottom left), but it defaults to something else.
I have tried this approach, but I can't simply click the version and change it because it isn't included in the drop down list. I have tried adjusting the settings.json file python.defaultInterpreterPath but that didn't work (perhaps my syntax is wrong). I have also made sure that jupyter is installed in the virtual environment.
I always run VSCode in the project folder from the command line using code . but strangely, something that has worked is running it using code (without the period). This is not a solution however, because the workspace folder is not updated, meaning that when I change the project I'm working on, VSCode opens in previous workspace.
You can try to delete all the files and folders under this location:
C:\Users\${UserName}\AppData\Roaming\Code\User\globalStorage
Others:
The python interpreter of the .ipynb file was stored in the database located at:
C:\Users\${UserName}\AppData\Roaming\Code\User\workspaceStorage
Such as:
If you open a new .ipynb file in the VSCode which name has not storaged in the database, you will need to select the interpreter.
It's different from the interactive. You can find, any time you reopen the VSCode, the last time you created interactive will be disappear.
I want to run a Jupyter notebook in PyCharm but on cells that are executing javascript, I get the message, that the notebook is not trusted.
When I click the "Trusted" checkbox, the arrow appears for a second and then disappears again. The notebook stays untrusted. Also using the command-line interface for Jupyter with
jupyter trust notebook.ipynb
doesn't work.
When I open the notebook on the browser with the same kernel running, it works just fine.
I also want to add that I have three projects open at the same time. When I just open the project, which is containing the notebook, I can click the "Trusted" checkbox and it will stay checked, but still, the javascript cells will not execute.
Maybe that's a bug, but probably I messed up some settings? Can you help me find out, which settings I can change and if there are other options to get the notebook trusted within the IDE?
Have a nice day!
I had the same problem when I moved the notebook's directory. What solved it for me in PyCharm was to copy and paste the notebook's content into a new file.
I came across this issue when specifying %matplotlib notebook.
Changing this to %matplotlib inline got the plotting to work.
Not fully understanding the issue or how this solves it but it is sufficient for my application.
I am trying to make code text on jupyter notebook on VS code be bold, but no matter how I tweak the settings.json file I can't seem to find a way to make it happen. As I have noticed, usual python code text in .py files is changing when i change settings.json file but .ipynb file is not reacting. For some reason if I use command palette to change themes jupyter notebook's code is changing color as well but the codetext itself is not becomming bold. Is there a way to solve this?
I'm a developer on the VSCode python extension. Currently our notebook editor is implemented as a webview (basically a way for extensions to put a webpage into VS Code's UI). We've tried to match things up as best as we can, but in this scenario we can't support many VS Code editor settings and features. This setting that you are changing is one of the ones that we don't support.
On the plus side, VS Code core team is currently in the process of adding build in notebook support. When we move over to this the notebook cells will be full real VS Code editor instances and will support this setting. This feature is currently in early preview (expect plenty of change and issues) if you right click on a ipynb file in VS Code Insiders and pick "open in preview Notebook Editor."
At present, the Jupyter notebook function in VSCode is provided by the python extension.
When it is used as markdown, the text output is bold. (use "# %%[markdown]").
But it does not currently support setting its code bold style. We look forward to its further improvement of this setting.
I have installed Anaconda2, and today decided to update to Anaconda3. I installed Anaconda3 at the same time as I uninstalled Anaconda2.
Now, Jupyter Notebook shows this error and quits every time I try to start it.
The path in the error message is: "C:\Users\Hongyi\Documents\%HOME%"
What is causing Jupyter Notebook to quit?
Okay it looks like I found a solution.
Jupyter started running after I created the appropriate folder in the appropriate path.
In my case, it is creating a folder named %HOME% (with percent signs), in the path shown in the error message.
Now Jupyter is up and running.
Thank you guys for your thoughts and suggestions.
After readed this solution I tried another one (a comfortable one for me):
Open the location of the "Jupyter Notebook" shortcut (right click > More > File location) and right click again > Properties. In the Destination field (Sorry if the label is another ... the thing is that my Windows is in Spanish and I don't remember how it's labeled this field in English) just change the %HOME% at the end for a path to your "Work Folder" (if you have not created one then just create it). And this way It works also.