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

Failed to build installable wheels for some pyproject.toml based projects (xformers) #39

Open
jsoncode opened this issue Jan 15, 2025 · 0 comments

Comments

@jsoncode
Copy link

When I run the install command, I get the following error:

pip3 install torch torchvision torchaudio xformers==0.0.29 --index-url https://download.pytorch.org/whl/cu124

success.

···
pip install -e .
···
error:

 Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
      ninja: error: Stat(C:/Users/Administrator/AppData/Local/Temp/pip-install-u0c21ykd/xformers_e7678a54560549dcb21bc7c3203f3b12/build/temp.win-amd64-cpython-310/Release/Users/Administrator/AppData/Local/Temp/pip-install-u0c21ykd/xformers_e7678a54560549dcb21bc7c3203f3b12/third_party/flash-attention/csrc/flash_attn/flash_api.obj): Filename longer than 260 characters
      Traceback (most recent call last):
        File "E:\AI-Github\memo-github\venv\lib\site-packages\torch\utils\cpp_extension.py", line 2104, in _run_ninja_build
          subprocess.run(
        File "D:\Program Files\Python316\lib\subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-u0c21ykd\xformers_e7678a54560549dcb21bc7c3203f3b12\setup.py", line 680, in <module>
          setuptools.setup(
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\core.py", line 186, in setup
          return run_commands(dist)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands
          dist.run_commands()
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\dist.py", line 983, in run_commands
          self.run_command(cmd)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\dist.py", line 999, in run_command
          super().run_command(command)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_command
          cmd_obj.run()
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\command\bdist_wheel.py", line 379, in run
          self.run_command("build")
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\cmd.py", line 339, in run_command
          self.distribution.run_command(command)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\dist.py", line 999, in run_command
          super().run_command(command)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_command
          cmd_obj.run()
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\command\build.py", line 136, in run
          self.run_command(cmd_name)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\cmd.py", line 339, in run_command
          self.distribution.run_command(command)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\dist.py", line 999, in run_command
          super().run_command(command)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_command
          cmd_obj.run()
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\command\build_ext.py", line 99, in run
          _build_ext.run(self)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 365, in run
          self.build_extensions()
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-u0c21ykd\xformers_e7678a54560549dcb21bc7c3203f3b12\setup.py", line 637, in build_extensions
          super().build_extensions()
        File "E:\AI-Github\memo-github\venv\lib\site-packages\torch\utils\cpp_extension.py", line 868, in build_extensions
          build_ext.build_extensions(self)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 481, in build_extensions
          self._build_extensions_serial()
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 507, in _build_extensions_serial
          self.build_extension(ext)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\command\build_ext.py", line 264, in build_extension
          _build_ext.build_extension(self, ext)
        File "E:\AI-Github\memo-github\venv\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 562, in build_extension
          objects = self.compiler.compile(
        File "E:\AI-Github\memo-github\venv\lib\site-packages\torch\utils\cpp_extension.py", line 840, in win_wrap_ninja_compile
          _write_ninja_file_and_compile_objects(
        File "E:\AI-Github\memo-github\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1784, in _write_ninja_file_and_compile_objects
          _run_ninja_build(
        File "E:\AI-Github\memo-github\venv\lib\site-packages\torch\utils\cpp_extension.py", line 2120, in _run_ninja_build
          raise RuntimeError(message) from e
      RuntimeError: Error compiling objects for extension
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for xformers
  Running setup.py clean for xformers
  Building wheel for aliyun-python-sdk-core (setup.py) ... done
  Created wheel for aliyun-python-sdk-core: filename=aliyun_python_sdk_core-2.16.0-py3-none-any.whl size=535396 sha256=c5eea32efa84d21203eb1c4cbfa38f0f6f424d85e7c9ec7c81c439d906ef07eb
  Stored in directory: d:\soft\pip_cache\wheels\35\11\5e\08e7cb4e03a3e83b4862edd12d1143c8d3936a3dd57a3ee46d
Successfully built memo aliyun-python-sdk-core
Failed to build xformers
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (xformers)
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

1 participant