This guide provides step-by-step instructions for installing the predicators package on Python 3.13, addressing compatibility issues with the original setup.py dependencies.
- Python 3.13.x
- A virtual environment (recommended)
- Git (for Git-based dependencies)
# If you don't have a virtual environment yet:
python3 -m venv .venv
# Activate the virtual environment
source .venv/bin/activateThe original setup.py has strict version pins that aren't compatible with Python 3.13. First, install the required build tools:
pip install --upgrade setuptools wheelThis avoids the dependency resolution conflicts:
pip install --no-deps -e .Use the Python 3.13 compatible requirements file:
pip install -r requirements-python3.13.txtInstall the remaining dependencies from Git repositories:
pip install "git+https://github.com/sebdumancic/structure_mapping.git" "git+https://github.com/tomsilver/pg3.git" "git+https://github.com/Learning-and-Intelligent-Systems/gym-sokoban.git"Set the required environment variable:
export PYTHONHASHSEED=0To make it permanent, add it to your shell profile:
# For bash
echo "export PYTHONHASHSEED=0" >> ~/.bashrc
# For zsh
echo "export PYTHONHASHSEED=0" >> ~/.zshrcbash install_fast_downward.sh
export FD_EXEC_PATH=$(pwd)/external/downward/fast-downward.pyAdd to shell profile for persistence:
echo "export FD_EXEC_PATH=$(pwd)/external/downward/fast-downward.py" >> ~/.zshrcAfter installation, you can run predicators with the environment variables set:
# Set environment variable (required)
export PYTHONHASHSEED=0
# Example command
python predicators/main.py --env burger --approach vlm_open_loop --seed 0 --num_train_tasks 1 --num_test_tasks 1 --bilevel_plan_without_sim True --make_failure_videos --sesame_task_planner fdopt --debug --vlm_model_name gemini-1.5-pro-latest --vlm_open_loop_use_training_demos TrueTo verify the installation worked:
source .venv/bin/activate
export PYTHONHASHSEED=0
python predicators/main.py --helpYou should see the help message without any import errors.
-
PyBullet not available: PyBullet has compilation issues with Python 3.13. All PyBullet-dependent environments (those with names starting with
pybullet_) will be automatically skipped. This is expected and allows you to use non-PyBullet environments. -
Gym deprecation warning: You may see warnings about gym being unmaintained. This is expected and doesn't affect functionality.
-
Package version conflicts: The dependency resolver may show warnings about version conflicts between the strict pins in setup.py and the installed versions. These are expected and generally don't cause issues.
-
pkg_resources deprecation: You may see warnings about pkg_resources being deprecated. This comes from some dependencies and is not critical.
Make sure:
- Your virtual environment is activated
- You've installed all dependencies as listed above
- The predicators package was installed with
pip install --no-deps -e .
Ensure you have the latest setuptools and wheel:
pip install --upgrade setuptools wheel pipSome dependencies may need system-level packages. On macOS with Homebrew:
# For opencv-python issues
brew install opencv
# For other compilation issues
xcode-select --installThe main changes made for Python 3.13 compatibility:
- numpy: Updated from
==1.23.5to>=1.24.0(numpy 1.23.5 doesn't support Python 3.13) - torch/torchvision: Updated to compatible versions
- Other packages: Used more flexible version constraints instead of strict pins
- Missing dependencies: Added
psutilwhich was required but not listed
This approach maintains compatibility while working around the Python 3.13 restrictions in the original dependency specifications.