-
Notifications
You must be signed in to change notification settings - Fork 959
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
When I run pip install --no-build-isolation -e . #56
Comments
if I try pip install -e . (sam2) PS D:\work\2024\7\sam2> pip install -e . × Getting requirements to build editable did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Getting requirements to build editable did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. |
(sam2) PS D:\work\2024\7\sam2> pip list filelock 3.13.1 cuda 12.4 |
I also encountered the same problem. |
I also met the same error. |
I also encountered the same problem. |
Getting the same error on M2 Air. Can't we use this without cuda? |
stinks |
worked for me: install torch nightly! |
The Win11 platform also encountered the same problem. The CUDA_COME environment variable was also set, but it was useless. How should I install it? |
Have the same issue I have CUDA 12.1 with nightly installed in the main python env |
I have similar issue relating to this, since I run the command "pip install -e . " on ubuntu20.04, the other environment dependences seems downloading well, however the terminal report an error with cuda ==>" running build_ext note: This error originates from a subprocess, and is likely not a problem with pip. |
update my solution: |
my torch version 2.3.1+cu121, Is it impossible to use (something) if CUDA is not installed? |
Have you tried |
I tired it but still got the same error |
Hi @RCLaplace @SJLNNU @kaia-li @Zhui-Meng666 @Zhui-Meng666 @jjun-2020 @Guo1ZY @Eranio-bit @someshfengde , we have recently made the CUDA extension step optional (in https://github.com/facebookresearch/segment-anything-2/pull/155) as a workaround to this problem. You can pull the latest code and reinstall via # run the line below inside the SAM 2 repo
git pull;
pip uninstall -y SAM-2;
rm -f sam2/*.so;
pip install -e ".[demo]" which allows using SAM 2 without CUDA extension (the results should stay the same in most cases, see |
thank you :) |
Obtaining file:///D:/work/2024/7/sam2
Checking if build backend supports build_editable ... done
Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: torch>=2.3.1 in d:\work\env\sam2\lib\site-packages (from SAM-2==1.0) (2.4.0+cu124)
Requirement already satisfied: torchvision>=0.18.1 in d:\work\env\sam2\lib\site-packages (from SAM-2==1.0) (0.19.0+cu124)
Requirement already satisfied: numpy>=1.24.4 in d:\work\env\sam2\lib\site-packages (from SAM-2==1.0) (1.26.3)
Collecting tqdm>=4.66.1 (from SAM-2==1.0)
Using cached tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
Collecting hydra-core>=1.3.2 (from SAM-2==1.0)
Using cached hydra_core-1.3.2-py3-none-any.whl.metadata (5.5 kB)
Collecting iopath>=0.1.10 (from SAM-2==1.0)
Using cached iopath-0.1.10-py3-none-any.whl
Requirement already satisfied: pillow>=9.4.0 in d:\work\env\sam2\lib\site-packages (from SAM-2==1.0) (10.2.0)
Collecting omegaconf<2.4,>=2.2 (from hydra-core>=1.3.2->SAM-2==1.0)
Using cached omegaconf-2.3.0-py3-none-any.whl.metadata (3.9 kB)
Collecting antlr4-python3-runtime==4.9.* (from hydra-core>=1.3.2->SAM-2==1.0)
Using cached antlr4_python3_runtime-4.9.3-py3-none-any.whl
Collecting packaging (from hydra-core>=1.3.2->SAM-2==1.0)
Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Requirement already satisfied: typing-extensions in d:\work\env\sam2\lib\site-packages (from iopath>=0.1.10->SAM-2==1.0) (4.9.0)
Collecting portalocker (from iopath>=0.1.10->SAM-2==1.0)
Using cached portalocker-2.10.1-py3-none-any.whl.metadata (8.5 kB)
Requirement already satisfied: filelock in d:\work\env\sam2\lib\site-packages (from torch>=2.3.1->SAM-2==1.0) (3.13.1)
Requirement already satisfied: sympy in d:\work\env\sam2\lib\site-packages (from torch>=2.3.1->SAM-2==1.0) (1.12)
Requirement already satisfied: networkx in d:\work\env\sam2\lib\site-packages (from torch>=2.3.1->SAM-2==1.0) (3.2.1)
Requirement already satisfied: jinja2 in d:\work\env\sam2\lib\site-packages (from torch>=2.3.1->SAM-2==1.0) (3.1.3)
Requirement already satisfied: fsspec in d:\work\env\sam2\lib\site-packages (from torch>=2.3.1->SAM-2==1.0) (2024.2.0)
Collecting colorama (from tqdm>=4.66.1->SAM-2==1.0)
Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting PyYAML>=5.1.0 (from omegaconf<2.4,>=2.2->hydra-core>=1.3.2->SAM-2==1.0)
Using cached PyYAML-6.0.1-cp310-cp310-win_amd64.whl.metadata (2.1 kB)
Requirement already satisfied: MarkupSafe>=2.0 in d:\work\env\sam2\lib\site-packages (from jinja2->torch>=2.3.1->SAM-2==1.0) (2.1.5)
Collecting pywin32>=226 (from portalocker->iopath>=0.1.10->SAM-2==1.0)
Using cached pywin32-306-cp310-cp310-win_amd64.whl.metadata (6.6 kB)
Requirement already satisfied: mpmath>=0.19 in d:\work\env\sam2\lib\site-packages (from sympy->torch>=2.3.1->SAM-2==1.0) (1.3.0)
Using cached hydra_core-1.3.2-py3-none-any.whl (154 kB)
Using cached tqdm-4.66.4-py3-none-any.whl (78 kB)
Using cached omegaconf-2.3.0-py3-none-any.whl (79 kB)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Using cached packaging-24.1-py3-none-any.whl (53 kB)
Using cached portalocker-2.10.1-py3-none-any.whl (18 kB)
Using cached pywin32-306-cp310-cp310-win_amd64.whl (9.2 MB)
Using cached PyYAML-6.0.1-cp310-cp310-win_amd64.whl (145 kB)
Building wheels for collected packages: SAM-2
Building editable for SAM-2 (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building editable for SAM-2 (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [83 lines of output]
running editable_wheel
creating C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2.egg-info
writing C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2.egg-info\PKG-INFO
writing dependency_links to C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2.egg-info\dependency_links.txt
writing requirements to C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2.egg-info\requires.txt
writing top-level names to C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2.egg-info\top_level.txt
writing manifest file 'C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2.egg-info\SOURCES.txt'
D:\work\Env\sam2\lib\site-packages\torch\utils\cpp_extension.py:495: 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.'))
reading manifest file 'C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2.egg-info\SOURCES.txt'
adding license file 'LICENSE'
adding license file 'LICENSE_cctorch'
writing manifest file 'C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2.egg-info\SOURCES.txt'
creating 'C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2-1.0.dist-info'
D:\work\Env\sam2\lib\site-packages\wheel\bdist_wheel.py:109: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")):
creating C:\Users\v_ztfang\AppData\Local\Temp\pip-wheel-ekzsoghf.tmp-l40w_hdg\SAM_2-1.0.dist-info\WHEEL
running build_py
running build_ext
D:\work\Env\sam2\lib\site-packages\torch\utils\cpp_extension.py:380: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
Traceback (most recent call last):
File "D:\work\Env\sam2\lib\site-packages\setuptools\command\editable_wheel.py", line 156, in run
self._create_wheel_file(bdist_wheel)
File "D:\work\Env\sam2\lib\site-packages\setuptools\command\editable_wheel.py", line 345, in _create_wheel_file
files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
File "D:\work\Env\sam2\lib\site-packages\setuptools\command\editable_wheel.py", line 268, in _run_build_commands
self._run_build_subcommands()
File "D:\work\Env\sam2\lib\site-packages\setuptools\command\editable_wheel.py", line 295, in _run_build_subcommands
self.run_command(name)
File "D:\work\Env\sam2\lib\site-packages\setuptools_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "D:\work\Env\sam2\lib\site-packages\setuptools\dist.py", line 1001, in run_command
super().run_command(command)
File "D:\work\Env\sam2\lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "D:\work\Env\sam2\lib\site-packages\setuptools\command\build_ext.py", line 88, in run
_build_ext.run(self)
File "D:\work\Env\sam2\lib\site-packages\setuptools_distutils\command\build_ext.py", line 345, in run
self.build_extensions()
File "D:\work\Env\sam2\lib\site-packages\torch\utils\cpp_extension.py", line 518, in build_extensions
_check_cuda_version(compiler_name, compiler_version)
File "D:\work\Env\sam2\lib\site-packages\torch\utils\cpp_extension.py", line 397, in _check_cuda_version
cuda_version_str = subprocess.check_output([nvcc, '--version']).strip().decode(*SUBPROCESS_DECODE_ARGS)
File "E:\software\python3.10\lib\subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "E:\software\python3.10\lib\subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "E:\software\python3.10\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "E:\software\python3.10\lib\subprocess.py", line 1456, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
D:\work\Env\sam2\lib\site-packages\setuptools_distutils\dist.py:988: _DebuggingTips: Problem in editable installation.
!!
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building editable for SAM-2
Failed to build SAM-2
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (SAM-2)
The text was updated successfully, but these errors were encountered: