Anaconda安装后Jupyter启动异常及默认浏览器修改问题咨询
解决Jupyter启动链接异常与默认浏览器修改问题
Hey there, let's work through these two Jupyter issues you're hitting after reinstalling Anaconda—they're both straightforward fixes, so let's dive in!
问题1:启动链接显示http://localhost:8892/undefined/tree
This usually happens when Jupyter can't locate its default notebook directory, or your config file got corrupted during the reinstall. Here's how to fix it:
- First, generate a fresh config file (or reset your existing one): Open Anaconda Prompt (or terminal on Mac/Linux) and run:
If prompted to overwrite an existing config, typejupyter notebook --generate-configyand hit enter. - Find the config file: It’s saved at
C:\Users\YourUsername\.jupyter\jupyter_notebook_config.py(Windows) or~/.jupyter/jupyter_notebook_config.py(Mac/Linux). - Open the file with a text editor (like VS Code or Notepad) and search for the line starting with
#c.NotebookApp.notebook_dir.- Remove the
#to uncomment it, then set it to a valid, existing folder path on your computer. For example (Windows):
Use double backslashes (c.NotebookApp.notebook_dir = 'C:\\Users\\YourUsername\\Documents\\Jupyter_Notebooks'\\) for Windows paths, or single forward slashes (/) for Mac/Linux.
- Remove the
- Save the config file, close it, then restart Jupyter Notebook. The
undefinedshould disappear from your launch link.
问题2:将默认浏览器从Internet Explorer改为Google Chrome
You can set this directly in the same Jupyter config file:
- Open the
jupyter_notebook_config.pyfile again and search for#c.NotebookApp.browser. - Uncomment the line and set it to Chrome's executable path, followed by
%s(this tells Jupyter to pass the launch URL to Chrome).- For Windows (check if Chrome is in Program Files or Program Files (x86)):
c.NotebookApp.browser = 'C:/Program Files/Google/Chrome/Application/chrome.exe %s' - For Mac:
c.NotebookApp.browser = 'open -a Google\\ Chrome %s' - For Linux:
c.NotebookApp.browser = '/usr/bin/google-chrome %s'
- For Windows (check if Chrome is in Program Files or Program Files (x86)):
- Save the config, restart Jupyter, and it’ll now launch Chrome automatically instead of IE.
内容的提问来源于stack exchange,提问作者Pro
相关产品推荐
相关产品推荐

