installation.rst 6.6 KB

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