Skip to content
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

When doing pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./, shows ModuleNotFoundError: No module named 'packaging' #1737

Open
lainmn opened this issue Oct 5, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@lainmn
Copy link

lainmn commented Oct 5, 2023

Describe the Bug

When doing pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./, shows ModuleNotFoundError: No module named 'packaging', but I have packaging installed

The detailed error looks like this:
Traceback (most recent call last):
File "C:\Users\luo00318\AppData\Roaming\Python\Python39\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Users\luo00318\AppData\Roaming\Python\Python39\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\luo00318\AppData\Roaming\Python\Python39\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\luo00318\AppData\Local\Temp\pip-build-env-wchsm8v0\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "C:\Users\luo00318\AppData\Local\Temp\pip-build-env-wchsm8v0\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
self.run_setup()
File "C:\Users\luo00318\AppData\Local\Temp\pip-build-env-wchsm8v0\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "", line 5, in
ModuleNotFoundError: No module named 'packaging'
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: 'C:\Users\luo00318\AppData\Local\anaconda3\envs\torch_gpu\python.exe' 'C:\Users\luo00318\AppData\Roaming\Python\Python39\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py' get_requires_for_build_wheel 'C:\Users\luo00318\AppData\Local\Temp\tmptlqivujq'
cwd: C:\Users\luo00318\Research\ICL\myplan\week4\apex
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Minimal Steps/Code to Reproduce the Bug

Expected Behavior

should have been installed correctly?

Environment

@lainmn lainmn added the bug Something isn't working label Oct 5, 2023
@orrzohar
Copy link

orrzohar commented Oct 7, 2023

I got the same error.

1 similar comment
@sym330
Copy link

sym330 commented Oct 7, 2023

I got the same error.

@lengendhao
Copy link

lengendhao commented Oct 14, 2023

Hey! I also got this error, and I've solved it. You can see #1653, which said:

  1. clone or download apex 22.04-dev branch instead of master brach
  2. use the command:pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ to install 'apex'.
    You may get another error: No such file or directory: ':/usr/local/cuda-11.0/bin/nvcc'
    You can vi ~/.bashrc
    then change 'export CUDA_HOME=$CUDA_HOME:/usr/local/cuda' into 'export CUDA_HOME=/usr/local/cuda'
    Finally, source ~/.bashrc
    Use the command again, and you will use apex succesfully!

@rocke2020
Copy link

Hey! I also got this error, and I've solved it. You can see #1653, which said:

  1. clone or download apex 22.04-dev branch instead of master brach
  2. use the command:pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ to install 'apex'.
    You may get another error: No such file or directory: ':/usr/local/cuda-11.0/bin/nvcc'
    You can vi ~/.bashrc
    then change 'export CUDA_HOME=$CUDA_HOME:/usr/local/cuda' into 'export CUDA_HOME=/usr/local/cuda'
    Finally, source ~/.bashrc
    Use the command again, and you will use apex succesfully!

could you share your package details? thanks in advance!
1, torch version
2, python version
3, cuda version
My envs: torch 2.1, py 3.10, cuda 11.8, I has the same apex install error. the 22.04-dev branch also failed to install.

@lengendhao
Copy link

Hey! I also got this error, and I've solved it. You can see #1653, which said:

  1. clone or download apex 22.04-dev branch instead of master brach
  2. use the command:pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ to install 'apex'.
    You may get another error: No such file or directory: ':/usr/local/cuda-11.0/bin/nvcc'
    You can vi ~/.bashrc
    then change 'export CUDA_HOME=$CUDA_HOME:/usr/local/cuda' into 'export CUDA_HOME=/usr/local/cuda'
    Finally, source ~/.bashrc
    Use the command again, and you will use apex succesfully!

could you share your package details? thanks in advance! 1, torch version 2, python version 3, cuda version My envs: torch 2.1, py 3.10, cuda 11.8, I has the same apex install error. the 22.04-dev branch also failed to install.

My envs:
PyTorch 1.8.1
Python 3.8(ubuntu18.04)
Cuda 11.1
Maybe this issue can help you: #1735

@rocke2020
Copy link

rocke2020 commented Dec 6, 2023

Hey! I also got this error, and I've solved it. You can see #1653, which said:

  1. clone or download apex 22.04-dev branch instead of master brach
  2. use the command:pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ to install 'apex'.
    You may get another error: No such file or directory: ':/usr/local/cuda-11.0/bin/nvcc'
    You can vi ~/.bashrc
    then change 'export CUDA_HOME=$CUDA_HOME:/usr/local/cuda' into 'export CUDA_HOME=/usr/local/cuda'
    Finally, source ~/.bashrc
    Use the command again, and you will use apex succesfully!

could you share your package details? thanks in advance! 1, torch version 2, python version 3, cuda version My envs: torch 2.1, py 3.10, cuda 11.8, I has the same apex install error. the 22.04-dev branch also failed to install.

My envs: PyTorch 1.8.1 Python 3.8(ubuntu18.04) Cuda 11.1 Maybe this issue can help you: #1735

@lengendhao thanks!! I create an env exactly as yours, and with 22.04-dev, finally apex successfully installed with
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

@zhongyu-zhao
Copy link

python 3.7.3
pytorch 1.5.1
cuda 12.0
conda install packaging pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --global-option="--cpp_ext" --global-option="--cuda_ext" ./
apex 22.04-dev branch doesn't work for me... but i've found that #1748 solved my problem. Good luck!

@LukeLIN-web
Copy link

LukeLIN-web commented Mar 6, 2024

I also met this problem. #1748 (comment) solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants