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

How to install apex #1851

Open
Zerycii opened this issue Oct 19, 2024 · 12 comments
Open

How to install apex #1851

Zerycii opened this issue Oct 19, 2024 · 12 comments

Comments

@Zerycii
Copy link

Zerycii commented Oct 19, 2024

Image
I always meet this error.Can someone help me?

@akshaypn
Copy link

Hi, I am also facing the exact same issue. Did anyone find a fix?

@XYkong-CS
Copy link

It seems you should install "torch" before installing apex.

@rensiyingying
Copy link

Hi,Maybe you could try command: pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --global-option="--cpp_ext" --global-option="--cuda_ext" ./

@lix19937
Copy link

git clone https://github.com/NVIDIA/apex
cd apex
# if pip >= 23.1 
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" ./

# otherwise
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --global-option="--cpp_ext" --global-option="--cuda_ext" ./

And you should make sure your torch cuda version must match the /usr/local/cuda/bin/nvcc

@AlongWY
Copy link

AlongWY commented Nov 20, 2024

try this one 试试这个?apex wheels

@zslefour
Copy link

try this one 试试这个?apex wheels

Is there a version that supports Windows?

@gontz
Copy link

gontz commented Nov 21, 2024

try this one 试试这个?apex wheels

Is there a version that supports Windows?

Only Linux

@rzw520
Copy link

rzw520 commented Nov 22, 2024

DEPRECATION: --build-option and --global-option are deprecated. pip 25.0 will enforce this behaviour change. A possible replacement is to use --config-settings. Discussion can be found at pypa/pip#11859
WARNING: Implying --no-binary=:all: due to the presence of --build-option / --global-option.

@VRehnberg
Copy link

I believe the problem is the use of import torch inside setup.py that together with pip build isolation makes torch not visible in some set-ups. In my case it was having torch installed as a system package and then trying to install apex in a virtualenv --system-site-packages. I could work around this by disabling the build-isolation https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-no-build-isolation but there should be another solution.

@rzw520
Copy link

rzw520 commented Dec 17, 2024

File "", line 10, in
ModuleNotFoundError: No module named 'torch'
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: 'D:\Anaconda3\envs\comfyui\python.exe' 'D:\Anaconda3\envs\comfyui\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py' get_requires_for_build_wheel 'C:\Users\ADMINI~1\AppData\Local\Temp\tmp04f7t541'
cwd: D:\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.
(comfyui) PS D:\apex>怎么样才能把版本搞一致啊?

@lix19937
Copy link

ModuleNotFoundError: No module named 'torch'

python -c "import torch;print(torch.version)"

@halo-cn
Copy link

halo-cn commented Jan 13, 2025

Hi,Maybe you could try command: pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --global-option="--cpp_ext" --global-option="--cuda_ext" ./

Awesome!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests