File size: 2,643 Bytes
31dc8dc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | .. _installation:
============
Installation
============
Last updated: 2025-11-8
This guide will walk you through setting up dFactory and installing
its dependencies.
Prerequisites
=============
- Git
- Python 3.10 or higher
- CUDA 12.4 or higher
Clone the Repository
====================
First, clone the project repository from GitHub. The ``--recursive`` flag
is important as it ensures that all necessary submodules are
downloaded as well.
.. code-block:: bash
git clone --recursive https://code.alipay.com/xbox/nexus_veomni.git
cd nexus_veomni
Environment Setup and Dependencies
==================================
We offer two methods for installation. We recommend using **uv** for its
speed, but you can also use **pip** with a standard virtual environment.
Option A: Using uv (Recommended)
--------------------------------
uv is an extremely fast Python package installer and resolver.
Install uv
~~~~~~~~~~
If you don't have uv installed, run:
.. code-block:: bash
curl -LsSf https://astral.sh/uv/install.sh | sh
.. note::
You may need to restart your terminal or source your shell
profile (``source ~/.bashrc``, ``source ~/.zshrc``, etc.) for the uv
command to become available.
Create Environment and Install Dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``uv sync`` command will create a virtual environment in the ``.venv``
directory and install all dependencies specified in the ``pyproject.toml``
file. The ``--extra gpu`` flag includes packages required for GPU support
(e.g., PyTorch with CUDA).
.. code-block:: bash
# From VeOmni's root directory (dFactory/VeOmni)
uv sync --extra gpu
Activate Environment
~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
source .venv/bin/activate
Your command prompt should now be prefixed with ``(.venv)``, indicating
that the environment is active.
Option B: Using pip and venv
----------------------------
This is the classic approach using Python's built-in tools.
Create Virtual Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
# From the project root directory (dFactory)
python -m venv .venv
Activate Virtual Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
source .venv/bin/activate
Install Project in Editable Mode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We will install the VeOmni package. The ``-e`` flag (editable mode)
allows you to make changes to the source code without needing to
reinstall. The ``[gpu]`` part installs the extra dependencies for GPU
support.
.. code-block:: bash
pip install -e "VeOmni[gpu]"
Next Steps
==========
You are now ready to use dFactory.
|