最新版本Git2.39.2.0-64位最新版本详细安装步骤(本地环境配置)

本文详细介绍了如何在Windows上下载Git,包括从Git官网和镜像站点获取安装包,选择合适的版本(setup或portable),以及安装过程中的各个步骤,如安装路径选择、组件配置、编辑器设置、行尾转换选项等。最后,文章还提到了Git安装完成后本地环境的配置,包括添加Git到系统PATH环境变量中以确保能正常运行。

文章目录

一、到Git官网下载所需版本

​二、Git的安装

三、本地环境的配置



一、到[Git官网]下载所需版本,下载慢可以使用Windows镜像下载

https://git-scm.com/downloadshttps://git-scm.com/downloads

CNPM Binaries Mirror (npmmirror.com)https://registry.npmmirror.com/binary.html?path=git-for-windows/

一、到Git官网下载所需版本


        1、我首先选择的是Windows。

        2、git 有两个版本 【steup】设置版本与【portable】便携式版本,我下载是【steup】版本的。
【steup】设置版本:是安装到自己电脑上的版本,可以使用使用右键“git Bash here”或者“git GUI here”。
【portable】便携式版本:git-portable是针对windows版git所设计的一款软件。顾名思义,它就是便携版或移动版的git。你可以选择将它安装在U盘等便携设备上。它不需要安装,也不会在注册表上留下记录。正因为这样,你也无法像桌面版的git那样,使用右键“git Bash here”或者“git GUI here”。

        3、选择版本时需要先确认电脑是多少位操作系统。桌面右键点击“此电脑”,点击“属性”。我下载的是64位版本。即64-bit Git for Windows Setup.


二、Git的安装

1、点击运行已经下载好的.exe文件,根据需要修改安装路径,不修改直接next也可以。

        2、按需要勾选组件,next。 勾选后桌面安装完成时会出现图标!


        3、这个界面是创建开始菜单中的名称,不需要修改,直接点“Next”按钮。总的来看,这步之后列出的4-14步如无特殊需求可以直接默认设置一直Next到Install为止。

 

        4、这个界面是在选择Git文件默认的编辑器,很少用到,默认Vim即可,直接点“Next”按钮进入下一个界面。

        5、这个页面是设置新存储库中初始分支的名称,默认是“master”,如果想修改分支名称,点击第二个选项,在“main”的位置修改即可,这里我选择默认的名称,点击“Next”进入下一个界面。


        6、第一种配置是“仅从Git Bash使用Git”。这是最安全的选择,因为您的PATH根本不会被修改。你只能使用 Git Bash 的 Git 命令行工具。但是这将不能通过第三方软件使用。

        第二种配置是“从命令行以及第三方软件进行Git”。该选项被认为是安全的,因为它仅向PATH添加了一些最小的Git包装器,以避免使用可选的Unix工具造成环境混乱。你将能够从Git Bash,命令提示符和Windows PowerShell以及在PATH中寻找Git的任何第三方软件中使用Git。这也是推荐的选项。

        第三种配置是“从命令提示符使用Git和可选的Unix工具”。警告:这将覆盖Windows工具,如 “ find 和 sort ”。只有在了解其含义后才使用此选项。

推荐使用默认配置,点击“Next”按钮进入下一个安装界面。

         7、选择OpenSSL library可执行文件,没有可以不选.

         8、选择HTTPS后端传输。第一个选项是“使用 OpenSSL 库”。服务器证书将使用ca-bundle.crt文件进行验证。这也是我们常用的选项。
第二个选项是“使用本地 Windows 安全通道库”。服务器证书将使用Windows证书存储验证。此选项还允许您使用公司的内部根CA证书,例如通过Active Directory Domain Services 。
我使用默认选项,点击“Next”按钮进入下一个界面。

 


        9、配置行尾符号转换。第一个选项是“签出Windows风格,提交Unix风格的行尾”。签出文本文件时,Git会将LF转换为CRLF。提交文本文件时,CRLF将转换为LF。对于跨平台项目,这是Windows上的推荐设置(“ core.autocrlf”设置为“ true”)
        第二个选项是“按原样签出,提交Unix样式的行尾”。签出文本文件时,Git不会执行任何转换。 提交文本文件时,CRLF将转换为LF。对于跨平台项目,这是Unix上的建议设置(“ core.autocrlf”设置为“ input”)
        第三种选项是“按原样签出,按原样提交”。当签出或提交文本文件时,Git不会执行任何转换。不建议跨平台项目选择此选项(“core.autocrlf”设置为“ false”)
我选择默认第一种选项,点击“Next”按钮到下一个安装界面。

        10、配置用于Git Bash的终端模拟器。
        第一个选项是“使用MinTTY(MSYS2的默认终端)”。Git Bash将使用MinTTY作为终端模拟器,该模拟器具有可调整大小的窗口,非矩形选择和Unicode字体。Windows控制台程序(例如交互式Python)必须通过“ winpty”启动才能在MinTTY中运行。
        第二个选项是“使用Windows的默认控制台窗口”。Git将使用Windows的默认控制台窗口(“cmd.exe”),该窗口可以与Win32控制台程序(如交互式Python或node.js)一起使用,但默认的回滚非常有限,需要配置为使用unicode 字体以正确显示非ASCII字符,并且在Windows 10之前,其窗口不能自由调整大小,并且只允许矩形文本选择。
我选择默认的第一种选项,点击“Next”按钮进入下一个安装界面。


        11、选择git pull的默认行为。
第一个选项:默认值(快进或合并)
这是“git pull”的标准行为:尽可能将当前分支快速转发到获取的分支,否则创建合并提交
第二个选项:复位
将当前分支复位到获取的分支上。如果没有要重新设置基础的本地提交,这相当于快进。
第三个选项:只有快进
快进到获取的分支。如果不能获取,则失败。
我选择默认的第一种选项,点击“Next”按钮进入下一个安装界面。

        12、配置凭证管理器。
配置凭证管理器
第一个选择项:Git凭证管理器
第一个选择项:无,不要使用凭证管理器
我选择默认的第一种选项,点击“Next”按钮进入下一个安装界面。


        13、配置额外选项。
第一个选项:“启用文件系统缓存”。文件系统数据将被批量读取并缓存在内存中用于某些操作(“core.fscache”设置为“true”)。 这提供了显著的性能提升。
第二个选项:“启用符号链接”。启用符号链接(需要SeCreateSymbolicLink权限)。请注意,现有存储库不受此设置的影响。
我选择默认的第一种选项,点击“Next”按钮进入下一个安装界面。

        14、配置实验性选项。
        第一个选项:启用对伪控制台的实验性支持。
(新增!)这允许在git bash窗口中运行Node或Python之类的本机控制台程序,而无需使用winpty,但它仍然存在已知的bug。
        第二个选项:启用实验性内置文件系统监视器
(新增!)自动运行内置的文件系统监视程序,以加速包含许多文件的工作树中的常见操作,如“git status”、“git add”、“git commit”等。
这是实验性功能,一般用不到,可不勾选,建议不用开启。直接点Install即可。

        15、安装完成。点击Finish即可。


        16、开始菜单中看到Git的三个启动图标(Git Bash、Git CMD(Deprecated)、Git GUI)。

 


三、本地环境的配置


        1、选择我的电脑,右键选择属性,选择高级系统设置
        2、选择环境变量

在这里插入图片描述

        3、编辑Path变量

在这里插入图片描述
任意位置打开git Bash Here,输入where git(查找git安装路径)

 


去安装路径找到这个文件位置,添加到变量中,我的是C:\Program Files\Git\bin

 

    4、cmd输入:git -v查看是否安装成功;出现如下响应版本号说明环境变量配置成功了

mc.lcx@raspberrypi:~ $ sudo apt update && sudo apt upgrade -y sudo apt install -y build-essential cmake git libjpeg-dev libv4l-dev libyaml-dev Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done 5 packages can be upgraded. Run &#39;apt list --upgradable&#39; to see them. W: http://raspbian.raspberrypi.org/raspbian/dists/bullseye/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. N: Skipping acquire of configured file &#39;main/binary-arm64/Packages&#39; as repository &#39;http://raspbian.raspberrypi.org/raspbian bullseye InRelease&#39; doesn&#39;t support architecture &#39;arm64&#39; N: Skipping acquire of configured file &#39;contrib/binary-arm64/Packages&#39; as repository &#39;http://raspbian.raspberrypi.org/raspbian bullseye InRelease&#39; doesn&#39;t support architecture &#39;arm64&#39; N: Skipping acquire of configured file &#39;non-free/binary-arm64/Packages&#39; as repository &#39;http://raspbian.raspberrypi.org/raspbian bullseye InRelease&#39; doesn&#39;t support architecture &#39;arm64&#39; N: Skipping acquire of configured file &#39;rpi/binary-arm64/Packages&#39; as repository &#39;http://raspbian.raspberrypi.org/raspbian bullseye InRelease&#39; doesn&#39;t support architecture &#39;arm64&#39; Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: gtk2-engines-pixbuf libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libjim0.81 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 4,637 kB of archives. After this operation, 942 kB disk space will be freed. Get:1 http://archive.raspberrypi.org/debian bullseye/main arm64 gtk2-engines-pixbuf arm64 2.24.33-2+rpt2+deb11u1 [61.9 kB] Get:2 http://archive.raspberrypi.org/debian bullseye/main arm64 libgtk2.0-common all 2.24.33-2+rpt2+deb11u1 [2,700 kB] Get:3 http://archive.raspberrypi.org/debian bullseye/main arm64 libgtk2.0-bin arm64 2.24.33-2+rpt2+deb11u1 [50.9 kB] Get:4 http://archive.raspberrypi.org/debian bullseye/main arm64 libgtk2.0-0 arm64 2.24.33-2+rpt2+deb11u1 [1,708 kB] Get:5 http://archive.raspberrypi.org/debian bullseye/main arm64 libjim0.81 arm64 0.81+dfsg0-2 [116 kB] Fetched 4,637 kB in 8s (602 kB/s) Traceback (most recent call last): File "/usr/bin/apt-listchanges", line 29, in <module> import apt_pkg ModuleNotFoundError: No module named &#39;apt_pkg&#39; (Reading database ... 148072 files and directories currently installed.) Preparing to unpack .../gtk2-engines-pixbuf_2.24.33-2+rpt2+deb11u1_arm64.deb ... Unpacking gtk2-engines-pixbuf:arm64 (2.24.33-2+rpt2+deb11u1) over (2.24.33-2+rpt 1+deb12u1) ... Preparing to unpack .../libgtk2.0-common_2.24.33-2+rpt2+deb11u1_all.deb ... Unpacking libgtk2.0-common (2.24.33-2+rpt2+deb11u1) over (2.24.33-2+rpt1+deb12u1 ) ... Preparing to unpack .../libgtk2.0-bin_2.24.33-2+rpt2+deb11u1_arm64.deb ... Unpacking libgtk2.0-bin (2.24.33-2+rpt2+deb11u1) over (2.24.33-2+rpt1+deb12u1) . .. Preparing to unpack .../libgtk2.0-0_2.24.33-2+rpt2+deb11u1_arm64.deb ... Unpacking libgtk2.0-0:arm64 (2.24.33-2+rpt2+deb11u1) over (2.24.33-2+rpt1+deb12u 1) ... Preparing to unpack .../libjim0.81_0.81+dfsg0-2_arm64.deb ... Unpacking libjim0.81:arm64 (0.81+dfsg0-2) over (0.81+dfsg0-2) ... Setting up gtk2-engines-pixbuf:arm64 (2.24.33-2+rpt2+deb11u1) ... Setting up libgtk2.0-common (2.24.33-2+rpt2+deb11u1) ... Setting up libjim0.81:arm64 (0.81+dfsg0-2) ... Setting up libgtk2.0-0:arm64 (2.24.33-2+rpt2+deb11u1) ... Setting up libgtk2.0-bin (2.24.33-2+rpt2+deb11u1) ... Processing triggers for man-db (2.11.2-2) ... Processing triggers for libc-bin (2.36-9+rpt2+deb12u12) ... Reading package lists... Done Building dependency tree... Done Reading state information... Done build-essential is already the newest version (12.9). git is already the newest version (1:2.39.5-0+deb12u2). Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: cmake : Depends: libjsoncpp24 (>= 1.9.4) but it is not installable Depends: librhash0 (>= 1.2.6) but it is not installable Depends: libuv1 (>= 1.11.0) but it is not installable libjpeg62-turbo:armhf : Depends: libc6:armhf (>= 2.7) but it is not installable libjpeg62-turbo-dev:armhf : Depends: libc-dev:armhf libv4l-0:armhf : Depends: libc6:armhf (>= 2.27) but it is not installable libv4l2rds0:armhf : Depends: libc6:armhf (>= 2.4) but it is not installable libv4lconvert0:armhf : Depends: libc6:armhf (>= 2.27) but it is not installable libyaml-0-2:armhf : Depends: libc6:armhf (>= 2.4) but it is not installable E: Unable to correct problems, you have held broken packages.
06-25
wsl: 检测到 localhost 代理配置,但未镜像到 WSL。NAT 模式下的 WSL 不支持 localhost 代理。 (base) os01@DESKTOP-F3AFPI2:~$ sudo apt update && sudo apt upgrade -y sudo apt install -y build-essential git wget curl vim tmux htop -bash: syntax error near unexpected token `;&&#39; [sudo] password for os01: Reading package lists... Done Building dependency tree... Done Reading state information... Done build-essential is already the newest version (12.10ubuntu1). wget is already the newest version (1.21.4-1ubuntu4.1). wget set to manually installed. curl is already the newest version (8.5.0-2ubuntu10.6). curl set to manually installed. tmux is already the newest version (3.4-1ubuntu0.1). tmux set to manually installed. The following packages were automatically installed and are no longer required: libdrm-nouveau2 libdrm-radeon1 libgl1-amber-dri libglapi-mesa libxcb-dri2-0 Use &#39;sudo apt autoremove&#39; to remove them. The following additional packages will be installed: git-man libnl-genl-3-200 vim-common vim-runtime vim-tiny xxd Suggested packages: git-daemon-run | git-daemon-sysvinit git-doc git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn lm-sensors strace ctags vim-doc vim-scripts indent The following NEW packages will be installed: htop libnl-genl-3-200 The following packages will be upgraded: git git-man vim vim-common vim-runtime vim-tiny xxd 7 upgraded, 2 newly installed, 0 to remove and 168 not upgraded. Need to get 15.2 MB/15.4 MB of archives. After this operation, 496 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 vim amd64 2:9.1.0016-1ubuntu7.9 [1881 kB] Get:2 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 vim-common all 2:9.1.0016-1ubuntu7.9 [386 kB] Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 vim-tiny amd64 2:9.1.0016-1ubuntu7.9 [803 kB] Get:4 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 vim-runtime all 2:9.1.0016-1ubuntu7.9 [7281 kB] Get:5 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 xxd amd64 2:9.1.0016-1ubuntu7.9 [63.8 kB] Get:6 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 git-man all 1:2.43.0-1ubuntu7.3 [1100 kB] Get:7 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 git amd64 1:2.43.0-1ubuntu7.3 [3680 kB] Get:8 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libnl-genl-3-200 amd64 3.7.0-0.3build1.1 [12.2 kB] Fetched 15.2 MB in 7s (2121 kB/s) (Reading database ... 55810 files and directories currently installed.) Preparing to unpack .../0-vim_2%3a9.1.0016-1ubuntu7.9_amd64.deb ... Unpacking vim (2:9.1.0016-1ubuntu7.9) over (2:9.1.0016-1ubuntu7.5) ... Preparing to unpack .../1-vim-common_2%3a9.1.0016-1ubuntu7.9_all.deb ... Unpacking vim-common (2:9.1.0016-1ubuntu7.9) over (2:9.1.0016-1ubuntu7.5) ... Preparing to unpack .../2-vim-tiny_2%3a9.1.0016-1ubuntu7.9_amd64.deb ... Unpacking vim-tiny (2:9.1.0016-1ubuntu7.9) over (2:9.1.0016-1ubuntu7.5) ... Preparing to unpack .../3-vim-runtime_2%3a9.1.0016-1ubuntu7.9_all.deb ... Unpacking vim-runtime (2:9.1.0016-1ubuntu7.9) over (2:9.1.0016-1ubuntu7.5) ... Preparing to unpack .../4-xxd_2%3a9.1.0016-1ubuntu7.9_amd64.deb ... Unpacking xxd (2:9.1.0016-1ubuntu7.9) over (2:9.1.0016-1ubuntu7.5) ... Preparing to unpack .../5-git-man_1%3a2.43.0-1ubuntu7.3_all.deb ... Unpacking git-man (1:2.43.0-1ubuntu7.3) over (1:2.43.0-1ubuntu7.1) ... Preparing to unpack .../6-git_1%3a2.43.0-1ubuntu7.3_amd64.deb ... Unpacking git (1:2.43.0-1ubuntu7.3) over (1:2.43.0-1ubuntu7.1) ... Selecting previously unselected package libnl-genl-3-200:amd64. Preparing to unpack .../7-libnl-genl-3-200_3.7.0-0.3build1.1_amd64.deb ... Unpacking libnl-genl-3-200:amd64 (3.7.0-0.3build1.1) ... Selecting previously unselected package htop. Preparing to unpack .../8-htop_3.3.0-4build1_amd64.deb ... Unpacking htop (3.3.0-4build1) ... Setting up xxd (2:9.1.0016-1ubuntu7.9) ... Setting up vim-common (2:9.1.0016-1ubuntu7.9) ... Setting up libnl-genl-3-200:amd64 (3.7.0-0.3build1.1) ... Setting up git-man (1:2.43.0-1ubuntu7.3) ... Setting up vim-runtime (2:9.1.0016-1ubuntu7.9) ... Setting up vim (2:9.1.0016-1ubuntu7.9) ... Setting up htop (3.3.0-4build1) ... Setting up vim-tiny (2:9.1.0016-1ubuntu7.9) ... Setting up git (1:2.43.0-1ubuntu7.3) ... Processing triggers for libc-bin (2.39-0ubuntu8.6) ... Processing triggers for man-db (2.12.0-4build2) ... Processing triggers for hicolor-icon-theme (0.17-2) ... (base) os01@DESKTOP-F3AFPI2:~$ # 安装NVIDIA容器工具包 distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt update && sudo apt install -y nvidia-docker2 # 验证CUDA可用性 nvidia-smi # 应显示与Windows主机相同的GPU信息 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). gpg: no valid OpenPGP data found. # Unsupported distribution! # Check https://nvidia.github.io/nvidia-docker -bash: syntax error near unexpected token `;&&#39; Sat Oct 11 15:45:43 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 580.82.10 Driver Version: 581.29 CUDA Version: 13.0 | +-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 5090 On | 00000000:01:00.0 On | N/A | | 0% 43C P0 73W / 600W | 1244MiB / 32607MiB | 2% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ (base) os01@DESKTOP-F3AFPI2:~$ git clone https://gitcode.com/GitHub_Trending/op/Open-Sora-Plan.git cd Open-Sora-Plan git checkout mindspeed_mmdit # 切换到最新NPU支持分支 fatal: destination path &#39;Open-Sora-Plan&#39; already exists and is not an empty directory. Already on &#39;mindspeed_mmdit&#39; Your branch is up to date with &#39;origin/mindspeed_mmdit&#39;. (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ # 使用conda管理环境(推荐) wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_23.11.0-2-Linux-x86_64.sh bash Miniconda3-py38_23.11.0-2-Linux-x86_64.sh -b -p $HOME/miniconda3 source $HOME/miniconda3/bin/activate conda env create -f environment.yml conda activate open-sora # 验证Python版本和CUDA支持 python -c "import torch; print(&#39;CUDA可用:&#39;, torch.cuda.is_available())" # 应返回True --2025-10-11 15:46:07-- https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_23.11.0-2-Linux-x86_64.sh Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2 Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 131844786 (126M) [application/octet-stream] Saving to: ‘Miniconda3-py38_23.11.0-2-Linux-x86_64.sh.1’ Miniconda3-py38_23.11.0-2-Lin 100%[=================================================>] 125.74M 39.6MB/s in 3.3s 2025-10-11 15:46:11 (37.8 MB/s) - ‘Miniconda3-py38_23.11.0-2-Linux-x86_64.sh.1’ saved [131844786/131844786] ERROR: File or directory already exists: &#39;/home/os01/miniconda3&#39; If you want to update an existing installation, use the -u option. EnvironmentFileNotFound: &#39;/home/os01/Open-Sora-Plan/environment.yml&#39; file not found EnvironmentNameNotFound: Could not find conda environment: open-sora You can list all discoverable environments with `conda info --envs`. CUDA可用: True (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ # 配置pip国内源 pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # 手动安装特定版本依赖 pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 pip install xformers==0.0.22.post7 accelerate==0.34.0 deepspeed==0.12.6 Writing to /home/os01/.config/pip/pip.conf Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://download.pytorch.org/whl/cu118 Requirement already satisfied: torch==2.1.0+cu118 in /home/os01/miniconda3/lib/python3.8/site-packages (2.1.0+cu118) Requirement already satisfied: torchvision==0.16.0+cu118 in /home/os01/miniconda3/lib/python3.8/site-packages (0.16.0+cu118) Requirement already satisfied: filelock in /home/os01/miniconda3/lib/python3.8/site-packages (from torch==2.1.0+cu118) (3.16.1) Requirement already satisfied: typing-extensions in /home/os01/miniconda3/lib/python3.8/site-packages (from torch==2.1.0+cu118) (4.13.2) Requirement already satisfied: sympy in /home/os01/miniconda3/lib/python3.8/site-packages (from torch==2.1.0+cu118) (1.13.3) Requirement already satisfied: networkx in /home/os01/miniconda3/lib/python3.8/site-packages (from torch==2.1.0+cu118) (3.1) Requirement already satisfied: jinja2 in /home/os01/miniconda3/lib/python3.8/site-packages (from torch==2.1.0+cu118) (3.1.6) Requirement already satisfied: fsspec in /home/os01/miniconda3/lib/python3.8/site-packages (from torch==2.1.0+cu118) (2025.3.0) Requirement already satisfied: triton==2.1.0 in /home/os01/miniconda3/lib/python3.8/site-packages (from torch==2.1.0+cu118) (2.1.0) Requirement already satisfied: numpy in /home/os01/miniconda3/lib/python3.8/site-packages (from torchvision==0.16.0+cu118) (1.24.4) Requirement already satisfied: requests in /home/os01/miniconda3/lib/python3.8/site-packages (from torchvision==0.16.0+cu118) (2.31.0) Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /home/os01/miniconda3/lib/python3.8/site-packages (from torchvision==0.16.0+cu118) (10.4.0) Requirement already satisfied: MarkupSafe>=2.0 in /home/os01/miniconda3/lib/python3.8/site-packages (from jinja2->torch==2.1.0+cu118) (2.1.5) Requirement already satisfied: charset-normalizer<4,>=2 in /home/os01/miniconda3/lib/python3.8/site-packages (from requests->torchvision==0.16.0+cu118) (2.0.4) Requirement already satisfied: idna<4,>=2.5 in /home/os01/miniconda3/lib/python3.8/site-packages (from requests->torchvision==0.16.0+cu118) (3.4) Requirement already satisfied: urllib3<3,>=1.21.1 in /home/os01/miniconda3/lib/python3.8/site-packages (from requests->torchvision==0.16.0+cu118) (1.26.18) Requirement already satisfied: certifi>=2017.4.17 in /home/os01/miniconda3/lib/python3.8/site-packages (from requests->torchvision==0.16.0+cu118) (2023.11.17) Requirement already satisfied: mpmath<1.4,>=1.1.0 in /home/os01/miniconda3/lib/python3.8/site-packages (from sympy->torch==2.1.0+cu118) (1.3.0) Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting xformers==0.0.22.post7 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/56/5f/20481c8ccfbd2ac0f936908c9b0ff3e31380d8d186d7dabf34a941b3127f/xformers-0.0.22.post7-cp38-cp38-manylinux2014_x86_64.whl (211.8 MB) Collecting accelerate==0.34.0 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/02/0e/626f2dd4325f4545fbaaf9c590390d2d4ab8e7551579346fe1e319bd93af/accelerate-0.34.0-py3-none-any.whl (324 kB) Collecting deepspeed==0.12.6 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/ff/0fba0fec90e7de1c7148b0527e8ac9cdf2280d274ed135bcb2187f7497a7/deepspeed-0.12.6.tar.gz (1.2 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [16 lines of output] Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/tmp/pip-install-3za_tc1r/deepspeed_40a9c88a17284f49b38ee0bcb816fee1/setup.py", line 100, in <module> cuda_major_ver, cuda_minor_ver = installed_cuda_version() File "/tmp/pip-install-3za_tc1r/deepspeed_40a9c88a17284f49b38ee0bcb816fee1/op_builder/builder.py", line 52, in installed_cuda_version output = subprocess.check_output([cuda_home + "/bin/nvcc", "-V"], universal_newlines=True) File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 415, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 493, in run with Popen(*popenargs, **kwargs) as process: File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 1720, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: &#39;/usr/local/cuda/bin/nvcc&#39; [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. (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ ls /usr/local/cuda*/bin/nvcc # 检查常见路径 ls: cannot access &#39;/usr/local/cuda*/bin/nvcc&#39;: No such file or directory (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ # 查看已安装驱动 nvidia-smi # 确认最高支持的CUDA版本 # 从官网下载对应版本安装 wget https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run sudo sh cuda_12.2.2_535.104.05_linux.run Sat Oct 11 15:47:57 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 580.82.10 Driver Version: 581.29 CUDA Version: 13.0 | +-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 5090 On | 00000000:01:00.0 On | N/A | | 0% 42C P5 33W / 600W | 1290MiB / 32607MiB | 1% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ --2025-10-11 15:47:57-- https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 23.200.143.149, 23.200.143.133 Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|23.200.143.149|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://developer.download.nvidia.cn/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run [following] --2025-10-11 15:47:57-- https://developer.download.nvidia.cn/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run Resolving developer.download.nvidia.cn (developer.download.nvidia.cn)... 39.173.184.184, 39.173.184.185, 39.173.184.186, ... Connecting to developer.download.nvidia.cn (developer.download.nvidia.cn)|39.173.184.184|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 4344134690 (4.0G) [application/octet-stream] Saving to: ‘cuda_12.2.2_535.104.05_linux.run’ cuda_12.2.2_535.104.05_linux. 100%[=================================================>] 4.04G 43.0MB/s in 97s 2025-10-11 15:49:35 (42.5 MB/s) - ‘cuda_12.2.2_535.104.05_linux.run’ saved [4344134690/4344134690] sh: 1: dkms: not found Installation failed. See log at /var/log/cuda-installer.log for details. (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ nano ~/.bashrc (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ source ~/.bashrc (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ echo $CUDA_HOME # 应显示正确路径 nvcc --version # 应显示版本信息 /usr/local/cuda-11.8 nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Fri_Jan__6_16:45:21_PST_2023 Cuda compilation tools, release 12.0, V12.0.140 Build cuda_12.0.r12.0/compiler.32267302_0 (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ CUDA_HOME=/usr/local/cuda-11.8 pip install deepspeed==0.12.6 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting deepspeed==0.12.6 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/ff/0fba0fec90e7de1c7148b0527e8ac9cdf2280d274ed135bcb2187f7497a7/deepspeed-0.12.6.tar.gz (1.2 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [16 lines of output] Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/tmp/pip-install-lu7o1st4/deepspeed_fb52507ecf3c4a568c73c1bf64c6c15a/setup.py", line 100, in <module> cuda_major_ver, cuda_minor_ver = installed_cuda_version() File "/tmp/pip-install-lu7o1st4/deepspeed_fb52507ecf3c4a568c73c1bf64c6c15a/op_builder/builder.py", line 52, in installed_cuda_version output = subprocess.check_output([cuda_home + "/bin/nvcc", "-V"], universal_newlines=True) File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 415, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 493, in run with Popen(*popenargs, **kwargs) as process: File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 1720, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: &#39;/usr/local/cuda-11.8/bin/nvcc&#39; [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. (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ sudo ln -s /usr/local/cuda-11.8 /usr/local/cuda (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ CUDA_HOME=/usr/local/cuda-11.8 pip install deepspeed==0.12.6 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting deepspeed==0.12.6 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/ff/0fba0fec90e7de1c7148b0527e8ac9cdf2280d274ed135bcb2187f7497a7/deepspeed-0.12.6.tar.gz (1.2 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [16 lines of output] Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/tmp/pip-install-2g8bc64o/deepspeed_72185470bf214f78966e52dbacfb643d/setup.py", line 100, in <module> cuda_major_ver, cuda_minor_ver = installed_cuda_version() File "/tmp/pip-install-2g8bc64o/deepspeed_72185470bf214f78966e52dbacfb643d/op_builder/builder.py", line 52, in installed_cuda_version output = subprocess.check_output([cuda_home + "/bin/nvcc", "-V"], universal_newlines=True) File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 415, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 493, in run with Popen(*popenargs, **kwargs) as process: File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 1720, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: &#39;/usr/local/cuda-11.8/bin/nvcc&#39; [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. (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ sudo chmod -R 755 /usr/local/cuda-11.8/bin chmod: cannot access &#39;/usr/local/cuda-11.8/bin&#39;: No such file or directory (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ python -c "import deepspeed; print(deepspeed.__version__)" # 应输出 0.12.6 Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named &#39;deepspeed&#39; (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ sudo apt install build-essential # 确保编译工具链完整 Reading package lists... Done Building dependency tree... Done Reading state information... Done build-essential is already the newest version (12.10ubuntu1). The following packages were automatically installed and are no longer required: libdrm-nouveau2 libdrm-radeon1 libgl1-amber-dri libglapi-mesa libxcb-dri2-0 Use &#39;sudo apt autoremove&#39; to remove them. 0 upgraded, 0 newly installed, 0 to remove and 168 not upgraded. (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ source ~/.bashrc (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ echo $CUDA_HOME # 应显示正确路径 nvcc --version # 应显示版本信息 /usr/local/cuda-11.8 nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Fri_Jan__6_16:45:21_PST_2023 Cuda compilation tools, release 12.0, V12.0.140 Build cuda_12.0.r12.0/compiler.32267302_0 (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ sudo ln -s /usr/local/cuda-11.8 /usr/local/cuda ln: failed to create symbolic link &#39;/usr/local/cuda&#39;: File exists (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ CUDA_HOME=/usr/local/cuda-11.8 pip install deepspeed==0.12.6 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting deepspeed==0.12.6 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/ff/0fba0fec90e7de1c7148b0527e8ac9cdf2280d274ed135bcb2187f7497a7/deepspeed-0.12.6.tar.gz (1.2 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [16 lines of output] Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/tmp/pip-install-opz3tmcr/deepspeed_cadb668f897d483785a78637c4e1c468/setup.py", line 100, in <module> cuda_major_ver, cuda_minor_ver = installed_cuda_version() File "/tmp/pip-install-opz3tmcr/deepspeed_cadb668f897d483785a78637c4e1c468/op_builder/builder.py", line 52, in installed_cuda_version output = subprocess.check_output([cuda_home + "/bin/nvcc", "-V"], universal_newlines=True) File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 415, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 493, in run with Popen(*popenargs, **kwargs) as process: File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 1720, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: &#39;/usr/local/cuda-11.8/bin/nvcc&#39; [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. (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ ls -ld /usr/local/cuda lrwxrwxrwx 1 root root 20 Oct 11 15:54 /usr/local/cuda -> /usr/local/cuda-11.8 (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ # 删除旧链接 sudo rm /usr/local/cuda # 创建新链接(替换为你的实际路径) sudo ln -s /usr/local/cuda-11.8 /usr/local/cuda (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ # 删除旧链接 sudo rm /usr/local/cuda # 创建新链接(替换为你的实际路径) sudo ln -s /usr/local/cuda-11.8 /usr/local/cuda (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ ls -l /usr/local | grep cuda lrwxrwxrwx 1 root root 20 Oct 11 15:58 cuda -> /usr/local/cuda-11.8 drwxr-xr-x 6 root root 4096 Oct 11 15:51 cuda-12.2 (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ sudo ldconfig # 更新动态链接库缓存 source ~/.bashrc # 重新加载环境变量 (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ CUDA_HOME=/usr/local/cuda-11.8 pip install deepspeed==0.12.6 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting deepspeed==0.12.6 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/ff/0fba0fec90e7de1c7148b0527e8ac9cdf2280d274ed135bcb2187f7497a7/deepspeed-0.12.6.tar.gz (1.2 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [16 lines of output] Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/tmp/pip-install-d0r06ic8/deepspeed_c32c366c992d4568813fd9a585158b8c/setup.py", line 100, in <module> cuda_major_ver, cuda_minor_ver = installed_cuda_version() File "/tmp/pip-install-d0r06ic8/deepspeed_c32c366c992d4568813fd9a585158b8c/op_builder/builder.py", line 52, in installed_cuda_version output = subprocess.check_output([cuda_home + "/bin/nvcc", "-V"], universal_newlines=True) File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 415, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 493, in run with Popen(*popenargs, **kwargs) as process: File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/home/os01/miniconda3/lib/python3.8/subprocess.py", line 1720, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: &#39;/usr/local/cuda-11.8/bin/nvcc&#39; [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. (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$ sudo chmod -R 755 /usr/local/cuda-11.8/bin chmod: cannot access &#39;/usr/local/cuda-11.8/bin&#39;: No such file or directory (base) os01@DESKTOP-F3AFPI2:~/Open-Sora-Plan$
10-12
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

前台全能技师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值