Building vs solution in command line

本文介绍了一个用于Microsoft Visual Studio 2010项目的构建脚本,该脚本能够通过调用vcvarsall.bat设置环境并使用msbuild进行Debug和Release配置的构建。此外,还提供了一个注册表文件,用于在资源管理器中直接右键打开或构建项目。
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

msbuild "%1" /p:Configuration=Release

pause

 

解压到目录,然后运行.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell]

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\buildDebug]
@="Build(Debug)"

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\buildDebug\command]
@="\"c:\\vsbuild_debug.bat\" \" %1 \""

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\bulildRelease]
@="Build(Release)"

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\bulildRelease\command]
@="\"c:\\vsbuild_release.bat\" \" %1 \""

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Open]

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Open\Command]
@="\"C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe\" \"%1\""

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.10.0\Shell]

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.10.0\Shell\buildDebug]
@="Build(Debug)"

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.10.0\Shell\buildDebug\command]
@="\"c:\\vsbuild_debug.bat\" \" %1 \""

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.10.0\Shell\bulildRelease]
@="Build(Release)"

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.10.0\Shell\bulildRelease\command]
@="\"c:\\vsbuild_release.bat\" \" %1 \""

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.10.0\Shell\Open]

[HKEY_CLASSES_ROOT\VisualStudio.Launcher.csproj.10.0\Shell\Open\Command]
@="\"C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe\" \"%1\""
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

msbuild "%1" /p:Configuration=Debug

pause

 

转载于:https://www.cnblogs.com/shenfengok/archive/2013/05/31/3109970.html

Windows PowerShell 版权所有(C) Microsoft Corporation。保留所有权利。 安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows (.venv) PS E:\PyCharmObject\emailSingUp\SignUp> python -m venv packaging_env (.venv) PS E:\PyCharmObject\emailSingUp\SignUp> packaging_env\Scripts\activate (packaging_env) PS E:\PyCharmObject\emailSingUp\SignUp> pyinstaller -F -w -i outlook.ico AccountRegisterApp.py 116 INFO: PyInstaller: 6.15.0, contrib hooks: 2025.8 116 INFO: Python: 3.9.13 131 INFO: Platform: Windows-10-10.0.26100-SP0 131 INFO: Python environment: E:\DEMO\python-demo\.venv 131 INFO: wrote E:\PyCharmObject\emailSingUp\SignUp\AccountRegisterApp.spec 131 INFO: Module search paths (PYTHONPATH): ['E:\\DEMO\\python-demo\\.venv\\Scripts\\pyinstaller.exe', 'E:\\Program Files\\Python3.9\\python39.zip', 'E:\\Program Files\\Python3.9\\DLLs', 'E:\\Program Files\\Python3.9\\lib', 'E:\\Program Files\\Python3.9', 'E:\\DEMO\\python-demo\\.venv', 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages', 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\setuptools\\_vendor', 'E:\\PyCharmObject\\emailSingUp\\SignUp'] 380 INFO: checking Analysis 401 INFO: Building because inputs changed 401 INFO: Running Analysis Analysis-00.toc 401 INFO: Target bytecode optimization level: 0 401 INFO: Initializing module dependency graph... 401 INFO: Initializing module graph hook caches... 413 INFO: Analyzing modules for base_library.zip ... 885 INFO: Processing standard module hook 'hook-heapq.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 981 INFO: Processing standard module hook 'hook-encodings.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 1572 INFO: Processing standard module hook 'hook-pickle.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 2079 INFO: Caching module dependency graph... 2098 INFO: Looking for Python shared library... 2106 INFO: Using Python shared library: E:\Program Files\Python3.9\python39.dll 2106 INFO: Analyzing E:\PyCharmObject\emailSingUp\SignUp\AccountRegisterApp.py 2106 INFO: Processing pre-find-module-path hook 'hook-tkinter.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path' 2106 INFO: TclTkInfo: initializing cached Tcl/Tk info... 2248 INFO: Processing standard module hook 'hook-_tkinter.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 2280 INFO: Processing standard module hook 'hook-pandas.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3137 INFO: Processing standard module hook 'hook-_ctypes.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3147 INFO: Processing standard module hook 'hook-platform.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3162 INFO: Processing standard module hook 'hook-sysconfig.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3172 INFO: Processing standard module hook 'hook-numpy.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 3984 INFO: Processing standard module hook 'hook-difflib.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 4064 INFO: Processing standard module hook 'hook-multiprocessing.util.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 4103 INFO: Processing standard module hook 'hook-xml.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 4731 INFO: Processing standard module hook 'hook-charset_normalizer.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 4775 INFO: Processing pre-safe-import-module hook 'hook-typing_extensions.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 4775 INFO: SetuptoolsInfo: initializing cached setuptools info... 7047 INFO: Processing standard module hook 'hook-pytz.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 8229 INFO: Processing standard module hook 'hook-pandas.io.formats.style.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 9298 INFO: Processing standard module hook 'hook-pandas.plotting.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 9580 INFO: Processing standard module hook 'hook-openpyxl.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 9713 INFO: Processing standard module hook 'hook-xml.etree.cElementTree.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 9948 INFO: Processing standard module hook 'hook-PIL.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 9998 INFO: Processing standard module hook 'hook-PIL.Image.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 10309 INFO: Processing standard module hook 'hook-PIL.ImageFilter.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11031 INFO: Processing standard module hook 'hook-sqlite3.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11265 INFO: Processing standard module hook 'hook-pandas.io.clipboard.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11265 INFO: Processing standard module hook 'hook-qtpy.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11334 WARNING: QtLibraryInfo(PyQt5): failed to obtain Qt library info: Child process call to _read_qt_library_info() failed with: File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\qt\__init__.py", line 198, in _read_qt_library_info QtCore = importlib.import_module('.QtCore', package) File "E:\Program Files\Python3.9\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 666, in _load_unlocked File "<frozen importlib._bootstrap>", line 565, in module_from_spec File "<frozen importlib._bootstrap_external>", line 1173, in create_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed ImportError: DLL load failed while importing QtCore: 找不到指定的程序。 A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\qt\__init__.py", line 198, in _read_qt_library_info QtCore = importlib.import_module('.QtCore', package) File "E:\Program Files\Python3.9\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 11562 INFO: hook-qtpy: selected 'PySide2' as the only available Qt bindings. 11563 INFO: Processing pre-safe-import-module hook 'hook-packaging.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 11571 INFO: Processing standard module hook 'hook-PySide2.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 11614 INFO: Processing standard module hook 'hook-PySide2.QtNetwork.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\qt\__init__.py", line 670, in _check_if_openssl_enabled QtCore = importlib.import_module('.QtCore', package) File "E:\Program Files\Python3.9\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 12364 INFO: Processing standard module hook 'hook-PySide2.QtCore.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 12580 INFO: Processing standard module hook 'hook-PySide2.QtDataVisualization.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 13096 INFO: Processing standard module hook 'hook-PySide2.QtGui.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 13798 INFO: Processing standard module hook 'hook-PySide2.QtWidgets.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 100, in <module> while run_next_command(read_fh, write_fh): File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command output = function(*args, **kwargs) File "E:\DEMO\python-demo\.venv\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 337, in _get_module_file_attribute loader = importlib.util.find_spec(package).loader File "E:\Program Files\Python3.9\lib\importlib\util.py", line 94, in find_spec parent = __import__(parent_name, fromlist=['__path__']) File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 107, in <module> _setupQtDirectories() File "E:\DEMO\python-demo\.venv\lib\site-packages\PySide2\__init__.py", line 58, in _setupQtDirectories import shiboken2 File "E:\DEMO\python-demo\.venv\lib\site-packages\shiboken2\__init__.py", line 27, in <module> from .shiboken2 import * 14131 INFO: Processing standard module hook 'hook-dateutil.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\_pyinstaller_hooks_contrib\\stdhooks' 14198 INFO: Processing pre-safe-import-module hook 'hook-six.moves.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module' 14331 INFO: Processing standard module hook 'hook-xml.dom.domreg.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' 14713 INFO: Processing standard module hook 'hook-PyQt5.py' from 'E:\\DEMO\\python-demo\\.venv\\lib\\site-packages\\PyInstaller\\hooks' ERROR: Aborting build process due to attempt to collect multiple Qt bindings packages: attempting to run hook for 'PyQt5', while hook for 'PySide2' has already been run! PyInstaller does not support multiple Qt bindings packages in a frozen application - either ensure that the build environment has only one Qt bindings package installed, or exclude the extraneous bindings packages via the module exclusion mechanism (--exclude command-line option, or excludes list in the spec file). (packaging_env) PS E:\PyCharmObject\emailSingUp\SignUp> 打包后没有生成exe程序
09-06
(Spatial-Mamba) ctuav_shixi@ecm-1b26:~/Spatial-Mamba-main/kernels/dwconv2d$ python3 setup.py install --user A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.1 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "/home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/setup.py", line 2, in <module> from torch.utils import cpp_extension File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/__init__.py", line 1382, in <module> from .functional import * # noqa: F403 File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/functional.py", line 7, in <module> import torch.nn.functional as F File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/nn/__init__.py", line 1, in <module> from .modules import * # noqa: F403 File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/nn/modules/__init__.py", line 35, in <module> from .transformer import TransformerEncoder, TransformerDecoder, \ File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/nn/modules/transformer.py", line 20, in <module> device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'), /home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/nn/modules/transformer.py:20: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at /opt/conda/conda-bld/pytorch_1695392067780/work/torch/csrc/utils/tensor_numpy.cpp:84.) device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'), running install /home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:90: 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() /home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:90: 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. ******************************************************************************** !! self.initialize_options() running bdist_egg running egg_info writing dwconv2d.egg-info/PKG-INFO writing dependency_links to dwconv2d.egg-info/dependency_links.txt writing top-level names to dwconv2d.egg-info/top_level.txt reading manifest file 'dwconv2d.egg-info/SOURCES.txt' writing manifest file 'dwconv2d.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying Dwconv/dwconv_layer.py -> build/lib.linux-x86_64-cpython-310/Dwconv running build_ext /home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/utils/cpp_extension.py:424: UserWarning: There are no g++ version bounds defined for CUDA version 12.1 warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}') building 'dwconv2d' extension Emitting ninja build file /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/build/temp.linux-x86_64-cpython-310/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/1] /usr/local/cuda/bin/nvcc -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/include -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/include/TH -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/include/python3.10 -c -c /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/depthwise_fwd/launch.cu -o /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/build/temp.linux-x86_64-cpython-310/depthwise_fwd/launch.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=dwconv2d -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 -std=c++17 FAILED: /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/build/temp.linux-x86_64-cpython-310/depthwise_fwd/launch.o /usr/local/cuda/bin/nvcc -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/include -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/include/TH -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/include/python3.10 -c -c /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/depthwise_fwd/launch.cu -o /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/build/temp.linux-x86_64-cpython-310/depthwise_fwd/launch.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=dwconv2d -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 -std=c++17 /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/depthwise_fwd/launch.cu(29): error: namespace "at" has no member "NoGradGuard" at::NoGradGuard no_grad; ^ /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/depthwise_fwd/launch.cu(63): error: namespace "at" has no member "NoGradGuard" at::NoGradGuard no_grad; ^ /home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/depthwise_fwd/launch.cu(69): error: namespace "at" has no member "NoGradGuard" at::NoGradGuard no_grad; ^ 3 errors detected in the compilation of "/home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/depthwise_fwd/launch.cu". ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2100, in _run_ninja_build subprocess.run( File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/subprocess.py", line 526, 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 "/home/ctuav_shixi/Spatial-Mamba-main/kernels/dwconv2d/setup.py", line 5, in <module> setup( File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup return distutils.core.setup(**attrs) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands self.run_command(cmd) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/command/install.py", line 109, in run self.do_egg_install() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/command/install.py", line 167, in do_egg_install self.run_command('bdist_egg') File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/command/bdist_egg.py", line 177, in run cmd = self.call_command('install_lib', warn_dir=False) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/command/bdist_egg.py", line 163, in call_command self.run_command(cmdname) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/command/install_lib.py", line 19, in run self.build() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/command/install_lib.py", line 113, in build self.run_command('build_ext') File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command self.distribution.run_command(command) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/dist.py", line 1104, in run_command super().run_command(command) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command cmd_obj.run() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 99, in run _build_ext.run(self) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 368, in run self.build_extensions() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 873, in build_extensions build_ext.build_extensions(self) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 484, in build_extensions self._build_extensions_serial() File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 510, in _build_extensions_serial self.build_extension(ext) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 264, in build_extension _build_ext.build_extension(self, ext) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/Cython/Distutils/build_ext.py", line 136, in build_extension super().build_extension(ext) File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 565, in build_extension objects = self.compiler.compile( File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 686, in unix_wrap_ninja_compile _write_ninja_file_and_compile_objects( File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1774, in _write_ninja_file_and_compile_objects _run_ninja_build( File "/home/ctuav_shixi/anaconda3/envs/Spatial-Mamba/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2116, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error compiling objects for extension安装包的时候报错应该怎么办
05-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值