installation.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. .. _installation:
  2. Installation
  3. ============
  4. JupyterLab can be installed using ``conda``, ``mamba``, ``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. mamba
  11. -----
  12. If you use ``mamba``, you can install it with:
  13. .. code:: bash
  14. mamba install -c conda-forge jupyterlab
  15. pip
  16. ---
  17. If you use ``pip``, you can install it with:
  18. .. code:: bash
  19. pip install jupyterlab
  20. If you are using a macOS version that comes with Python 2, run ``pip3``
  21. instead of ``pip``.
  22. If installing using ``pip install --user``, you must add the user-level
  23. ``bin`` directory to your ``PATH`` environment variable in order to launch
  24. ``jupyter lab``. If you are using a Unix derivative (FreeBSD, GNU/Linux,
  25. macOS), you can do this by running ``export PATH="$HOME/.local/bin:$PATH"``.
  26. pipenv
  27. ------
  28. If you use ``pipenv``, you can install it as:
  29. .. code:: bash
  30. pipenv install jupyterlab
  31. pipenv shell
  32. or from a git checkout:
  33. .. code:: bash
  34. pipenv install git+git://github.com/jupyterlab/jupyterlab.git#egg=jupyterlab
  35. pipenv shell
  36. When using ``pipenv``, in order to launch ``jupyter lab``, you must activate the project's virtualenv.
  37. For example, in the directory where ``pipenv``'s ``Pipfile`` and ``Pipfile.lock`` live (i.e., where you ran the above commands):
  38. .. code:: bash
  39. pipenv shell
  40. jupyter lab
  41. Alternatively, you can run ``jupyter lab`` inside the virtualenv with
  42. .. code:: bash
  43. pipenv run jupyter lab
  44. Docker
  45. ------
  46. If you have `Docker installed <https://docs.docker.com/install/>`__, you can install and use JupyterLab by selecting one
  47. of the many `ready-to-run Docker images <https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html>`__
  48. maintained by the Jupyter Team. Follow the instructions in the `Quick Start Guide <https://jupyter-docker-stacks.readthedocs.io/en/latest/>`__
  49. to deploy the chosen Docker image.
  50. Ensure your docker command includes the ``-e JUPYTER_ENABLE_LAB=yes`` flag to ensure
  51. JupyterLab is enabled in your container.
  52. Usage with JupyterHub
  53. ---------------------
  54. Read the details on our :ref:`JupyterLab on JupyterHub documentation page <jupyterhub>`.
  55. Supported browsers
  56. ------------------
  57. The latest versions of the following browsers are currently known to work:
  58. - Firefox
  59. - Chrome
  60. - Safari
  61. Earlier browser versions may also work, but come with no guarantees.
  62. JupyterLab uses CSS Variables for styling, which is one reason for the
  63. minimum versions listed above. IE 11+ or Edge 14 do not support
  64. CSS Variables, and are not directly supported at this time.
  65. A tool like `postcss <https://postcss.org/>`__ can be used to convert the CSS files in the
  66. ``jupyterlab/build`` directory manually if desired.
  67. Usage with private NPM registry
  68. -------------------------------
  69. To install some extensions, you will need access to an NPM packages registry. Some companies do not allow
  70. reaching directly public registry and have a private registry. To use it, you need to configure ``npm``
  71. **and** ``yarn`` to point to that registry (ask your corporate IT department for the correct URL):
  72. .. code::
  73. npm config set registry https://registry.company.com/
  74. yarn config set registry https://registry.company.com/
  75. JupyterLab will pick up that registry automatically. You can check which registry URL is used by JupyterLab by running::
  76. python -c "from jupyterlab.commands import AppOptions; print(AppOptions().registry)"
  77. Installation problems
  78. ---------------------
  79. If your computer is behind corporate proxy or firewall,
  80. you may encounter HTTP and SSL errors due to the proxy or firewall blocking connections to widely-used servers. For example, you might see this error if conda cannot connect to its own repositories::
  81. CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>
  82. Here are some widely-used sites that host packages in the Python and JavaScript open-source ecosystems. Your network administrator may be able to allow http and https connections to these domains:
  83. - pypi.org
  84. - pythonhosted.org
  85. - continuum.io
  86. - anaconda.com
  87. - conda.io
  88. - github.com
  89. - githubusercontent.com
  90. - npmjs.com
  91. - yarnpkg.com
  92. Alternatively, you can specify a proxy user (usually a domain user with password),
  93. that is allowed to communicate via network. This can be easily achieved
  94. by setting two common environment variables: ``HTTP_PROXY`` and ``HTTPS_PROXY``.
  95. These variables are automatically used by many open-source tools (like ``conda``) if set correctly.
  96. .. code:: bash
  97. # For Windows
  98. set HTTP_PROXY=http://USER:PWD@proxy.company.com:PORT
  99. set HTTPS_PROXY=https://USER:PWD@proxy.company.com:PORT
  100. # For Linux / MacOS
  101. export HTTP_PROXY=http://USER:PWD@proxy.company.com:PORT
  102. export HTTPS_PROXY=https://USER:PWD@proxy.company.com:PORT
  103. In case you can communicate via HTTP, but installation with ``conda`` fails
  104. on connectivity problems to HTTPS servers, you can disable using SSL for ``conda``.
  105. .. warning:: Disabling SSL in communication is generally not recommended and involves potential security risks.
  106. .. code:: bash
  107. # Configure npm to not use SSL
  108. conda config --set ssl_verify False
  109. You can do a similar thing for ``pip``.
  110. The approach here is to mark repository servers as trusted hosts,
  111. which means SSL communication will not be required for downloading Python libraries.
  112. .. code:: bash
  113. # Install pandas (without SSL)
  114. pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pandas
  115. Using the tips from above, you can handle many network problems
  116. related to installing Python libraries.
  117. Many Jupyter extensions require having working ``npm`` and ``jlpm`` (alias for ``yarn``) commands,
  118. which is required for downloading useful Jupyter extensions or other JavaScript dependencies. If ``npm`` cannot connect to its own repositories, you might see an error like::
  119. ValueError: "@jupyterlab/toc" is not a valid npm package
  120. You can set the proxy or registry used for npm with the following commands.
  121. .. code:: bash
  122. # Set proxy for NPM
  123. npm config set proxy http://USER:PWD@proxy.company.com:PORT
  124. npm config set proxy https://USER:PWD@proxy.company.com:PORT
  125. # Set default registry for NPM (optional, useful in case if common JavaScript libs cannot be found)
  126. npm config set registry http://registry.npmjs.org/
  127. jlpm config set registry https://registry.yarnpkg.com/
  128. In case you can communicate via HTTP, but installation with ``npm`` fails
  129. on connectivity problems to HTTPS servers, you can disable using SSL for ``npm``.
  130. .. warning:: Disabling SSL in communication is generally not recommended and involves potential security risk.
  131. .. code:: bash
  132. # Configure npm to not use SSL
  133. npm set strict-ssl False