How to solve the errors building facebook's NeuralCompression

나중에 뭔가 공유해야 할 수도 있을 것 같아서 적어둔다.
시간 순서대로 만난 오류들 정리했다.

환경

  • Ubuntu 20.04 LTS
  • conda 4.10.3
    Anaconda로 가상환경 만들어서 진행했다.

ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

PyYAML 버전 업을 하는 게 있는 것 같은데 일단 인터넷에 나와있는 방법으로는
따로 업데이트 하고, 전체 설치 때 --ignore-installed 하고 설치하라고 나와있었다.
나는 별도로 업데이트 하지 않고 ignore 했다.
pip install --ignore-installed PyYAML NeuralCompression 이란 명령어로 설치했고, 아직까진 문제가 없다.


Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqlte9o39
       cwd: /home/mindyeoi/Desktop/NeuralCompression
  Complete output (36 lines):
  Traceback (most recent call last):
    File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 159, in _get_build_requires
      self.run_setup()
    File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 174, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 8, in <module>
      setup()
    File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 109, in setup
      _setup_distribution = dist = klass(attrs)
    File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 462, in __init__
      _Distribution.__init__(
    File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 293, in __init__
      self.finalize_options()
    File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 886, in finalize_options
      ep(self)
    File "/tmp/pip-build-env-lywwxeyz/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 104, in infer_version
      _assign_version(dist, config)
    File "/tmp/pip-build-env-lywwxeyz/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 51, in _assign_version
      _version_missing(config)
    File "/tmp/pip-build-env-lywwxeyz/overlay/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 106, in _version_missing
      raise LookupError(
  LookupError: setuptools-scm was unable to detect version for /home/mindyeoi/Desktop/NeuralCompression.
  Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
  For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
  ----------------------------------------
WARNING: Discarding file:///home/mindyeoi/Desktop/NeuralCompression. Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqlte9o39 Check the logs for full command output.
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqlte9o39 Check the logs for full command output.
WARNING: You are using pip version 21.3.1; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

pip버전이 높으면 나타날 수 있는 에러라길래 pip 버전을 확인해봤더니 20.x 이었다. 버전을 18.1로 낮춰줬다.
pip install pip==18.1
그랬더니..

  (facebook_neuralcompression) root@mindyeoi-System-Product-Name:/home/mindyeoi/Desktop/NeuralCompression# pip install -r requirements.txt
Obtaining file:///home/mindyeoi/Desktop/NeuralCompression (from -r requirements.txt (line 1))
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/mindyeoi/Desktop/NeuralCompression/setup.py", line 8, in <module>
        setup()
      File "/tmp/pip-build-env-zbyp5fnt/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
        return distutils.core.setup(**attrs)
      File "/tmp/pip-build-env-zbyp5fnt/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 109, in setup
        _setup_distribution = dist = klass(attrs)
      File "/tmp/pip-build-env-zbyp5fnt/lib/python3.8/site-packages/setuptools/dist.py", line 462, in __init__
        _Distribution.__init__(
      File "/tmp/pip-build-env-zbyp5fnt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 293, in __init__
        self.finalize_options()
      File "/tmp/pip-build-env-zbyp5fnt/lib/python3.8/site-packages/setuptools/dist.py", line 886, in finalize_options
        ep(self)
      File "/tmp/pip-build-env-zbyp5fnt/lib/python3.8/site-packages/setuptools_scm/integration.py", line 104, in infer_version
        _assign_version(dist, config)
      File "/tmp/pip-build-env-zbyp5fnt/lib/python3.8/site-packages/setuptools_scm/integration.py", line 51, in _assign_version
        _version_missing(config)
      File "/tmp/pip-build-env-zbyp5fnt/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 106, in _version_missing
        raise LookupError(
    LookupError: setuptools-scm was unable to detect version for /home/mindyeoi/Desktop/NeuralCompression.
    Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
    For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

이런 에러가 나왔다. 밑에 잘 보면 Make sure you're either building from a fully intact git repository or PyPI tarballs. 이 있는데,
깃 레포 온전히 잘 가져왔는지 확인해보고, PyPI tarballs로 빌드 잘 한거냐라길래 PyPI tarballs를 확인해 본다..
근데.. 뭔가 pip 버전을 일부러 낮춘게 문제가 된건 아닐까 해서 pip버전을 최신으로 업데이트 했다.
그랬더니 다른 오류가 나온다.

 (facebook_neuralcompression) root@mindyeoi-System-Product-Name:/home/mindyeoi/Desktop/NeuralCompression# pip install --editable ".[test]"
Obtaining file:///home/mindyeoi/Desktop/NeuralCompression
 Installing build dependencies ... done
 Checking if build backend supports build_editable ... done
 Getting requirements to build wheel ... error
 error: subprocess-exited-with-error
 × Getting requirements to build wheel did not run successfully.
 │ exit code: 1
 ╰─> [36 lines of output]
     Traceback (most recent call last):
       File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
         main()
       File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
         json_out['return_val'] = hook(**hook_input['kwargs'])
       File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
         return hook(config_settings)
       File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
         return self._get_build_requires(
       File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 159, in _get_build_requires
         self.run_setup()
       File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 174, in run_setup
         exec(compile(code, __file__, 'exec'), locals())
       File "setup.py", line 8, in <module>
         setup()
       File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 87, in setup
         return distutils.core.setup(**attrs)
       File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 109, in setup
         _setup_distribution = dist = klass(attrs)
       File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 462, in __init__
         _Distribution.__init__(
       File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 293, in __init__
         self.finalize_options()
       File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 886, in finalize_options
         ep(self)
       File "/tmp/pip-build-env-2mu80u3k/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 104, in infer_version
         _assign_version(dist, config)
       File "/tmp/pip-build-env-2mu80u3k/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 51, in _assign_version
         _version_missing(config)
       File "/tmp/pip-build-env-2mu80u3k/overlay/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 106, in _version_missing
         raise LookupError(
     LookupError: setuptools-scm was unable to detect version for /home/mindyeoi/Desktop/NeuralCompression.
     Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
     For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
     [end of output]
 note: This error originates from a subprocess, and is likely not a problem with pip.
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.

note: This error originates from a subprocess, and is likely not a problem with pip. 이라고 한다..
subprocess로부터 발생된 error....?

좋은 웹페이지 즐겨찾기