hustvl / Vim

[ICML 2024] Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model
Apache License 2.0
2.56k stars 160 forks source link

problem about pip install -e causal_conv1d>=1.1.0 #33

Closed xiakela closed 2 months ago

xiakela commented 4 months ago

I try to install causal_conv1d and use the command: pip install -e causal_conv1d>=1.1.0 but have this error: ERROR: causal_conv1d is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).

then I use the command : pip install -e causual-conv1d

but this has another problem: Installing collected packages: causal-conv1d Running setup.py develop for causal-conv1d error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [83 lines of output]

    torch.__version__  = 2.1.1+cu118

    running develop
    /home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
    !!

            ********************************************************************************
            Please avoid running ``setup.py`` and ``easy_install``.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.

            See https://github.com/pypa/setuptools/issues/917 for details.
            ********************************************************************************

    !!
      easy_install.initialize_options(self)
    /home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
    !!

            ********************************************************************************
            Please avoid running ``setup.py`` directly.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.

            See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
            ********************************************************************************

    !!
      self.initialize_options()
    running egg_info
    creating causal_conv1d.egg-info
    writing causal_conv1d.egg-info/PKG-INFO
    writing dependency_links to causal_conv1d.egg-info/dependency_links.txt
    writing requirements to causal_conv1d.egg-info/requires.txt
    writing top-level names to causal_conv1d.egg-info/top_level.txt
    writing manifest file 'causal_conv1d.egg-info/SOURCES.txt'
    reading manifest file 'causal_conv1d.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    adding license file 'AUTHORS'
    writing manifest file 'causal_conv1d.egg-info/SOURCES.txt'
    running build_ext
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/home/wzw/Vim/causal-conv1d/setup.py", line 226, in <module>
        setup(
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
        return distutils.core.setup(**attrs)
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
        return run_commands(dist)
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
        dist.run_commands()
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
        self.run_command(cmd)
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
        super().run_command(command)
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/command/develop.py", line 109, in install_for_development
        self.run_command('build_ext')
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
        self.distribution.run_command(command)
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
        super().run_command(command)
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 88, in run
        _build_ext.run(self)
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
        self.build_extensions()
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 525, in build_extensions
        _check_cuda_version(compiler_name, compiler_version)
      File "/home/wzw/miniconda3/envs/vim/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 413, in _check_cuda_version
        raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
    RuntimeError:
    The detected CUDA version (12.2) mismatches the version that was used to compile
    PyTorch (11.8). Please make sure to use the same CUDA versions.

    [end of output]

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

error: subprocess-exited-with-error

IamShubhamGupto commented 4 months ago

I had the same output by pip causal_conv1d is not a valid editable requirement.

I solved it by

cd causal-conv1d/
pip install -e .

it installed successfully.

In your case it looks like a CUDA version mismatch. Retry the installation with CUDA 11.8

poult-lab commented 3 months ago

I had the same output by pip causal_conv1d is not a valid editable requirement.

I solved it by

cd causal-conv1d/
pip install -e .

it installed successfully.

In your case it looks like a CUDA version mismatch. Retry the installation with CUDA 11.8

hello brother, I had tried your code, still it is not being installed.
Does any one have method to solve this issue?

below is description:

(vim) huawei@huawei-B460MDS3HV2:/media/huawei/93219077-4d31-405d-88e2-323585a4ba3e/effective-ECG-recognition/Vim-main/causal-conv1d$ pip install -e . Obtaining file:///media/huawei/93219077-4d31-405d-88e2-323585a4ba3e/effective-ECG-recognition/Vim-main/causal-conv1d 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] /media/huawei/93219077-4d31-405d-88e2-323585a4ba3e/effective-ECG-recognition/Vim-main/causal-conv1d/setup.py:77: 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/pytorch/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 "/media/huawei/93219077-4d31-405d-88e2-323585a4ba3e/effective-ECG-recognition/Vim-main/causal-conv1d/setup.py", line 111, 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. error: metadata-generation-failed

× 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.

IamShubhamGupto commented 3 months ago

@poult-lab from your error message but nvcc was not found. Are you sure your environment has nvcc available? it means the CUDA driver is not properly installed.

try debugging using

nvcc --version

it should say CUDA 11.8 or whichever version you have installed.

if you did install CUDA, then your PATH, CUDA_HOME and LD_LIBRARY variables are not set properly. you need to update them

poult-lab commented 3 months ago

@poult-lab from your error message but nvcc was not found. Are you sure your environment has nvcc available? it means the CUDA driver is not properly installed.

try debugging using

nvcc --version

it should say CUDA 11.8 or whichever version you have installed.

if you did install CUDA, then your PATH, CUDA_HOME and LD_LIBRARY variables are not set properly. you need to update them

Thank you for your quick reply. That is very valuable. I appreciate.

BmonsterYJ commented 2 months ago

I update CUDA to v11.8 and complete the variable configuration, but still having the same problem—— RuntimeError: Error compiling objects for extension [end of output]

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

IamShubhamGupto commented 2 months ago

I update CUDA to v11.8 and complete the variable configuration, but still having the same problem—— RuntimeError: Error compiling objects for extension [end of output]

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

Refer #53 , checkout causal-conv1d version 1.1.3.post1 and install from source.

BmonsterYJ commented 2 months ago

我将 CUDA 更新到 v11.8 并完成变量配置,但仍然有同样的问题—— RuntimeError:编译扩展对象时出错 [输出结束] 注意:此错误源自子进程,可能不是 pip 的问题。

请参阅 #53 ,签出版本 1.1.3.post1 并从源代码安装。causal-conv1d

Thank you for your reply,but I want to deploy a virtual environment on Windows, maybe it doesn't work in Windows? I also had a problem that say——ERROR: Could not build wheels for causal-conv1d, which is required to install pyproject.toml-based projects

poult-lab commented 2 months ago

我将 CUDA 更新到 v11.8 并完成变量配置,但仍然有同样的问题—— RuntimeError:编译扩展对象时出错 [输出结束] 注意:此错误源自子进程,可能不是 pip 的问题。

请参阅 #53 ,签出版本 1.1.3.post1 并从源代码安装。causal-conv1d

Thank you for your reply,but I want to deploy a virtual environment on Windows, maybe it doesn't work in Windows? I also had a problem that say——ERROR: Could not build wheels for causal-conv1d, which is required to install pyproject.toml-based projects

我没有试过在windows上面做这个,但是我觉得尽量还是在linux上面部署比较好

BmonsterYJ commented 2 months ago

我将 CUDA 更新到 v11.8 并完成变量配置,但仍然有同样的问题—— RuntimeError:编译扩展对象时出错 [输出结束] 注意:此错误源自子进程,可能不是 pip 的问题。

请参阅 #53 ,签出版本 1.1.3.post1 并从源代码安装。causal-conv1d

Thank you for your reply,but I want to deploy a virtual environment on Windows, maybe it doesn't work in Windows? I also had a problem that say——ERROR: Could not build wheels for causal-conv1d, which is required to install pyproject.toml-based projects

我没有试过在windows上面做这个,但是我觉得尽量还是在linux上面部署比较好

okay,thanks for your reply!