Dao-AILab / causal-conv1d

Causal depthwise conv1d in CUDA, with a PyTorch interface
BSD 3-Clause "New" or "Revised" License
284 stars 54 forks source link

Cannot install on ends that do not have dependencies installed #2

Open prescod opened 9 months ago

prescod commented 9 months ago
pip 23.3.1 from /private/tmp/mamba-chat/venv/lib/python3.11/site-packages/pip (python 3.11)

% pip install causal-conv1d
Collecting causal-conv1d
  Using cached causal_conv1d-1.0.0.tar.gz (6.4 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/private/tmp/mamba-chat/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/private/tmp/mamba-chat/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/tmp/mamba-chat/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/5l/v33xmdnn2sx5lb2xpff6v4t40000gn/T/pip-build-env-gk93e613/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/5l/v33xmdnn2sx5lb2xpff6v4t40000gn/T/pip-build-env-gk93e613/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/5l/v33xmdnn2sx5lb2xpff6v4t40000gn/T/pip-build-env-gk93e613/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/private/var/folders/5l/v33xmdnn2sx5lb2xpff6v4t40000gn/T/pip-build-env-gk93e613/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 8, in <module>
      ModuleNotFoundError: No module named 'packaging'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
havietisov commented 9 months ago

Same error on windows, btw, despite "packaging" being successfully installed

marcusze commented 9 months ago

same here..

havietisov commented 9 months ago

Sounds like I know what's the issue : you need to install setuptools and buildtools, and then you can install it

havietisov commented 9 months ago

made a merge request with a fix

prescod commented 9 months ago

I am skeptical about that pull request. It changes line 258 of setup.py, but the crash happens when Python tries to run lines 8, 11 and 18.

Instead, I made a pyproject.toml with this content:

[build-system]
requires = ["packaging", "torch", "setuptools", "wheel"]

This seems to install the four requirements before running setup.py.

havietisov commented 9 months ago

I can't see .toml project files in the original repo, so I just asked for a pull request with minimal changes. lets you install this at least from source. I also have no experience with .toml. If you have ideas for improvements, I guess you're free to create pull requests!

danstowell commented 8 months ago

Just to comment that I also had this same problem. I'm on Ubuntu 22.04 using virtualenv. I already have setuptools (from apt). I was able to proceed a bit further by doing a few pip installs... but I'm not fully installed yet.

plasma-vision commented 7 months ago

I was able to resolve this by running $ pip install wheel I think the packaging error is spurious.

ajie220209 commented 6 months ago

听起来我知道问题出在哪里:您需要安装 setuptools 和 buildtools,然后才能安装它

Even though I have setuptools and buildtools installed, I still get an error when I run them.I think setuptools and buildtools are probably not the problem. Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [13 lines of output] C:\Users\cwj.conda\envs\vmunet\Lib\site-packages\causal-conv1d\setup.py:78: UserWarning: causal_conv1d was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/py torch/pytorch, only images whose names contain 'devel' will provide nvcc. warnings.warn( Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\cwj.conda\envs\vmunet\Lib\site-packages\causal-conv1d\setup.py", line 112, in if bare_metal_version >= Version("11.8"): NameError: name 'bare_metal_version' is not defined

  torch.__version__  = 2.1.1+cu118

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

Ley-lele commented 4 months ago

听起来我知道问题出在哪里:您需要安装 setuptools 和 buildtools,然后才能安装它

Even though I have setuptools and buildtools installed, I still get an error when I run them.I think setuptools and buildtools are probably not the problem. Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [13 lines of output] C:\Users\cwj.conda\envs\vmunet\Lib\site-packages\causal-conv1d\setup.py:78: UserWarning: causal_conv1d was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/py torch/pytorch, only images whose names contain 'devel' will provide nvcc. warnings.warn( Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\cwj.conda\envs\vmunet\Lib\site-packages\causal-conv1d\setup.py", line 112, in if bare_metal_version >= Version("11.8"): NameError: name 'bare_metal_version' is not defined

  torch.__version__  = 2.1.1+cu118

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

听起来我知道问题出在哪里:您需要安装 setuptools 和 buildtools,然后才能安装它

Even though I have setuptools and buildtools installed, I still get an error when I run them.I think setuptools and buildtools are probably not the problem. Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [13 lines of output] C:\Users\cwj.conda\envs\vmunet\Lib\site-packages\causal-conv1d\setup.py:78: UserWarning: causal_conv1d was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/py torch/pytorch, only images whose names contain 'devel' will provide nvcc. warnings.warn( Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\cwj.conda\envs\vmunet\Lib\site-packages\causal-conv1d\setup.py", line 112, in if bare_metal_version >= Version("11.8"): NameError: name 'bare_metal_version' is not defined

  torch.__version__  = 2.1.1+cu118

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

I have the same problem with u. Have u sovled it?

ovo-Tim commented 1 month ago

I can only folk the repository and build it locally