installation.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. .. _installation:
  2. Installation
  3. ------------
  4. JupyterLab can be installed using ``conda``, ``pip``, ``pipenv`` or ``docker``.
  5. conda
  6. ~~~~~
  7. If you use ``conda``, you can install it with:
  8. .. code:: bash
  9. conda install -c conda-forge jupyterlab
  10. pip
  11. ~~~
  12. If you use ``pip``, you can install it with:
  13. .. code:: bash
  14. pip install jupyterlab
  15. If installing using ``pip install --user``, you must add the user-level
  16. ``bin`` directory to your ``PATH`` environment variable in order to launch
  17. ``jupyter lab``.
  18. pipenv
  19. ~~~~~~
  20. If you use ``pipenv``, you can install it as:
  21. .. code:: bash
  22. pipenv install jupyterlab
  23. pipenv shell
  24. or from a git checkout:
  25. .. code:: bash
  26. pipenv install git+git://github.com/jupyterlab/jupyterlab.git#egg=jupyterlab
  27. pipenv shell
  28. When using ``pipenv``, in order to launch ``jupyter lab``, you must activate the project's virtualenv.
  29. For example, in the directory where ``pipenv``'s ``Pipfile`` and ``Pipfile.lock`` live (i.e., where you ran the above commands):
  30. .. code:: bash
  31. pipenv shell
  32. jupyter lab
  33. Docker
  34. ~~~~~~
  35. If you have `Docker installed <https://docs.docker.com/install/>`__, you can install and use JupyterLab by selecting one
  36. of the many `ready-to-run Docker images <https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html>`__
  37. maintained by the Jupyter Team. Follow the instructions in the `Quick Start Guide <https://jupyter-docker-stacks.readthedocs.io/en/latest/>`__
  38. to deploy the chosen Docker image. NOTE: Ensure your docker command includes the `-e JUPYTER_ENABLE_LAB=yes` flag to ensure
  39. JupyterLab is enabled in your container.
  40. Installing with Previous Versions of Notebook
  41. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42. If you are using a version of Jupyter Notebook earlier than 5.3, then you must also run the following command to enable the JupyterLab
  43. server extension:
  44. .. code:: bash
  45. jupyter serverextension enable --py jupyterlab --sys-prefix
  46. Prerequisites
  47. ~~~~~~~~~~~~~
  48. JupyterLab requires the Jupyter Notebook version 4.3 or later. To check
  49. the version of the ``notebook`` package that you have installed:
  50. .. code:: bash
  51. jupyter notebook --version
  52. Usage with JupyterHub
  53. ~~~~~~~~~~~~~~~~~~~~~
  54. Install JupyterLab and JupyterHub.
  55. In ``jupyterhub_config.py``, configure the ``Spawner`` to tell the single-user notebook servers to default to JupyterLab:
  56. ``c.Spawner.default_url = '/lab'``
  57. Supported browsers
  58. ~~~~~~~~~~~~~~~~~~
  59. The latest versions of the following browsers are currently known to work:
  60. - Firefox
  61. - Chrome
  62. - Safari
  63. Earlier browser versions may also work, but come with no guarantees.
  64. JupyterLab uses CSS Variables for styling, which is one reason for the
  65. minimum versions listed above. IE 11+ or Edge 14 do not support
  66. CSS Variables, and are not directly supported at this time.
  67. A tool like `postcss <https://postcss.org/>`__ can be used to convert the CSS files in the
  68. ``jupyterlab/build`` directory manually if desired.
  69. Installation problems
  70. ~~~~~~~~~~~~~~~~~~~~~
  71. If your computer is behind corporate proxy or firewall,
  72. you may encounter HTTP and SSL errors due to custom security profiles managed by corporate IT departments.
  73. Example of typical error, when conda cannot connect to own repositories:
  74. + `CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>`
  75. This may happen because your company can block connections to widely-used repositories in Python and JavaScript communities.
  76. Here are some widely-used sites that host packages in the Python and JavaScript open-source ecosystem. Your network adminstrator may be able to allow http and https connections to these:
  77. - \*.pypi.org
  78. - \*.pythonhosted.org
  79. - \*.continuum.io
  80. - \*.anaconda.com
  81. - \*.conda.io
  82. - \*.github.com
  83. - \*.githubusercontent.com
  84. - \*.npmjs.com
  85. - \*.yarnpkg.com
  86. Alternatively you can specify proxy user (mostly domain user with password),
  87. that is allowed to communicate via network. This can be easily achieved
  88. by setting two common environment variables: `HTTP_PROXY` and `HTTPS_PROXY`.
  89. These variables are automatically used by many open-source tools (like ``conda``) if set correctly.
  90. .. code:: bash
  91. # For Windows
  92. set HTTP_PROXY=http://USER:PWD@proxy.company.com:PORT
  93. set HTTPS_PROXY=https://USER:PWD@proxy.comp any.com:PORT
  94. # For Linux / MacOS
  95. export HTTP_PROXY=http://USER:PWD@proxy.company.com:PORT
  96. export HTTPS_PROXY=https://USER:PWD@proxy.company.com:PORT
  97. In case you can communicate via HTTP, but installation with ``conda`` fails
  98. on connectivity problems to HTTPS servers, you can disable using SSL for ``conda``.
  99. .. warning:: Disabling SSL in communication is generally not recommended and involves potential security risk.
  100. .. code:: bash
  101. # Configure npm to not use SSL
  102. conda config --set ssl_verify False
  103. You can do a similar thing for ``pip``.
  104. The approach here is to mark repository servers as trusted hosts,
  105. which means, SSL communication will not be required for downloading Python libraries.
  106. .. code:: bash
  107. # Install pandas (without SSL)
  108. pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pandas
  109. Using the tips from above, you can handle many network problems
  110. related to installing Python libraries.
  111. Many Jupyter extensions require having a working ``npm`` command,
  112. which is required for downloading useful Jupyter extensions or other JavaScript dependencies.
  113. Example of typical error message, when ``npm`` cannot connect to own repositories:
  114. + `ValueError: "@jupyterlab/toc" is not a valid npm package`
  115. .. code:: bash
  116. # Set proxy for NPM
  117. npm config set proxy http://USER:PWD@proxy.company.com:PORT
  118. npm config set proxy https://USER:PWD@proxy.company.com:PORT
  119. # Set default registry for NPM (optional, useful in case if common JavaScript libs cannot be found)
  120. npm config set registry http://registry.npmjs.org/
  121. In case you can communicate via HTTP, but installation with ``npm`` fails
  122. on connectivity problems to HTTPS servers, you can disable using SSL for ``npm``.
  123. .. warning:: Disabling SSL in communication is generally not recommended and involves potential security risk.
  124. .. code:: bash
  125. # Configure npm to not use SSL
  126. npm set strict-ssl False