我的 Jupyter 笔记本没有创建 Python 笔记本的选项。您能问一下原因是什么吗?如何解决?
$ jupyter notebook
[I 18:34:28.910 NotebookApp] The port 8888 is already in use, trying another port.
[I 18:34:28.918 NotebookApp] Serving notebooks from local directory: /home/mona/libzmq/cmake-build
[I 18:34:28.918 NotebookApp] 0 active kernels
[I 18:34:28.918 NotebookApp] The Jupyter Notebook is running at: http://localhost:8889/
[I 18:34:28.918 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
(firefox:18833): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed
(firefox:18833): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
(firefox:18833): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed
(firefox:18833): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
[W 18:34:33.278 NotebookApp] Native kernel (python2) is not available
[W 18:34:33.278 NotebookApp] Native kernel (python2) is not available
1486946551509 addons.update-checker WARN Update manifest for [email protected] did not contain an updates property
1486946551521 addons.update-checker WARN Update manifest for [email protected] did not contain an updates property
1486946551544 addons.update-checker WARN Update manifest for [email protected] did not contain an updates property
1486946551555 addons.update-checker WARN Update manifest for [email protected] did not contain an updates property
1486946551566 addons.update-checker WARN Update manifest for {972ce4c6-7e08-4474-a285-3208198ce6fd} did not contain an updates property
1486946551830 addons.xpi WARN Add-on [email protected] is not compatible with application version.
1486946552022 addons.xpi WARN Add-on [email protected] is not compatible with application version.
1486946552383 addons.xpi ERROR Attempted to load bootstrap scope from missing directory /home/mona/.mozilla/firefox/thjcjy9j.default/extensions/[email protected]
1486946552383 addons.xpi WARN Add-on [email protected] is missing bootstrap method shutdown
1486946552386 addons.manager WARN Exception calling callback: [Exception... "Component returned failure code: 0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) [nsIFile.isDirectory]" nsresult: "0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: getURIForResourceInFile :: line 1537" data: no] Stack trace: getURIForResourceInFile()@resource://gre/modules/addons/XPIProvider.jsm:1537 < this.XPIProvider.callBootstrapMethod()@resource://gre/modules/addons/XPIProvider.jsm:4811 < this.XPIProvider.uninstallAddon()@resource://gre/modules/addons/XPIProvider.jsm:5089 < AddonWrapper.prototype.uninstall()@resource://gre/modules/addons/XPIProvider.jsm:7504 < uninstallHotfix/<()@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/mona/.mozilla/firefox/thjcjy9j.default/extensions/[email protected]!/bootstrap.js:93 < safeCall()@resource://gre/modules/AddonManager.jsm:188 < makeSafe/<()@resource://gre/modules/AddonManager.jsm:204 < Handler.prototype.process()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:937 < this.PromiseWalker.walkerLoop()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:816 < this.PromiseWalker.scheduleWalkerLoop/<()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:750
答案1
通过安装解决了问题ipykernel
$ sudo pip2 install ipykernel
The directory '/home/mona/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/mona/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: ipykernel in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python2.7/dist-packages (from ipykernel)
Requirement already satisfied: traitlets>=4.1.0 in /usr/local/lib/python2.7/dist-packages (from ipykernel)
Requirement already satisfied: tornado>=4.0 in /usr/local/lib/python2.7/dist-packages (from ipykernel)
Requirement already satisfied: jupyter-client in /usr/local/lib/python2.7/dist-packages (from ipykernel)
Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: decorator in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: pickleshare in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel)
Collecting simplegeneric>0.8 (from ipython>=4.0.0->ipykernel)
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading simplegeneric-0.8.1.zip
Collecting pexpect; sys_platform != "win32" (from ipython>=4.0.0->ipykernel)
Downloading pexpect-4.2.1-py2.py3-none-any.whl (55kB)
100% |████████████████████████████████| 61kB 2.2MB/s
Requirement already satisfied: pathlib2; python_version == "2.7" or python_version == "3.3" in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.3 in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: pygments in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipykernel)
Requirement already satisfied: enum34; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.1.0->ipykernel)
Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.1.0->ipykernel)
Requirement already satisfied: ipython-genutils in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.1.0->ipykernel)
Requirement already satisfied: singledispatch in /usr/local/lib/python2.7/dist-packages (from tornado>=4.0->ipykernel)
Requirement already satisfied: certifi in /usr/local/lib/python2.7/dist-packages (from tornado>=4.0->ipykernel)
Requirement already satisfied: backports-abc>=0.4 in /usr/local/lib/python2.7/dist-packages (from tornado>=4.0->ipykernel)
Requirement already satisfied: backports.ssl-match-hostname in /usr/local/lib/python2.7/dist-packages (from tornado>=4.0->ipykernel)
Requirement already satisfied: pyzmq>=13 in /usr/local/lib/python2.7/dist-packages (from jupyter-client->ipykernel)
Requirement already satisfied: jupyter-core in /usr/local/lib/python2.7/dist-packages (from jupyter-client->ipykernel)
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python2.7/dist-packages (from pexpect; sys_platform != "win32"->ipython>=4.0.0->ipykernel)
Requirement already satisfied: wcwidth in /usr/local/lib/python2.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython>=4.0.0->ipykernel)
Installing collected packages: simplegeneric, pexpect
Running setup.py install for simplegeneric ... done
Successfully installed pexpect-4.2.1 simplegeneric-0.8.1
mona@pascal:~/libzmq/cmake-build$ jupyter notebook
/usr/local/lib/python2.7/dist-packages/IPython/paths.py:54: UserWarning: Moving ~/.config/ipython to ~/.ipython
warn('Moving {0} to {1}'.format(cu(xdg_ipdir), cu(ipdir)))
[I 18:45:16.823 NotebookApp] The port 8888 is already in use, trying another port.
[I 18:45:16.823 NotebookApp] The port 8889 is already in use, trying another port.
[I 18:45:16.830 NotebookApp] Serving notebooks from local directory: /home/mona/libzmq/cmake-build
[I 18:45:16.830 NotebookApp] 0 active kernels
[I 18:45:16.830 NotebookApp] The Jupyter Notebook is running at: http://localhost:8890/
[I 18:45:16.830 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).