installation.rst 6.5 KB

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