简体   繁体   English

Jupyter 笔记本无法从 Anaconda Navigator 启动

[英]Jupyter notebook not launching from Anaconda Navigator

I am working on MacBook Pro 10.12.6.我正在使用 MacBook Pro 10.12.6。 I downloaded the most recent Anaconda 5.2 distribution, with the Python 3.6 version.我下载了最新的 Anaconda 5.2 发行版,带有 Python 3.6 版本。

I can launch the Jupyter Notebook from the command line without any problem, but it does not work from the Anaconda Navigator.我可以毫无问题地从命令行启动 Jupyter Notebook,但它在 Anaconda Navigator 中不起作用。 I have the Jupyter Notebook version 5.6.0 in the Navigator.我在导航器中有 Jupyter Notebook 5.6.0 版。 How can I get it to work?我怎样才能让它工作?

I had the same issue on my computer.我在我的电脑上遇到了同样的问题。 The issue was that a particular file went missing while updating the notebook.问题是更新笔记本时丢失了特定文件。 Please check the following file in the folder: /Users/your-name/.anaconda/navigator/scripts/notebook.sh and the corresponding output and error files called something like *out.txt and *err.txt The script notebook.sh should look like this:请检查文件夹中的以下文件: /Users/your-name/.anaconda/navigator/scripts/notebook.sh以及相应的输出和错误文件,称为*out.txt*err.txt脚本notebook.sh应该是这样的:

#!/usr/bin/env bash

source /Users/your-name/anaconda3/bin/activate /Users/your-name/anaconda3
open /Users/your-name/anaconda3/bin/jupyter_mac.command >/Users/your-name/.anaconda/navigator/scripts/notebook-out-1.txt 2>/Users/your-name/.anaconda/navigator/scripts/notebook-err-1.txt

The error message said that the file jupyter_mac.command did not exist.错误消息说文件jupyter_mac.command不存在。 This was why the notebook was not getting launched.这就是笔记本没有启动的原因。

To fix it simply create this file, jupyter_mac.command , in the /Users/your-name/anaconda3/bin/ folder.要修复它,只需在/Users/your-name/anaconda3/bin/文件夹中创建此文件jupyter_mac.command The file is the following simple script :该文件是以下简单脚本:

#!/usr/bin/env bash

DIR=$(dirname $0)
$DIR/jupyter-notebook

After saving this file, you may need to give it executable permission using the chmod +x command.保存此文件后,您可能需要使用chmod +x命令为其授予可执行权限。

Voila!瞧! It's done.完成。

I faced a similar issue running Anaconda on CentOS 7. The root cause was Anaconda was running as root user.我在 CentOS 7 上运行 Anaconda 时遇到了类似的问题。根本原因是 Anaconda 以 root 用户身份运行。 I created an OS user for installing Anaconda.我创建了一个用于安装 Anaconda 的操作系统用户。 Since that, I can start the Jupyter Notebook (Yes, I know this is a very basic best practice) :)从那以后,我可以启动 Jupyter Notebook(是的,我知道这是一个非常基本的最佳实践):)

You have more than one version of python on your computer so you should set up virtual environments for each version of python.您的计算机上有多个版本的 python,因此您应该为每个版本的 python 设置虚拟环境。 It's very easy to do using Anaconda.使用 Anaconda 很容易做到。 Instructions are here andhere .说明在这里这里 Once you have created your virtual environments then open Anaconda-Navigator.创建虚拟环境后,打开 Anaconda-Navigator。 Once you've opened Navigator you'll see the following pane with a pull-down menu (as highlighted on the image).打开 Navigator 后,您将看到以下带有下拉菜单的窗格(如图所示)。

Anaconda-Navigator 窗口

From that pull-down menu select one of your virtual environments and try running Jupyter again.从该下拉菜单中选择一个虚拟环境,然后再次尝试运行 Jupyter。

I resolved this using the following command, although note that it rolled back my (base) environment to the original state.我使用以下命令解决了这个问题,但请注意,它将我的(基本)环境回滚到原始状态。

conda install --revision 1 conda install --revision 1

Further discoveries:进一步的发现:

  • I had the same behaviour as Marc in the comments above (it would launch from Environments but not the Home Page).我在上面的评论中有与 Marc 相同的行为(它会从 Environments 启动,但不会从主页启动)。

  • Clicking on Launch did actually start a notebook, it just didn't force a browser window to open;单击 Launch 确实启动了一个 notebook,它只是没有强制打开浏览器窗口; navigating to http://localhost:8888/tree after doing so took me to it.这样做后导航到http://localhost:8888/tree把我带到了它。

There is further discussion of the issue (at least the one I had) here:这里有关于这个问题的进一步讨论(至少是我遇到的那个):

https://github.com/ContinuumIO/anaconda-issues/issues/9976 https://github.com/ContinuumIO/anaconda-issues/issues/9976

  • I had previously had problems with upgrading JupyterLab to 1.02, which I had succeeded in doing but perhaps something in that process resulted in the issue.我之前在将 JupyterLab 升级到 1.02 时遇到了问题,我已经成功地做到了,但也许在这个过程中的某些事情导致了这个问题。

When I installed Anaconda I faced a similar problem.当我安装 Anaconda 时,我遇到了类似的问题。 Jupyter notebook was not launching from Anaconda. Jupyter 笔记本不是从 Anaconda 启动的。 I google searched and tried every piece of advice but nothing worked until I figured out that Jupyter notebook runs on localhost and I already have XAMPP.我谷歌搜索并尝试了每一条建议,但直到我发现 Jupyter notebook 在本地主机上运行并且我已经有了 XAMPP 之前,没有任何效果。 I use xampp as localhost to test my web pages.我使用 xampp 作为本地主机来测试我的网页。 I uninstalled the xampp completely.我完全卸载了 xampp。 Restart the computer, run the Anaconda and launched jupyter notebook.重新启动计算机,运行 Anaconda 并启动 jupyter notebook。 Voila, now it's running.瞧,现在它正在运行。 Now when I installed Docker, I faced a similar problem.现在,当我安装 Docker 时,我遇到了类似的问题。 then I did the same.然后我做了同样的事情。 Uninstalled Anaconda in order to run Docker.卸载 Anaconda 以运行 Docker。 It'd be my pleasure if it solves anyone's problem.如果它解决了任何人的问题,那将是我的荣幸。

I had a custom path set as the base path for my jupyter notebook start-up folder.我将自定义路径设置为 jupyter notebook 启动文件夹的基本路径。 While taking some backup I had removed that folder.在进行一些备份时,我删除了该文件夹。 This was leading to Jupyter notebook and JupyterLab failing on start up.这导致 Jupyter notebook 和 JupyterLab 在启动时失败。 It worked fine after I fixed that path.在我修复了这条路径后,它运行良好。

You just need to find the right version of anaconda I think.你只需要找到我认为合适的 anaconda 版本。 For me it works well when I downloaded a previous version, I was also facing the same issue.对我来说,当我下载以前的版本时效果很好,我也遇到了同样的问题。 I could then launch jupyter from navigator itself.然后我可以从导航器本身启动 jupyter。

Few things to try很少尝试

  • Run the Navigator in admin mode (Right click the shortcut -> More -> Run as Administrator)在管理员模式下运行导航器(右键单击快捷方式 -> 更多 -> 以管理员身份运行)
  • Downgrade Jupyterlab to another version and upgrade it again (basically reinstalling)将 Jupyterlab 降级到另一个版本并再次升级(基本上是重新安装)

The first one solved my issue.第一个解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Anaconda Navigator(Jupyter Lab & Jupyter notebook)上的应用程序未启动 - Applications on Anaconda Navigator(Jupyter Lab & Jupyter notebook) not launching Jupyter Notebook 未启动(Anaconda) - Jupyter Notebook not launching (Anaconda) 从 Anaconda Navigator 启动 Safari 中的 Jupyter Notebook? - Launch Jupyter Notebook in Safari from Anaconda Navigator? 从 Anaconda 启动 Jupyter Notebook 时出现问题 - Problem launching Jupyter Notebook from Anaconda 无法在 Anaconda Navigator 中启动 jupyter notebook - can't start jupyter notebook in Anaconda Navigator 无法使用 Anaconda Navigator 启动 Jupyter Notebook - Unable to launch Jupyter Notebook with Anaconda Navigator Anaconda错误启动python 3 jupyter笔记本 - Anaconda error launching python 3 jupyter notebook 无法从 Anaconda Navigator 启动 Jupyter 笔记本,但笔记本正在从 Win 10 Pro 中的命令提示符打开 - Unable to launch Jupyter notebook from Anaconda Navigator but notebook is opening from command prompt in Win 10 Pro 安装 Anaconda 后,Jupyter notebook 和 Anaconda Navigator 不显示 - Jupyter notebook and Anaconda Navigator does not show after installing Anaconda 单击这么多次后,Jupyter 未从 anaconda 导航器启动,我收到此错误 - Jupyter is not launching from anaconda navigator after clicking so many times and i got this error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM