Skip to content

How to install apex #1851

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

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

How to install apex #1851

Zerycii opened this issue Oct 19, 2024 · 16 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!!!!!

@zhangxb1989
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" ./

Awesome!!!!!

It worked....What is the different with the original command

@FreeCloudmlgbd
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" ./

thanks a lot!!!!

@josephxie1
Copy link

pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --no-build-isolation . I've done it.

@pandayummy
Copy link

cheng@CHENG:~$ cd apex
cheng@CHENG:~/apex$ 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" ./
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

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