torchlars icon indicating copy to clipboard operation
torchlars copied to clipboard

[Error] pip install torchlars

Open Topology1225 opened this issue 4 years ago • 3 comments

When I tried to install torchlars via pip install torchlars, I faced the next errors.

Can anyone solve this?

Installing collected packages: torchlars
    Running setup.py install for torchlars ... error
    ERROR: Command errored out with exit status 1:
     command: /home/satoharu/.pyenv/versions/3.8.6/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-brudjor_/torchlars/setup.py'"'"'; __file__='"'"'/tmp/pip-install-brudjor_/torchlars/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pzwa2q8c/install-record.txt --single-version-externally-managed --compile --install-headers /home/satoharu/.pyenv/versions/3.8.6/include/python3.8/torchlars
         cwd: /tmp/pip-install-brudjor_/torchlars/
    Complete output (35 lines):
    WARNING: The wheel package is not available.
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/torchlars
    copying torchlars/__init__.py -> build/lib.linux-x86_64-3.8/torchlars
    copying torchlars/__version__.py -> build/lib.linux-x86_64-3.8/torchlars
    copying torchlars/lars.py -> build/lib.linux-x86_64-3.8/torchlars
    running build_ext
    /home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/utils/cpp_extension.py:339: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
      warnings.warn(msg.format('we could not find ninja.'))
    /home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/utils/cpp_extension.py:281: UserWarning:
    
                                   !! WARNING !!
    
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch!
    Please use a compiler that is ABI-compatible with GCC 5.0 and above.
    See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
    
    See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
    for instructions on how to install GCC 5 or higher.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
                                  !! WARNING !!
    
      warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))
    building 'torchlars._adaptive_lr' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/torchlars
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/include -I/home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/include/TH -I/home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/satoharu/.pyenv/versions/3.8.6/include/python3.8 -c torchlars/adaptive_lr.cc -o build/temp.linux-x86_64-3.8/torchlars/adaptive_lr.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_adaptive_lr -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    gcc: error: unrecognized command line option ‘-std=c++14’
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/satoharu/.pyenv/versions/3.8.6/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-brudjor_/torchlars/setup.py'"'"'; __file__='"'"'/tmp/pip-install-brudjor_/torchlars/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pzwa2q8c/install-record.txt --single-version-externally-managed --compile --install-headers /home/satoharu/.pyenv/versions/3.8.6/include/python3.8/torchlars Check the logs for full command output.

Topology1225 avatar Dec 10 '20 07:12 Topology1225

I encountered the same error. Currently, my torch version is 1.7.0.

aki916 avatar Dec 10 '20 07:12 aki916

When I tried to install torchlars via pip install torchlars, I faced the next errors.

Can anyone solve this?

Installing collected packages: torchlars
    Running setup.py install for torchlars ... error
    ERROR: Command errored out with exit status 1:
     command: /home/satoharu/.pyenv/versions/3.8.6/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-brudjor_/torchlars/setup.py'"'"'; __file__='"'"'/tmp/pip-install-brudjor_/torchlars/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pzwa2q8c/install-record.txt --single-version-externally-managed --compile --install-headers /home/satoharu/.pyenv/versions/3.8.6/include/python3.8/torchlars
         cwd: /tmp/pip-install-brudjor_/torchlars/
    Complete output (35 lines):
    WARNING: The wheel package is not available.
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/torchlars
    copying torchlars/__init__.py -> build/lib.linux-x86_64-3.8/torchlars
    copying torchlars/__version__.py -> build/lib.linux-x86_64-3.8/torchlars
    copying torchlars/lars.py -> build/lib.linux-x86_64-3.8/torchlars
    running build_ext
    /home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/utils/cpp_extension.py:339: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
      warnings.warn(msg.format('we could not find ninja.'))
    /home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/utils/cpp_extension.py:281: UserWarning:
    
                                   !! WARNING !!
    
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch!
    Please use a compiler that is ABI-compatible with GCC 5.0 and above.
    See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
    
    See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
    for instructions on how to install GCC 5 or higher.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
                                  !! WARNING !!
    
      warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))
    building 'torchlars._adaptive_lr' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/torchlars
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/include -I/home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/include/TH -I/home/satoharu/.pyenv/versions/3.8.6/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/satoharu/.pyenv/versions/3.8.6/include/python3.8 -c torchlars/adaptive_lr.cc -o build/temp.linux-x86_64-3.8/torchlars/adaptive_lr.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_adaptive_lr -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    gcc: error: unrecognized command line option ‘-std=c++14’
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/satoharu/.pyenv/versions/3.8.6/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-brudjor_/torchlars/setup.py'"'"'; __file__='"'"'/tmp/pip-install-brudjor_/torchlars/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file_ _);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-pzwa2q8c/install-record.txt --single-version-externally-managed --compile --install-headers /home/satoharu/.pyenv/versions/3.8.6/include/python3.8/torchlars Check the logs for full command output.

I encountered the same error. Did you solve it now?

lorafei avatar Feb 27 '21 05:02 lorafei

我遇到了同样的错误。 目前,我的手电筒版本是 1.7.0。

请问你们解决问题了吗

LvXueshuai avatar May 16 '22 08:05 LvXueshuai