• python 2.7.18安装jupyter遇到的一个错误


    遇到的错误如下:

    1. $ sudo pip install jupyter
    2. Collecting jupyter
    3. Using cached https://files.pythonhosted.org/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl
    4. Collecting nbconvert (from jupyter)
    5. Using cached https://files.pythonhosted.org/packages/79/6c/05a569e9f703d18aacb89b7ad6075b404e8a4afde2c26b73ca77bb644b14/nbconvert-5.6.1-py2.py3-none-any.whl
    6. Collecting notebook (from jupyter)
    7. Using cached https://files.pythonhosted.org/packages/1b/c5/5772fb4654cce834a097a2fa49baace3a7b375470ddf52c599e372c765b3/notebook-5.7.16-py2.py3-none-any.whl
    8. Collecting jupyter-console (from jupyter)
    9. Using cached https://files.pythonhosted.org/packages/77/82/6469cd7fccf7958cbe5dce2e623f1e3c5e27f1bb1ad36d90519bc2d5d370/jupyter_console-5.2.0-py2.py3-none-any.whl
    10. Requirement already satisfied: ipykernel in /usr/local/lib/python2.7/dist-packages (from jupyter)
    11. Collecting ipywidgets (from jupyter)
    12. Using cached https://files.pythonhosted.org/packages/14/3f/fa7fcf85061819f5a10ed09eaef38fe97d0f3f91d14674bbb26c3fc2a622/ipywidgets-7.8.1-py2.py3-none-any.whl
    13. Collecting qtconsole (from jupyter)
    14. Using cached https://files.pythonhosted.org/packages/fb/ef/6cf8a7301726a7b7149e95102c70f809542dfcd916826e8dccc0d90b2605/qtconsole-5.0.0.tar.gz
    15. Complete output from command python setup.py egg_info:
    16. Traceback (most recent call last):
    17. File "", line 1, in <module>
    18. File "/tmp/pip-build-5OIjqO/qtconsole/setup.py", line 18
    19. print(error, file=sys.stderr)
    20. ^
    21. SyntaxError: invalid syntax
    22. ----------------------------------------
    23. Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5OIjqO/qtconsole/

    这个错误的直接原因是setup.py脚本语法有问题,应该是python版本不匹配导致的。解决方法是强制安装低版本的qtconsole,安装命令为“sudo pip install qtconsole==4.7.7”。如遇其他错误,通常也是版本不匹配导致的,尝试安装一个更低的版本即可解决。最后安装成功如下:

    1. $ sudo pip install jupyter
    2. Collecting jupyter
    3. Using cached https://files.pythonhosted.org/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl
    4. Requirement already satisfied: nbconvert in /usr/local/lib/python2.7/dist-packages (from jupyter)
    5. Requirement already satisfied: notebook in /usr/local/lib/python2.7/dist-packages (from jupyter)
    6. Collecting jupyter-console (from jupyter)
    7. Using cached https://files.pythonhosted.org/packages/77/82/6469cd7fccf7958cbe5dce2e623f1e3c5e27f1bb1ad36d90519bc2d5d370/jupyter_console-5.2.0-py2.py3-none-any.whl
    8. Requirement already satisfied: ipykernel in /usr/local/lib/python2.7/dist-packages (from jupyter)
    9. Requirement already satisfied: ipywidgets in /usr/local/lib/python2.7/dist-packages (from jupyter)
    10. Requirement already satisfied: qtconsole in /usr/local/lib/python2.7/dist-packages (from jupyter)
    11. Requirement already satisfied: pygments in /usr/lib/python2.7/dist-packages (from nbconvert->jupyter)
    12. Requirement already satisfied: testpath in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    13. Requirement already satisfied: nbformat>=4.4 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    14. Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    15. Requirement already satisfied: bleach in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    16. Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    17. Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    18. Requirement already satisfied: defusedxml in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    19. Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    20. Requirement already satisfied: jinja2>=2.4 in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    21. Requirement already satisfied: jupyter-core in /usr/local/lib/python2.7/dist-packages (from nbconvert->jupyter)
    22. Requirement already satisfied: terminado>=0.8.1 in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter)
    23. Requirement already satisfied: ipython-genutils in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter)
    24. Requirement already satisfied: tornado<7,>=4.1 in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter)
    25. Requirement already satisfied: prometheus-client in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter)
    26. Requirement already satisfied: Send2Trash in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter)
    27. Requirement already satisfied: jupyter-client<7.0.0,>=5.2.0 in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter)
    28. Requirement already satisfied: pyzmq>=17 in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter)
    29. Requirement already satisfied: ipaddress; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from notebook->jupyter)
    30. Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.0 in /usr/local/lib/python2.7/dist-packages (from jupyter-console->jupyter)
    31. Requirement already satisfied: ipython in /usr/local/lib/python2.7/dist-packages (from jupyter-console->jupyter)
    32. Requirement already satisfied: widgetsnbextension~=3.0.0 in /usr/local/lib/python2.7/dist-packages (from ipywidgets->jupyter)
    33. Requirement already satisfied: qtpy in /usr/local/lib/python2.7/dist-packages (from qtconsole->jupyter)
    34. Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /usr/local/lib/python2.7/dist-packages (from nbformat>=4.4->nbconvert->jupyter)
    35. Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.2->nbconvert->jupyter)
    36. Requirement already satisfied: enum34; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.2->nbconvert->jupyter)
    37. Requirement already satisfied: decorator in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.2->nbconvert->jupyter)
    38. Requirement already satisfied: webencodings in /usr/local/lib/python2.7/dist-packages (from bleach->nbconvert->jupyter)
    39. Requirement already satisfied: packaging in /usr/local/lib/python2.7/dist-packages (from bleach->nbconvert->jupyter)
    40. Requirement already satisfied: configparser>=3.5; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from entrypoints>=0.2.2->nbconvert->jupyter)
    41. Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages (from jinja2>=2.4->nbconvert->jupyter)
    42. Requirement already satisfied: ptyprocess; os_name != "nt" in /usr/local/lib/python2.7/dist-packages (from terminado>=0.8.1->notebook->jupyter)
    43. Requirement already satisfied: singledispatch in /usr/local/lib/python2.7/dist-packages (from tornado<7,>=4.1->notebook->jupyter)
    44. Requirement already satisfied: futures in /usr/local/lib/python2.7/dist-packages (from tornado<7,>=4.1->notebook->jupyter)
    45. Requirement already satisfied: backports-abc>=0.4 in /usr/local/lib/python2.7/dist-packages (from tornado<7,>=4.1->notebook->jupyter)
    46. Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python2.7/dist-packages (from jupyter-client<7.0.0,>=5.2.0->notebook->jupyter)
    47. Requirement already satisfied: wcwidth in /usr/local/lib/python2.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
    48. Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from ipython->jupyter-console->jupyter)
    49. Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/local/lib/python2.7/dist-packages (from ipython->jupyter-console->jupyter)
    50. Requirement already satisfied: pathlib2; python_version == "2.7" or python_version == "3.3" in /usr/local/lib/python2.7/dist-packages (from ipython->jupyter-console->jupyter)
    51. Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python2.7/dist-packages/setuptools-36.6.0-py2.7.egg (from ipython->jupyter-console->jupyter)
    52. Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python2.7/dist-packages (from ipython->jupyter-console->jupyter)
    53. Requirement already satisfied: pickleshare in /usr/local/lib/python2.7/dist-packages (from ipython->jupyter-console->jupyter)
    54. Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python2.7/dist-packages (from packaging->bleach->nbconvert->jupyter)
    55. Requirement already satisfied: backports.functools-lru-cache>=1.2.1; python_version < "3.2" in /usr/local/lib/python2.7/dist-packages (from wcwidth->prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
    56. Requirement already satisfied: typing; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython->jupyter-console->jupyter)
    57. Requirement already satisfied: scandir; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython->jupyter-console->jupyter)
    58. Installing collected packages: jupyter-console, jupyter
    59. Successfully installed jupyter-1.0.0 jupyter-console-5.2.0

  • 相关阅读:
    MySQL主主复制
    浅谈自旋锁和JVM对锁的优化
    本地部署推理TextDiffuser-2:释放语言模型用于文本渲染的力量
    小心XSS攻击......
    Edge浏览器如何简单用上ChatGPT
    JDBC技术
    CCF-CSP 202012-2 期末预测之最佳阈值
    HashMap 哈希碰撞、负载因子、插入方式、扩容倍数
    python分页爬取es日志,获取数据
    java案例24:模拟百度翻译
  • 原文地址:https://blog.csdn.net/qiuchangyong/article/details/133781986