This documentation is for Dash Enterprise.
Dash Enterprise is the fastest way to write & deploy Dash apps and
Jupyter notebooks.
10% of the Fortune 500 uses Dash Enterprise to productionize AI and
data science apps. Find out if your company is using Dash Enterprise.
This page applies to Dash Enterprise 5. If your organization uses Dash Enterprise 4, view information about private packages at
https://<your-dash-enterprise-server>/Docs/dash-enterprise/private-packages
.
When you provide your Dash app’s Python dependencies in a requirements.txt
file, your app looks for
the packages on PyPI.org by default. This guide can help you customize this behavior when your app
depends on a package that is not available on PyPI.org.
See also: Handling dependencies when Dash Enterprise is internet-restricted.
There are two common approaches: Using a private Python package index provided by your organization or
including the Python packages directly in your app’s files.
If your organization manages a private Python package index, you can set it as an extra index that your app checks
when installing dependencies.
To install a package from a private Python package index:
At the top of requirements.txt
, add the following line:
txt
--extra-index-url <private-package-index> --trusted-host <private-package-index>
where <private-package-index>
is the URL to your organization’s private Python package index. You can omit the --trusted-host
flag if the index uses HTTPS.
List the package name in requirements.txt
on its own line the same way you would for a public package. For example:
txt
my-private-package
Your app continues to look for packages on PyPI.org, but it now also looks in your private Python package index for any
packages it can’t find on PyPI.org.
By placing the package tar.gz
(tarball) or .whl
(wheel) file directly in your app’s code, your app can install the package using this file.
Here’s an example where a tarball is placed at the root of the app:
-- .gitignore
-- app.py
-- Procfile
-- requirements.txt
-- myPackage.tar.gz
Make sure the requirements.txt
entry matches the name of the file you added, including the extension. In the example above, you would list the package in requirements.txt
with:
myPackage.tar.gz
Important: If your package depends on other packages that are not available on PyPI.org, you’ll need to add them to your app as well.
If you’re including a lot of packages in your app, you may want to organize them in a directory like packages
. Your
requirements.txt
would then look like:
packages/myPackageA.tar.gz
packages/myPackageB.tar.gz
packages/myPackageC.tar.gz