-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Title:
[Bug] pip install -e . fails in mmtracking 0.13.0 due to ModuleNotFoundError: No module named 'torch'
Description
While setting up mmtracking (version 0.13.0) following the recommended installation steps, the installation fails at pip install -e . with ModuleNotFoundError: No module named 'torch'.
Even though PyTorch is installed and works when imported manually (python -c "import torch; print(torch.__version__)"), the setup process does not detect it, causing an error.
Environment
- OS: Ubuntu 22.04
- Python Version: 3.9
- Conda Version: 22.9.0
- Pip Version: 25.0.1
- mmtracking Version: 0.13.0
- mmcv-full Version: 1.5.3
- CUDA Version: 11.7
- PyTorch Version: 1.13.1, 1.13.0(tried both)
- NumPy Version: 2.21.5
Steps to Reproduce
-
Create Conda environment and install PyTorch
conda create -n deepsvc python=3.9 -y conda activate deepsvc conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia
-
Install mmcv-full
pip install mmcv-full==1.5.3 -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13/index.html
- Issue: The installation gets stuck at
building wheel for mmcv-full.
- Issue: The installation gets stuck at
-
Workaround for mmcv-full
- Clone
mmcvrepository (1.5.3 version) - Install manually:
git clone -b v1.5.3 https://github.com/open-mmlab/mmcv.git cd mmcv MMCV_WITH_OPS=1 pip install -e .
- Issue: Error occurs due to missing
pyproject.toml.
- Clone
-
Fix: Add
pyproject.tomlwith the following content and install using PEP 517:[build-system] requires = ["setuptools>=64", "wheel"] build-backend = "setuptools.build_meta"
pip install -e . --use-pep517- Success: mmcv-full installs successfully.
-
Download and install mmtracking
git clone -b v0.13.0 https://github.com/open-mmlab/mmtracking.git cd mmtracking pip install -v -e .
-
Error occurs:
ModuleNotFoundError: No module named 'torch' error: subprocess-exited-with-error
Observed Behavior
Even though PyTorch is correctly installed and works when imported manually (python -c "import torch; print(torch.__version__)"), the pip install -e . process does not recognize it and fails.
What I Have Tried
-
Checked PyTorch installation
python -c "import torch; print(torch.__version__)"- Output:
1.13.1(PyTorch is installed correctly)
- Output:
-
Reinstalled dependencies
pip install --upgrade pip setuptools wheel pip install --force-reinstall torch torchvision torchaudio
- Issue persists.
-
Checked Python environment
conda list | grep torch- PyTorch is installed in the correct environment.
-
Tried a fresh Conda environment and reinstalled everything
conda remove --name deepsvc --all conda create -n deepsvc python=3.9 -y conda activate deepsvc conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia pip install mmcv-full==1.5.3 -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13/index.html git clone -b v0.13.0 https://github.com/open-mmlab/mmtracking.git cd mmtracking pip install -v -e .
- Same error occurs.
Expected Behavior
pip install -e . should complete successfully without errors.
Additional Information
- It seems like
setuptoolsdoes not detect the installedtorchpackage during the editable installation process. - Other users facing a similar issue with
mmtrackingmay need to check whetherpyproject.tomlis required for installation. - Any insights on whether this is a
setuptoolsissue or specific tommtrackingwould be helpful.
Would appreciate any guidance on resolving this! 🚀