这里提供的是Jupyter notebook其中一个报错的解决方法。
他的报错形式为:[I 12:24:56.475 NotebookApp] The port 8888 is already in use, trying another port. [I 12:24:56.475 NotebookApp] The port 8889 is already in use, trying another port. [I 12:24:56.517 NotebookApp] JupyterLab beta preview extension loaded from D:\Anaconda3\lib\site-packages\jupyterlab [I 12:24:56.517 NotebookApp] JupyterLab application directory is D:\Anaconda3\share\jupyter\lab [W 12:24:56.529 NotebookApp] Error loading server extension jupyterlab Traceback (most recent call last): File "D:\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 321, in __init__ self._run(['node', 'node-version-check.js'], cwd=HERE, quiet=True) File "D:\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 1165, in _run proc = Process(cmd, **kwargs) File "D:\Anaconda3\lib\site-packages\jupyterlab\process.py", line 73, in __init__ self.proc = self._create_process(cwd=cwd, env=env) File "D:\Anaconda3\lib\site-packages\jupyterlab\process.py", line 131, in _create_process cmd[0] = which(cmd[0], kwargs.get('env')) File "D:\Anaconda3\lib\site-packages\jupyterlab\jlpmapp.py", line 59, in which raise ValueError(msg) ValueError: Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1454, in init_server_extensions func(self) File "D:\Anaconda3\lib\site-packages\jupyterlab\extension.py", line 111, in load_jupyter_server_extension info = get_app_info(app_dir) File "D:\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 244, in get_app_info handler = _AppHandler(app_dir, logger) File "D:\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 324, in __init__ raise ValueError(msg) ValueError: Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website. [I 12:24:56.982 NotebookApp] Serving notebooks from local directory: C:\Users\MECHREVO [I 12:24:56.982 NotebookApp] 0 active kernels [I 12:24:56.982 NotebookApp] The Jupyter Notebook is running at: [I 12:24:56.983 NotebookApp] http://localhost:8890/?token=8cb7e3e0d4b7edf24ec693852703cfebc6d4a74c64423fd8 [I 12:24:56.983 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 12:24:56.984 NotebookApp] Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8890/?token=8cb7e3e0d4b7edf24ec693852703cfebc6d4a74c64423fd8 [I 12:24:57.311 NotebookApp] Accepting one-time-token-authenticated connection from ::1
解决方法
我尝试了卸载先前安装的python和相关的python编辑器,但发现都没效果,但在我安装 Node.js 后发现在运行就不再报错了。如果有类似报错但找不到解决方法的可以试试看。
Node.js安装
- Node.js下载。
下载地址:Node.js - 安装。
打开安装包后,一直Next即可。当然也可以修改一下安装位置,Node.js的默认安装位置为C:\Program Files - 检验是否安装成功。
打开命令提示符,输入:node -v
查看是否出现Node.js版本,如出现则为安装成功。
结语
希望我的方法能帮你解决Jupyter notebook报错的问题。