[Solved] Apex Install Error: ERROR: Command errored out with exit status 1

First of all, the most important thing is the version correspondence problem:
my environment
linux Ubuntu 16.04.7 lts
python = 3.7
python = 1.4
CUDA = 10.1
the versions of the above four should correspond. This can be found online.

This is the official installation procedure:

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

If not, replace the installation statement with the following:

python setup.py install --cuda_ext --cpp_ext

Errors may be reported here:
filenotfounderror: [errno 2] no such file or directory: ‘:/usr/local/cuda-10.1/bin/nvcc’: ‘:/usr/local/cuda-10.1/bin/nvcc’

The problem here lies in “: /”, so we just need to specify
export cuda_home = {/usr/local/cuda-10.1} to remove the redundant “:”, and then run it again. We will report some warnings. Don’t worry.

Read More: