-
Notifications
You must be signed in to change notification settings - Fork 168
Migrate from pip to uv #670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,39 +59,41 @@ We are shipping a first look at the DIMOS x Unitree Go2 integration, allowing fo | |
| Tested on Ubuntu 22.04/24.04 | ||
|
|
||
| ```bash | ||
| sudo apt install python3-venv | ||
|
|
||
| # Clone the repository | ||
| git clone --branch dev --single-branch https://github.com/dimensionalOS/dimos.git | ||
| cd dimos | ||
|
|
||
| # Create and activate virtual environment | ||
| python3 -m venv venv | ||
| source venv/bin/activate | ||
| # Install uv | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
|
|
||
| # Setup virtual env and activate environment | ||
| uv venv --python 3.10 | ||
| source .venv/bin/activate | ||
|
|
||
| sudo apt install portaudio19-dev python3-pyaudio | ||
|
|
||
| # Install LFS | ||
| sudo apt install git-lfs | ||
| git lfs install | ||
|
|
||
| # Install torch and torchvision if not already installed | ||
| # Example CUDA 11.7, Pytorch 2.0.1 (replace with your required pytorch version if different) | ||
| pip install torch==2.0.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 | ||
| ``` | ||
|
|
||
| #### Install dependencies | ||
| ```bash | ||
| # CPU only (reccomended to attempt first) | ||
| pip install -e .[cpu,dev] | ||
| # Install dependencies | ||
| # CPU only (recommended to attempt first) | ||
| uv sync --extra dev --extra cpu | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idk this syntax i usually do
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uv sync and uv add are more native options from uv. uv sync installs only the subset of dependencies that are missing or have changed, making it faster than checking everything like pip install does. uv pip install will install the packages in global env if local isn't activated, uv sync needs opt-in. given how specific some dependencies are, we wouldn't want to mess with the system level dependencies accidentally |
||
|
|
||
| # CUDA install | ||
| pip install -e .[cuda,dev] | ||
| uv sync --extra dev --extra cuda | ||
|
|
||
| # Copy and configure environment variables | ||
| cp default.env .env | ||
| ``` | ||
|
|
||
| **Note:** For CUDA 11.8 specifically, you can install torch separately before syncing: | ||
| ```bash | ||
| uv pip install torch==2.0.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 | ||
| uv sync --extra dev --extra cpu --no-install-project | ||
| ``` | ||
|
|
||
| #### Test the install | ||
| ```bash | ||
| pytest -s dimos/ | ||
|
|
@@ -103,10 +105,19 @@ CONNECTION_TYPE=fake python dimos/robot/unitree_webrtc/unitree_go2.py | |
| ``` | ||
|
|
||
| #### Test Dimensional with a simulated UnitreeGo2 in MuJoCo (no robot required) | ||
|
|
||
| **With GUI (local machine with display):** | ||
| ```bash | ||
| uv sync --extra dev --extra cpu --extra sim | ||
| export DISPLAY=:0 | ||
| CONNECTION_TYPE=mujoco python dimos/robot/unitree_webrtc/unitree_go2.py | ||
| ``` | ||
|
|
||
| **Headless mode (SSH/server without display):** | ||
| ```bash | ||
| pip install -e .[sim] | ||
| export DISPLAY=:1 # Or DISPLAY=:0 if getting GLFW/OpenGL X11 errors | ||
| CONNECTION_TYPE=mujoco python dimos/robot/unitree_webrtc/unitree_go2.py | ||
| uv sync --extra dev --extra cpu --extra sim | ||
| sudo apt install xvfb # Install if not already available | ||
| xvfb-run -a CONNECTION_TYPE=mujoco python dimos/robot/unitree_webrtc/unitree_go2.py | ||
| ``` | ||
|
|
||
| #### Test Dimensional with a real UnitreeGo2 over WebRTC | ||
|
|
@@ -482,6 +493,6 @@ Huge thanks to! | |
| - Email: [build@dimensionalOS.com](mailto:build@dimensionalOS.com) | ||
|
|
||
| ## Known Issues | ||
| - Agent() failure to execute Nav2 action primitives (move, reverse, spinLeft, spinRight) is almost always due to the internal ROS2 collision avoidance, which will sometimes incorrectly display obstacles or be overly sensitive. Look for ```[behavior_server]: Collision Ahead - Exiting DriveOnHeading``` in the ROS logs. Reccomend restarting ROS2 or moving robot from objects to resolve. | ||
| - ```docker-compose up --build``` does not fully initialize the ROS2 environment due to ```std::bad_alloc``` errors. This will occur during continuous docker development if the ```docker-compose down``` is not run consistently before rebuilding and/or you are on a machine with less RAM, as ROS is very memory intensive. Reccomend running to clear your docker cache/images/containers with ```docker system prune``` and rebuild. | ||
| - Agent() failure to execute Nav2 action primitives (move, reverse, spinLeft, spinRight) is almost always due to the internal ROS2 collision avoidance, which will sometimes incorrectly display obstacles or be overly sensitive. Look for ```[behavior_server]: Collision Ahead - Exiting DriveOnHeading``` in the ROS logs. recommend restarting ROS2 or moving robot from objects to resolve. | ||
| - ```docker-compose up --build``` does not fully initialize the ROS2 environment due to ```std::bad_alloc``` errors. This will occur during continuous docker development if the ```docker-compose down``` is not run consistently before rebuilding and/or you are on a machine with less RAM, as ROS is very memory intensive. recommend running to clear your docker cache/images/containers with ```docker system prune``` and rebuild. | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant.
uv venv --python 3.10replaces it.