Win7x64+python3.8.2+scikit_image+scikitlearn

本文详细介绍如何在Win7x64SP1系统上搭建scikit-learn机器学习环境,包括下载并安装必要的组件如KB2533623更新、Python 3.8.2、以及scikit-learn库的具体步骤。

Win7x64 SP1

 

从下址下载并安装KB2533623

https://download.microsoft.com/download/F/1/0/F106E158-89A1-41E3-A9B5-32FEB2A99A0B/Windows6.1-KB2533623-x64.msu

 

从下址下载并安装python3.8.2-amd64

https://www.python.org/ftp/python/3.8.2/python-3.8.2-amd64.exe

 

从下址下载并安装scikit-learn (用pip install 安装的话需要先安装微软工具集,麻烦得很)

https://files.pythonhosted.org/packages/f9/04/1f6644aeecec1a05c565cb730c3ede0f518cdb5f9b4978e2a1819f531d43/scikit_learn-0.22.2.post1-cp38-cp38-win_amd64.whl

 

用pip install scikit-image安装skimage

这是虚拟环境里的包,如果升级python会报错吗,absl-py 2.3.1 accelerate 1.8.1 airsim 1.8.1 annotated-types 0.7.0 antlr4-python3-runtime 4.9.3 anyio 4.9.0 av 15.0.0 black 25.1.0 blas 1.0 brotlicffi 1.0.9.2 bzip2 1.0.8 ca-certificates 2025.2.25 cairo 1.16.0 cccl 2.3.2 certifi 2025.7.9 cffi 1.17.1 chardet 5.2.0 charset-normalizer 3.4.2 click 8.1.8 cloudpickle 3.1.1 colorama 0.4.6 contourpy 1.3.0 cuda-cccl 12.4.127 cuda-cccl_win-64 12.4.127 cuda-cudart 12.4.127 cuda-cudart-dev 12.4.127 cuda-cudart-dev_win-64 12.4.127 cuda-cudart-static 12.4.127 cuda-cudart-static_win-64 12.4.127 cuda-cudart_win-64 12.4.127 cuda-cupti 12.4.127 cuda-libraries 12.4.1 cuda-libraries-dev 12.4.1 cuda-nvrtc 12.4.127 cuda-nvrtc-dev 12.4.127 cuda-nvtx 12.4.127 cuda-opencl 12.4.127 cuda-opencl-dev 12.4.127 cuda-profiler-api 12.4.127 cuda-runtime 12.4.1 cuda-version 12.4 cycler 0.12.1 cython 3.1.2 dav1d 1.2.1 decord 0.6.0 deprecated 1.2.13 detectron2 0.6 distro 1.9.0 exceptiongroup 1.3.0 expat 2.7.1 ffmpeg 6.1.1 filelock 3.18.0 fontconfig 2.14.1 fonttools 4.58.5 freetype 2.13.3 fsspec 2025.5.1 fuzzywuzzy 0.18.0 fvcore 0.1.5.post20221221 giflib 5.2.2 gmp 6.3.0 gmpy2 2.2.1 graphite2 1.3.14 grpcio 1.73.1 h11 0.16.0 h5py 3.14.0 harfbuzz 10.2.0 hf-transfer 0.1.9 httpcore 1.0.9 httpx 0.28.1 huggingface-hub 0.33.4 hydra-core 1.3.2 icu 73.1 idna 3.10 imageio 2.37.0 imgviz 1.7.6 importlib-metadata 8.7.0 importlib-resources 6.5.2 intel-openmp 2023.1.0 iopath 0.1.9 jinja2 3.1.6 jiter 0.10.0 jpeg 9e khronos-opencl-icd-loader 2024.05.08 kiwisolver 1.4.7 lazy-loader 0.4 lcms2 2.16 lerc 3.0 levenshtein 0.27.1 libabseil 20250127.0 libcublas 12.4.5.8 libcublas-dev 12.4.5.8 libcufft 11.2.1.3 libcufft-dev 11.2.1.3 libcurand 10.3.5.147 libcurand-dev 10.3.5.147 libcusolver 11.6.1.9 libcusolver-dev 11.6.1.9 libcusparse 12.3.1.170 libcusparse-dev 12.3.1.170 libdeflate 1.17 libffi 3.4.4 libglib 2.84.2 libiconv 1.16 libjpeg-turbo 2.0.0 libnpp 12.2.5.30 libnpp-dev 12.2.5.30 libnvfatbin 12.4.127 libnvfatbin-dev 12.4.127 libnvjitlink 12.4.127 libnvjitlink-dev 12.4.127 libnvjpeg 12.3.1.117 libnvjpeg-dev 12.3.1.117 libogg 1.3.5 libpng 1.6.39 libprotobuf 5.29.3 libtheora 1.1.1 libtiff 4.5.1 libtorch 2.5.1 libuv 1.48.0 libwebp 1.3.2 libwebp-base 1.3.2 libxml2 2.13.8 lz4-c 1.9.4 markdown 3.8.2 markupsafe 3.0.2 matplotlib 3.9.4 mkl 2023.1.0 mkl-service 2.4.0 mkl_fft 1.3.11 mkl_random 1.2.8 mpc 1.3.1 mpfr 4.2.1 mpmath 1.3.0 msgpack-python 0.5.6 msgpack-rpc-python 0.4.1 mypy-extensions 1.1.0 networkx 3.2.1 numpy 2.0.2 numpy-base 2.0.2 omegaconf 2.3.0 openai 1.95.1 opencv-contrib-python 4.12.0.88 opencv-python 4.12.0.88 opencv-python-headless 4.12.0.88 openjpeg 2.5.2 openssl 3.0.16 opentelemetry-api 1.30.0 orjson 3.11.0 packaging 25.0 pathspec 0.12.1 pcre2 10.42 pillow 11.3.0 pip 25.1 pixman 0.40.0 platformdirs 4.3.8 portalocker 3.2.0 protobuf 6.31.1 psutil 7.0.0 pycocotools 2.0.10 pycparser 2.21 pydantic 2.11.7 pydantic-core 2.33.2 pyparsing 3.2.3 pyqt5 5.15.11 pyqt5-qt5 5.15.2 pyqt5-sip 12.17.0 pysocks 1.7.1 python 3.9.23 python-dateutil 2.9.0.post0 python-levenshtein 0.27.1 pytorch 2.5.1 pytorch-cuda 12.4 pytorch-mutex 1.0 pywin32 310 pyyaml 6.0.2 qwen-vl-utils 0.0.8 rapidfuzz 3.13.0 regex 2024.11.6 requests 2.32.4 safetensors 0.5.3 scikit-image 0.24.0 scipy 1.13.1 segment-anything 1.0 setuptools 72.1.0 shapely 2.0.7 six 1.17.0 sleef 3.5.1 sniffio 1.3.1 sqlite 3.45.3 submitit 1.5.3 sympy 1.13.1 tabulate 0.9.0 tbb 2021.8.0 tensorboard 2.19.0 tensorboard-data-server 0.7.2 termcolor 3.1.0 tifffile 2024.8.30 timm 1.0.17 tk 8.6.14 tokenizers 0.21.2 tomli 2.2.1 torch 2.7.1 torchaudio 2.5.1 torchvision 0.22.1 tornado 4.5.3 tqdm 4.67.1 transformers 4.53.2 typing-extensions 4.14.1 typing-inspection 0.4.1 typing_extensions 4.12.2 tzdata 2025b ucrt 10.0.22621.0 urllib3 2.5.0 vc 14.3 vc14_runtime 14.44.35208 vs2015_runtime 14.44.35208 werkzeug 3.1.3 wheel 0.45.1 win_inet_pton 1.1.0 wrapt 1.17.0 xz 5.6.4 yacs 0.1.8 yaml 0.2.5 zipp 3.23.0 zlib 1.2.13 zstd 1.5.6
07-18
可是你没有帮我整理那些仓库里的文件啊 它们还在那 “PS C:\Users\Administrator\Desktop> # ===== 修复Pip下载问题 ===== PS C:\Users\Administrator\Desktop> function Repair-PipConfiguration { >> # 重置pip配置文件 >> $configDir = "C:\ProgramData\pip" >> $pipConfig = @" >> [global] >> index-url = https://pypi.tuna.tsinghua.edu.cn/simple >> trusted-host = pypi.tuna.tsinghua.edu.cn >> "@ >> >> $pipConfig | Out-File "$configDir\pip.ini" -Encoding ASCII -Force >> >> # 清除问题环境变量 >> [Environment]::SetEnvironmentVariable("PIP_CACHE_DIR", $null, "Machine") >> [Environment]::SetEnvironmentVariable("PIP_DOWNLOAD_CACHE", $null, "Machine") >> >> Write-Host "✅ Pip配置已重置" -ForegroundColor Green >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 修复网络驱动器映射 ===== PS C:\Users\Administrator\Desktop> function Initialize-NetworkRepository { >> param( >> [string]$NetworkPath = "\\server\pip_repository", >> [string]$LocalMount = "P:" >> ) >> >> # 使用net use代替New-PSDrive >> net use $LocalMount $NetworkPath /persistent:yes >> >> if ($LASTEXITCODE -ne 0) { >> Write-Host "❌ 网络驱动器映射失败" -ForegroundColor Red >> return >> } >> >> # 初始化仓库 >> Initialize-PipRepository -RepositoryPath "${LocalMount}\" >> >> Write-Host "✅ 网络仓库已映射到: ${LocalMount}\" -ForegroundColor Green >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 增强的下载函数 ===== PS C:\Users\Administrator\Desktop> function Install-FromRepository { >> param( >> [Parameter(Mandatory=$true)] >> [string]$PackageName, >> [string]$Version = "latest", >> [string]$RepositoryPath = "E:\ai_pip_repository" >> ) >> >> $downloadedDir = Join-Path $RepositoryPath "downloaded_packages" >> >> # 搜索本地仓库 >> $localPackages = Get-ChildItem -Path $downloadedDir -Recurse -ErrorAction SilentlyContinue | >> Where-Object { $_.Name -like "*$PackageName*" -and $_.Extension -in @(&#39;.whl&#39;, &#39;.gz&#39;, &#39;.zip&#39;) } >> >> if ($localPackages) { >> # 版本选择逻辑 >> if ($Version -eq "latest") { >> $selectedPackage = $localPackages | >> Sort-Object { [regex]::Match($_.Name, &#39;(\d+\.)+\d+&#39;).Value } -Descending | >> Select-Object -First 1 >> } else { >> $selectedPackage = $localPackages | >> Where-Object { $_.Name -match "$PackageName-$Version" } | >> Select-Object -First 1 >> } >> >> if (-not $selectedPackage) { >> Write-Host "⚠️ 仓库中未找到指定版本: $PackageName==$Version" -ForegroundColor Yellow >> return >> } >> >> Write-Host "🚀 使用仓库中的版本: $($selectedPackage.Name)" -ForegroundColor Yellow >> >> # 安装主包 >> python -m pip install $selectedPackage.FullName --no-deps --no-index >> >> # 安装依赖 >> $depReport = Test-RepositoryDependency -PackageName $PackageName -RepositoryPath $RepositoryPath >> if ($depReport.MissingDependencies.Count -gt 0) { >> Write-Host "🔍 安装依赖包..." -ForegroundColor Cyan >> $depReport.MissingDependencies | ForEach-Object { >> Install-FromRepository $_ -RepositoryPath $RepositoryPath >> } >> } >> return >> } >> >> # 本地仓库不存在则下载并保存 >> Write-Host "🌐 从镜像下载: $PackageName" -ForegroundColor Magenta >> >> # 创建临时下载目录 >> $tempDir = Join-Path $env:TEMP ([System.Guid]::NewGuid().ToString()) >> New-Item -ItemType Directory -Path $tempDir -Force | Out-Null >> >> try { >> # 下载包 - 使用临时配置文件 >> $tempConfig = Join-Path $tempDir "pip_temp.conf" >> @" >> [global] >> index-url = https://pypi.tuna.tsinghua.edu.cn/simple >> trusted-host = pypi.tuna.tsinghua.edu.cn >> "@ | Out-File $tempConfig -Encoding ASCII >> >> if ($Version -eq "latest") { >> python -m pip download $PackageName -d $tempDir --config $tempConfig >> } else { >> python -m pip download "${PackageName}==${Version}" -d $tempDir --config $tempConfig >> } >> >> # 获取下载的文件 >> $downloadedFiles = Get-ChildItem $tempDir -File -ErrorAction SilentlyContinue | >> Where-Object { $_.Extension -in @(&#39;.whl&#39;, &#39;.gz&#39;, &#39;.zip&#39;) } >> >> if (-not $downloadedFiles) { >> throw "未找到下载的包文件" >> } >> >> # 安装并保存每个包 >> foreach ($file in $downloadedFiles) { >> # 安装主包 >> python -m pip install $file.FullName --config $tempConfig >> >> # 保存到仓库 >> $savePath = Join-Path $downloadedDir $file.Name >> Copy-Item -Path $file.FullName -Destination $savePath -Force >> Write-Host "💾 已保存到仓库: $($file.Name)" -ForegroundColor Green >> } >> } >> catch { >> Write-Host "❌ 安装失败: $_" -ForegroundColor Red >> } >> finally { >> # 清理临时目录 >> Remove-Item $tempDir -Recurse -Force -ErrorAction SilentlyContinue >> } >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 验证函数 ===== PS C:\Users\Administrator\Desktop> function Test-PipFunctionality { >> # 测试基本功能 >> try { >> $result = python -m pip --version >> Write-Host "✅ Pip功能正常: $result" -ForegroundColor Green >> return $true >> } >> catch { >> Write-Host "❌ Pip功能异常: $_" -ForegroundColor Red >> return $false >> } >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 1. 修复pip配置 PS C:\Users\Administrator\Desktop> Repair-PipConfiguration ✅ Pip配置已重置 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 2. 验证pip功能 PS C:\Users\Administrator\Desktop> if (-not (Test-PipFunctionality)) { >> Write-Host "请先修复pip安装" -ForegroundColor Red >> exit >> } ✅ Pip功能正常: pip 25.2 from E:\Python310\lib\site-packages\pip (python 3.10) PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 3. 初始化仓库(如果需要) PS C:\Users\Administrator\Desktop> Initialize-PipRepository -RepositoryPath "E:\ai_pip_repository" Initialize-PipRepository : 无法将“Initialize-PipRepository”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查 名称的拼写,如果包括路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + Initialize-PipRepository -RepositoryPath "E:\ai_pip_repository" + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Initialize-PipRepository:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 4. 安装包(使用修复后的方法) PS C:\Users\Administrator\Desktop> Install-FromRepository "torch" -Version "2.8.0" 🌐 从镜像下载: torch Usage: E:\Python310\python.exe -m pip download [options] <requirement specifier> [package-index-options] ... E:\Python310\python.exe -m pip download [options] -r <requirements file> [package-index-options] ... E:\Python310\python.exe -m pip download [options] <vcs project url> ... E:\Python310\python.exe -m pip download [options] <local project path> ... E:\Python310\python.exe -m pip download [options] <archive url/path> ... no such option: --config ❌ 安装失败: 未找到下载的包文件 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 5. 更新索引 PS C:\Users\Administrator\Desktop> Update-RepositoryIndex Update-RepositoryIndex : 无法将“Update-RepositoryIndex”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称 的拼写,如果包括路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + Update-RepositoryIndex + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Update-RepositoryIndex:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 6. 检查依赖 PS C:\Users\Administrator\Desktop> Test-RepositoryDependency -PackageName "torch" Test-RepositoryDependency : 无法将“Test-RepositoryDependency”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检 查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + Test-RepositoryDependency -PackageName "torch" + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Test-RepositoryDependency:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator\Desktop> # 1. 映射网络驱动器 PS C:\Users\Administrator\Desktop> Initialize-NetworkRepository -NetworkPath "\\192.168.1.100\pip_repo" -LocalMount "P" 发生系统错误 67。 找不到网络名。 ❌ 网络驱动器映射失败 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 2. 使用网络仓库 PS C:\Users\Administrator\Desktop> Install-FromRepository "numpy" -RepositoryPath "P:\" Join-Path : 找不到驱动器。名为“P”的驱动器不存在。 所在位置 行:9 字符: 22 + $downloadedDir = Join-Path $RepositoryPath "downloaded_packages" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (P:String) [Join-Path], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand 🌐 从镜像下载: numpy Usage: E:\Python310\python.exe -m pip download [options] <requirement specifier> [package-index-options] ... E:\Python310\python.exe -m pip download [options] -r <requirements file> [package-index-options] ... E:\Python310\python.exe -m pip download [options] <vcs project url> ... E:\Python310\python.exe -m pip download [options] <local project path> ... E:\Python310\python.exe -m pip download [options] <archive url/path> ... no such option: --config ❌ 安装失败: 未找到下载的包文件 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 1. 修复Python环境 ===== PS C:\Users\Administrator\Desktop> function Repair-PythonEnvironment { >> param( >> [string]$PythonPath = "E:\Python310" >> ) >> >> # 验证Python安装 >> if (-not (Test-Path $PythonPath)) { >> Write-Host "❌ Python路径不存在: $PythonPath" -ForegroundColor Red >> return $false >> } >> >> # 修复pip安装 >> try { >> Write-Host "🔧 修复pip安装..." -ForegroundColor Cyan >> $requirements = Join-Path $env:TEMP "requirements.txt" >> python -m pip freeze > $requirements >> python -m pip uninstall -y -r $requirements >> python -m ensurepip --upgrade >> python -m pip install --upgrade pip setuptools wheel >> Remove-Item $requirements -Force >> } >> catch { >> Write-Host "❌ pip修复失败: $_" -ForegroundColor Red >> return $false >> } >> >> # 验证修复 >> try { >> $pipVersion = python -m pip --version >> Write-Host "✅ pip已修复: $pipVersion" -ForegroundColor Green >> return $true >> } >> catch { >> Write-Host "❌ pip验证失败" -ForegroundColor Red >> return $false >> } >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 2. 修复.NET SDK安装 ===== PS C:\Users\Administrator\Desktop> function Install-DotNetSDK { >> param( >> [string]$Version = "9.0.109" >> ) >> >> # 清理旧安装 >> Write-Host "🧹 清理旧.NET安装..." -ForegroundColor Cyan >> $dotnetPath = "C:\Program Files\dotnet" >> if (Test-Path $dotnetPath) { >> Remove-Item $dotnetPath -Recurse -Force -ErrorAction SilentlyContinue >> } >> >> # 下载安装程序 >> $installerPath = "$env:TEMP\dotnet-sdk-installer.exe" >> $downloadUrl = "https://download.visualstudio.microsoft.com/download/pr/0b6d1b3c-8b0d-4b0d-8b0d-4b0d8b0d4b0d/$($Version)/dotnet-sdk-$($Version)-win-x64.exe" >> >> try { >> Write-Host "📥 下载.NET SDK $Version..." -ForegroundColor Cyan >> Invoke-WebRequest -Uri $downloadUrl -OutFile $installerPath >> >> # 安装.NET SDK >> Write-Host "⚙️ 安装.NET SDK..." -ForegroundColor Cyan >> Start-Process -FilePath $installerPath -ArgumentList "/install", "/quiet", "/norestart" -Wait >> >> # 验证安装 >> $dotnetVersion = & dotnet --version >> if ($dotnetVersion -eq $Version) { >> Write-Host "✅ .NET SDK $Version 安装成功" -ForegroundColor Green >> return $true >> } >> else { >> Write-Host "❌ .NET SDK 安装验证失败" -ForegroundColor Red >> return $false >> } >> } >> catch { >> Write-Host "❌ .NET SDK 安装失败: $_" -ForegroundColor Red >> return $false >> } >> finally { >> Remove-Item $installerPath -Force -ErrorAction SilentlyContinue >> } >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 3. 增强的pip仓库函数 ===== PS C:\Users\Administrator\Desktop> function Initialize-PipRepository { >> param( >> [string]$RepositoryPath = "E:\ai_pip_repository" >> ) >> >> # 创建仓库目录结构 >> $repoStructure = @{ >> Wheels = "wheels" >> SourceDists = "source_distributions" >> TempUnpack = "temp_unpack" >> Metadata = "metadata" >> Downloaded = "downloaded_packages" >> } >> >> # 创建仓库目录 >> try { >> New-Item -Path $RepositoryPath -ItemType Directory -Force | Out-Null >> $repoStructure.Keys | ForEach-Object { >> $dirPath = Join-Path $RepositoryPath $repoStructure[$_] >> New-Item -Path $dirPath -ItemType Directory -Force | Out-Null >> } >> } >> catch { >> Write-Host "❌ 目录创建失败: $_" -ForegroundColor Red >> return >> } >> >> # 简化pip配置 >> $pipConfig = @" >> [global] >> index-url = https://pypi.tuna.tsinghua.edu.cn/simple >> trusted-host = pypi.tuna.tsinghua.edu.cn >> "@ >> >> # 写入pip配置文件 >> $configDir = "C:\ProgramData\pip" >> if (-not (Test-Path $configDir)) { >> New-Item -ItemType Directory -Path $configDir -Force | Out-Null >> } >> $pipConfig | Out-File "$configDir\pip.ini" -Encoding ASCII -Force >> >> Write-Host "✅ Pip仓库已初始化: $RepositoryPath" -ForegroundColor Green >> Write-Host "仓库结构:" >> $repoStructure.GetEnumerator() | Format-Table @{Name="类型"; Expression={$_.Key}}, @{Name="路径"; Expression={$_.Value}} >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 4. 安全安装函数 ===== PS C:\Users\Administrator\Desktop> function Install-FromRepository { >> param( >> [Parameter(Mandatory=$true)] >> [string]$PackageName, >> [string]$Version = "latest", >> [string]$RepositoryPath = "E:\ai_pip_repository" >> ) >> >> # 创建临时配置文件 >> $tempConfig = Join-Path $env:TEMP "pip_temp.conf" >> @" >> [global] >> index-url = https://pypi.tuna.tsinghua.edu.cn/simple >> trusted-host = pypi.tuna.tsinghua.edu.cn >> "@ | Out-File $tempConfig -Encoding ASCII >> >> $downloadedDir = Join-Path $RepositoryPath "downloaded_packages" >> >> # 搜索本地仓库 >> $localPackages = Get-ChildItem -Path $downloadedDir -Recurse -ErrorAction SilentlyContinue | >> Where-Object { $_.Name -like "*$PackageName*" -and $_.Extension -in @(&#39;.whl&#39;, &#39;.gz&#39;, &#39;.zip&#39;) } >> >> if ($localPackages) { >> # 版本选择逻辑 >> if ($Version -eq "latest") { >> $selectedPackage = $localPackages | >> Sort-Object { [regex]::Match($_.Name, &#39;(\d+\.)+\d+&#39;).Value } -Descending | >> Select-Object -First 1 >> } else { >> $selectedPackage = $localPackages | >> Where-Object { $_.Name -match "$PackageName-$Version" } | >> Select-Object -First 1 >> } >> >> if (-not $selectedPackage) { >> Write-Host "⚠️ 仓库中未找到指定版本: $PackageName==$Version" -ForegroundColor Yellow >> return >> } >> >> Write-Host "🚀 使用仓库中的版本: $($selectedPackage.Name)" -ForegroundColor Yellow >> >> # 安装主包 >> python -m pip install $selectedPackage.FullName --no-deps --no-index --config $tempConfig >> >> # 安装依赖 >> $depReport = Test-RepositoryDependency -PackageName $PackageName -RepositoryPath $RepositoryPath >> if ($depReport.MissingDependencies.Count -gt 0) { >> Write-Host "🔍 安装依赖包..." -ForegroundColor Cyan >> $depReport.MissingDependencies | ForEach-Object { >> Install-FromRepository $_ -RepositoryPath $RepositoryPath --config $tempConfig >> } >> } >> return >> } >> >> # 本地仓库不存在则下载并保存 >> Write-Host "🌐 从镜像下载: $PackageName" -ForegroundColor Magenta >> >> # 创建临时下载目录 >> $tempDir = Join-Path $env:TEMP ([System.Guid]::NewGuid().ToString()) >> New-Item -ItemType Directory -Path $tempDir -Force | Out-Null >> >> try { >> # 下载包 >> if ($Version -eq "latest") { >> python -m pip download $PackageName -d $tempDir --config $tempConfig >> } else { >> python -m pip download "${PackageName}==${Version}" -d $tempDir --config $tempConfig >> } >> >> # 获取下载的文件 >> $downloadedFiles = Get-ChildItem $tempDir -File -ErrorAction SilentlyContinue | >> Where-Object { $_.Extension -in @(&#39;.whl&#39;, &#39;.gz&#39;, &#39;.zip&#39;) } >> >> if (-not $downloadedFiles) { >> throw "未找到下载的包文件" >> } >> >> # 安装并保存每个包 >> foreach ($file in $downloadedFiles) { >> # 安装主包 >> python -m pip install $file.FullName --config $tempConfig >> >> # 保存到仓库 >> $savePath = Join-Path $downloadedDir $file.Name >> Copy-Item -Path $file.FullName -Destination $savePath -Force >> Write-Host "💾 已保存到仓库: $($file.Name)" -ForegroundColor Green >> } >> } >> catch { >> Write-Host "❌ 安装失败: $_" -ForegroundColor Red >> } >> finally { >> # 清理临时目录 >> Remove-Item $tempDir -Recurse -Force -ErrorAction SilentlyContinue >> Remove-Item $tempConfig -Force -ErrorAction SilentlyContinue >> } >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 5. 网络驱动器解决方案 ===== PS C:\Users\Administrator\Desktop> function Map-NetworkDrive { >> param( >> [string]$NetworkPath, >> [string]$DriveLetter = "P" >> ) >> >> # 移除现有映射 >> net use ${DriveLetter}: /delete /y 2>$null >> >> # 创建新映射 >> net use ${DriveLetter}: $NetworkPath /persistent:yes >> >> if ($LASTEXITCODE -ne 0) { >> Write-Host "❌ 网络驱动器映射失败" -ForegroundColor Red >> return $null >> } >> >> Write-Host "✅ 网络驱动器已映射: ${DriveLetter}:\ -> $NetworkPath" -ForegroundColor Green >> return "${DriveLetter}:" >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # ===== 6. 环境验证函数 ===== PS C:\Users\Administrator\Desktop> function Test-Environment { >> # 验证Python >> try { >> $pythonVersion = python --version >> Write-Host "✅ Python可用: $pythonVersion" -ForegroundColor Green >> } >> catch { >> Write-Host "❌ Python不可用" -ForegroundColor Red >> return $false >> } >> >> # 验证pip >> try { >> $pipVersion = python -m pip --version >> Write-Host "✅ pip可用: $pipVersion" -ForegroundColor Green >> } >> catch { >> Write-Host "❌ pip不可用" -ForegroundColor Red >> return $false >> } >> >> # 验证.NET >> try { >> $dotnetVersion = dotnet --version >> Write-Host "✅ .NET SDK可用: $dotnetVersion" -ForegroundColor Green >> } >> catch { >> Write-Host "⚠️ .NET SDK不可用" -ForegroundColor Yellow >> } >> >> return $true >> } PS C:\Users\Administrator\Desktop> # 1. 修复Python环境 PS C:\Users\Administrator\Desktop> Repair-PythonEnvironment 🔧 修复pip安装... WARNING: Ignoring invalid distribution -odelscope (e:\python310\lib\site-packages) Found existing installation: certifi 2025.8.3 Uninstalling certifi-2025.8.3: Successfully uninstalled certifi-2025.8.3 Found existing installation: charset-normalizer 3.4.3 Uninstalling charset-normalizer-3.4.3: Successfully uninstalled charset-normalizer-3.4.3 Found existing installation: click 8.2.1 Uninstalling click-8.2.1: Successfully uninstalled click-8.2.1 Found existing installation: colorama 0.4.6 Uninstalling colorama-0.4.6: Successfully uninstalled colorama-0.4.6 Found existing installation: filelock 3.19.1 Uninstalling filelock-3.19.1: Successfully uninstalled filelock-3.19.1 Found existing installation: Flask 3.1.1 Uninstalling Flask-3.1.1: Successfully uninstalled Flask-3.1.1 Found existing installation: flask-cors 6.0.1 Uninstalling flask-cors-6.0.1: Successfully uninstalled flask-cors-6.0.1 Found existing installation: Flask-Limiter 3.12 Uninstalling Flask-Limiter-3.12: Successfully uninstalled Flask-Limiter-3.12 Found existing installation: Flask-SocketIO 5.5.1 Uninstalling Flask-SocketIO-5.5.1: Successfully uninstalled Flask-SocketIO-5.5.1 Found existing installation: fonttools 4.59.0 Uninstalling fonttools-4.59.0: Successfully uninstalled fonttools-4.59.0 Found existing installation: fsspec 2025.7.0 Uninstalling fsspec-2025.7.0: Successfully uninstalled fsspec-2025.7.0 Found existing installation: future 1.0.0 Uninstalling future-1.0.0: Successfully uninstalled future-1.0.0 Found existing installation: GPUtil 1.4.0 Uninstalling GPUtil-1.4.0: Successfully uninstalled GPUtil-1.4.0 Found existing installation: gradio 3.41.0 Uninstalling gradio-3.41.0: Successfully uninstalled gradio-3.41.0 Found existing installation: gradio_client 0.5.0 Uninstalling gradio_client-0.5.0: Successfully uninstalled gradio_client-0.5.0 Found existing installation: greenlet 3.2.4 Uninstalling greenlet-3.2.4: Successfully uninstalled greenlet-3.2.4 Found existing installation: groovy 0.1.2 Uninstalling groovy-0.1.2: Successfully uninstalled groovy-0.1.2 Found existing installation: grpcio 1.74.0 Uninstalling grpcio-1.74.0: Successfully uninstalled grpcio-1.74.0 Found existing installation: h11 0.16.0 Uninstalling h11-0.16.0: Successfully uninstalled h11-0.16.0 Found existing installation: httpcore 1.0.9 Uninstalling httpcore-1.0.9: Successfully uninstalled httpcore-1.0.9 Found existing installation: httpx 0.28.1 Uninstalling httpx-0.28.1: Successfully uninstalled httpx-0.28.1 Found existing installation: huggingface-hub 0.34.3 Uninstalling huggingface-hub-0.34.3: Successfully uninstalled huggingface-hub-0.34.3 Found existing installation: idna 3.10 Uninstalling idna-3.10: Successfully uninstalled idna-3.10 Found existing installation: imageio 2.37.0 Uninstalling imageio-2.37.0: Successfully uninstalled imageio-2.37.0 Found existing installation: importlib_metadata 8.7.0 Uninstalling importlib_metadata-8.7.0: Successfully uninstalled importlib_metadata-8.7.0 Found existing installation: importlib_resources 6.5.2 Uninstalling importlib_resources-6.5.2: Successfully uninstalled importlib_resources-6.5.2 Found existing installation: itsdangerous 2.2.0 Uninstalling itsdangerous-2.2.0: Successfully uninstalled itsdangerous-2.2.0 Found existing installation: Jinja2 3.1.6 Uninstalling Jinja2-3.1.6: Successfully uninstalled Jinja2-3.1.6 Found existing installation: jsonschema 4.25.0 Uninstalling jsonschema-4.25.0: Successfully uninstalled jsonschema-4.25.0 Found existing installation: jsonschema-specifications 2025.4.1 Uninstalling jsonschema-specifications-2025.4.1: Successfully uninstalled jsonschema-specifications-2025.4.1 Found existing installation: kiwisolver 1.4.8 Uninstalling kiwisolver-1.4.8: Successfully uninstalled kiwisolver-1.4.8 Found existing installation: lazy_loader 0.4 Uninstalling lazy_loader-0.4: Successfully uninstalled lazy_loader-0.4 Found existing installation: limits 5.5.0 Uninstalling limits-5.5.0: Successfully uninstalled limits-5.5.0 Found existing installation: lmdb 1.7.3 Uninstalling lmdb-1.7.3: Successfully uninstalled lmdb-1.7.3 Found existing installation: Markdown 3.8.2 Uninstalling Markdown-3.8.2: Successfully uninstalled Markdown-3.8.2 Found existing installation: markdown-it-py 3.0.0 Uninstalling markdown-it-py-3.0.0: Successfully uninstalled markdown-it-py-3.0.0 Found existing installation: MarkupSafe 2.1.5 Uninstalling MarkupSafe-2.1.5: Successfully uninstalled MarkupSafe-2.1.5 Found existing installation: matplotlib 3.10.5 Uninstalling matplotlib-3.10.5: Successfully uninstalled matplotlib-3.10.5 Found existing installation: mdurl 0.1.2 Uninstalling mdurl-0.1.2: Successfully uninstalled mdurl-0.1.2 Found existing installation: modelscope 1.29.0 Uninstalling modelscope-1.29.0: Successfully uninstalled modelscope-1.29.0 Found existing installation: mpmath 1.3.0 Uninstalling mpmath-1.3.0: Successfully uninstalled mpmath-1.3.0 Found existing installation: narwhals 2.0.1 Uninstalling narwhals-2.0.1: Successfully uninstalled narwhals-2.0.1 Found existing installation: networkx 3.4.2 Uninstalling networkx-3.4.2: Successfully uninstalled networkx-3.4.2 Found existing installation: numpy 2.2.6 Uninstalling numpy-2.2.6: Successfully uninstalled numpy-2.2.6 Found existing installation: opencv-python 4.12.0.88 Uninstalling opencv-python-4.12.0.88: Successfully uninstalled opencv-python-4.12.0.88 Found existing installation: ordered-set 4.1.0 Uninstalling ordered-set-4.1.0: Successfully uninstalled ordered-set-4.1.0 Found existing installation: orjson 3.11.1 Uninstalling orjson-3.11.1: Successfully uninstalled orjson-3.11.1 Found existing installation: packaging 25.0 Uninstalling packaging-25.0: Successfully uninstalled packaging-25.0 Found existing installation: pandas 2.3.1 Uninstalling pandas-2.3.1: Successfully uninstalled pandas-2.3.1 Found existing installation: pillow 10.4.0 Uninstalling pillow-10.4.0: Successfully uninstalled pillow-10.4.0 Found existing installation: platformdirs 4.3.8 Uninstalling platformdirs-4.3.8: Successfully uninstalled platformdirs-4.3.8 Found existing installation: prometheus_client 0.22.1 Uninstalling prometheus_client-0.22.1: Successfully uninstalled prometheus_client-0.22.1 Found existing installation: protobuf 6.31.1 Uninstalling protobuf-6.31.1: Successfully uninstalled protobuf-6.31.1 Found existing installation: psutil 7.0.0 Uninstalling psutil-7.0.0: Successfully uninstalled psutil-7.0.0 Found existing installation: pycparser 2.22 Uninstalling pycparser-2.22: Successfully uninstalled pycparser-2.22 Found existing installation: pycryptodome 3.18.0 Uninstalling pycryptodome-3.18.0: Successfully uninstalled pycryptodome-3.18.0 Found existing installation: pydantic 2.11.7 Uninstalling pydantic-2.11.7: Successfully uninstalled pydantic-2.11.7 Found existing installation: pydantic_core 2.33.2 Uninstalling pydantic_core-2.33.2: Successfully uninstalled pydantic_core-2.33.2 Found existing installation: pydub 0.25.1 Uninstalling pydub-0.25.1: Successfully uninstalled pydub-0.25.1 Found existing installation: Pygments 2.19.2 Uninstalling Pygments-2.19.2: Successfully uninstalled Pygments-2.19.2 Found existing installation: pyparsing 3.2.3 Uninstalling pyparsing-3.2.3: Successfully uninstalled pyparsing-3.2.3 Found existing installation: python-dateutil 2.9.0.post0 Uninstalling python-dateutil-2.9.0.post0: Successfully uninstalled python-dateutil-2.9.0.post0 Found existing installation: python-dotenv 1.1.1 Uninstalling python-dotenv-1.1.1: Successfully uninstalled python-dotenv-1.1.1 Found existing installation: python-engineio 4.12.2 Uninstalling python-engineio-4.12.2: Successfully uninstalled python-engineio-4.12.2 Found existing installation: python-multipart 0.0.20 Uninstalling python-multipart-0.0.20: Successfully uninstalled python-multipart-0.0.20 Found existing installation: python-socketio 5.13.0 Uninstalling python-socketio-5.13.0: Successfully uninstalled python-socketio-5.13.0 Found existing installation: pytz 2025.2 Uninstalling pytz-2025.2: Successfully uninstalled pytz-2025.2 Found existing installation: pywin32 311 Uninstalling pywin32-311: Successfully uninstalled pywin32-311 Found existing installation: PyYAML 6.0.2 Uninstalling PyYAML-6.0.2: Successfully uninstalled PyYAML-6.0.2 Found existing installation: referencing 0.36.2 Uninstalling referencing-0.36.2: Successfully uninstalled referencing-0.36.2 Found existing installation: regex 2025.7.34 Uninstalling regex-2025.7.34: Successfully uninstalled regex-2025.7.34 Found existing installation: requests 2.32.5 Uninstalling requests-2.32.5: Successfully uninstalled requests-2.32.5 Found existing installation: rich 13.9.4 Uninstalling rich-13.9.4: Successfully uninstalled rich-13.9.4 Found existing installation: rpds-py 0.26.0 Uninstalling rpds-py-0.26.0: Successfully uninstalled rpds-py-0.26.0 Found existing installation: ruff 0.12.7 Uninstalling ruff-0.12.7: Successfully uninstalled ruff-0.12.7 Found existing installation: safehttpx 0.1.6 Uninstalling safehttpx-0.1.6: Successfully uninstalled safehttpx-0.1.6 Found existing installation: safetensors 0.5.3 Uninstalling safetensors-0.5.3: Successfully uninstalled safetensors-0.5.3 Found existing installation: scikit-image 0.25.2 Uninstalling scikit-image-0.25.2: Successfully uninstalled scikit-image-0.25.2 Found existing installation: scipy 1.15.3 Uninstalling scipy-1.15.3: Successfully uninstalled scipy-1.15.3 Found existing installation: semantic-version 2.10.0 Uninstalling semantic-version-2.10.0: Successfully uninstalled semantic-version-2.10.0 Found existing installation: sentencepiece 0.2.0 Uninstalling sentencepiece-0.2.0: Successfully uninstalled sentencepiece-0.2.0 Found existing installation: shellingham 1.5.4 Uninstalling shellingham-1.5.4: Successfully uninstalled shellingham-1.5.4 Found existing installation: simple-websocket 1.1.0 Uninstalling simple-websocket-1.1.0: Successfully uninstalled simple-websocket-1.1.0 Found existing installation: six 1.17.0 Uninstalling six-1.17.0: Successfully uninstalled six-1.17.0 Found existing installation: sniffio 1.3.1 Uninstalling sniffio-1.3.1: Successfully uninstalled sniffio-1.3.1 Found existing installation: starlette 0.47.2 Uninstalling starlette-0.47.2: Successfully uninstalled starlette-0.47.2 Found existing installation: sympy 1.13.3 Uninstalling sympy-1.13.3: Successfully uninstalled sympy-1.13.3 Found existing installation: tensorboard 2.20.0 Uninstalling tensorboard-2.20.0: Successfully uninstalled tensorboard-2.20.0 Found existing installation: tensorboard-data-server 0.7.2 Uninstalling tensorboard-data-server-0.7.2: Successfully uninstalled tensorboard-data-server-0.7.2 Found existing installation: tifffile 2025.5.10 Uninstalling tifffile-2025.5.10: Successfully uninstalled tifffile-2025.5.10 Found existing installation: tiktoken 0.9.0 Uninstalling tiktoken-0.9.0: Successfully uninstalled tiktoken-0.9.0 Found existing installation: tokenizers 0.13.3 Uninstalling tokenizers-0.13.3: Successfully uninstalled tokenizers-0.13.3 Found existing installation: tomli 2.2.1 Uninstalling tomli-2.2.1: Successfully uninstalled tomli-2.2.1 Found existing installation: tomlkit 0.12.0 Uninstalling tomlkit-0.12.0: Successfully uninstalled tomlkit-0.12.0 Found existing installation: torch 2.0.1 Uninstalling torch-2.0.1: Successfully uninstalled torch-2.0.1 Found existing installation: torchaudio 2.8.0+cpu Uninstalling torchaudio-2.8.0+cpu: Successfully uninstalled torchaudio-2.8.0+cpu Found existing installation: torchvision 0.23.0+cpu Uninstalling torchvision-0.23.0+cpu: Successfully uninstalled torchvision-0.23.0+cpu Found existing installation: tqdm 4.67.1 Uninstalling tqdm-4.67.1: Successfully uninstalled tqdm-4.67.1 Found existing installation: transformers 4.31.0 Uninstalling transformers-4.31.0: Successfully uninstalled transformers-4.31.0 Found existing installation: typer 0.16.0 Uninstalling typer-0.16.0: Successfully uninstalled typer-0.16.0 Found existing installation: typing-inspection 0.4.1 Uninstalling typing-inspection-0.4.1: Successfully uninstalled typing-inspection-0.4.1 Found existing installation: typing_extensions 4.14.1 Uninstalling typing_extensions-4.14.1: Successfully uninstalled typing_extensions-4.14.1 Found existing installation: tzdata 2025.2 Uninstalling tzdata-2025.2: Successfully uninstalled tzdata-2025.2 Found existing installation: urllib3 2.5.0 Uninstalling urllib3-2.5.0: Successfully uninstalled urllib3-2.5.0 Found existing installation: uvicorn 0.35.0 Uninstalling uvicorn-0.35.0: Successfully uninstalled uvicorn-0.35.0 Found existing installation: waitress 3.0.2 Uninstalling waitress-3.0.2: Successfully uninstalled waitress-3.0.2 Found existing installation: watchdog 6.0.0 Uninstalling watchdog-6.0.0: Successfully uninstalled watchdog-6.0.0 Found existing installation: websockets 11.0.3 Uninstalling websockets-11.0.3: Successfully uninstalled websockets-11.0.3 Found existing installation: Werkzeug 3.1.3 Uninstalling Werkzeug-3.1.3: Successfully uninstalled Werkzeug-3.1.3 Found existing installation: WMI 1.5.1 Uninstalling WMI-1.5.1: Successfully uninstalled WMI-1.5.1 Found existing installation: wrapt 1.17.2 Uninstalling wrapt-1.17.2: Successfully uninstalled wrapt-1.17.2 Found existing installation: wsproto 1.2.0 Uninstalling wsproto-1.2.0: Successfully uninstalled wsproto-1.2.0 Found existing installation: yapf 0.43.0 Uninstalling yapf-0.43.0: Successfully uninstalled yapf-0.43.0 Found existing installation: zipp 3.23.0 Uninstalling zipp-3.23.0: Successfully uninstalled zipp-3.23.0 WARNING: Ignoring invalid distribution -odelscope (e:\python310\lib\site-packages) WARNING: Ignoring invalid distribution -odelscope (e:\python310\lib\site-packages) Looking in links: c:\Users\ADMINI~1\AppData\Local\Temp\tmpcpohcgy2 Requirement already satisfied: setuptools in e:\python310\lib\site-packages (80.9.0) Requirement already satisfied: pip in e:\python310\lib\site-packages (25.2) WARNING: Ignoring invalid distribution -odelscope (e:\python310\lib\site-packages) WARNING: Ignoring invalid distribution -odelscope (e:\python310\lib\site-packages) Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: pip in e:\python310\lib\site-packages (25.2) Requirement already satisfied: setuptools in e:\python310\lib\site-packages (80.9.0) Collecting wheel Downloading https://pypi.tuna.tsinghua.edu.cn/packages/0b/2c/87f3254fd8ffd29e4c02732eee68a83a1d3c346ae39bc6822dcbcb697f2b/wheel-0.45.1-py3-none-any.whl (72 kB) WARNING: Ignoring invalid distribution -odelscope (e:\python310\lib\site-packages) Installing collected packages: wheel WARNING: The script wheel.exe is installed in &#39;E:\Python310\Scripts&#39; which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: Ignoring invalid distribution -odelscope (e:\python310\lib\site-packages) Successfully installed wheel-0.45.1 WARNING: There was an error checking the latest version of pip. ✅ pip已修复: pip 25.2 from E:\Python310\lib\site-packages\pip (python 3.10) True PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 2. 安装/修复.NET SDK PS C:\Users\Administrator\Desktop> Install-DotNetSDK -Version "9.0.109" 🧹 清理旧.NET安装... 📥 下载.NET SDK 9.0.109....NET SDK 安装失败: 远程服务器返回错误: (400) 错误的请求。 False PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 3. 初始化pip仓库 PS C:\Users\Administrator\Desktop> Initialize-PipRepository -RepositoryPath "E:\ai_pip_repository" ✅ Pip仓库已初始化: E:\ai_pip_repository 仓库结构: 类型 路径 ---- ---- Metadata metadata Wheels wheels SourceDists source_distributions Downloaded downloaded_packages TempUnpack temp_unpack PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 4. 映射网络驱动器(如果需要) PS C:\Users\Administrator\Desktop> $drive = Map-NetworkDrive -NetworkPath "\\192.168.1.100\pip_repo" -DriveLetter "P" 发生系统错误 67。 找不到网络名。 ❌ 网络驱动器映射失败 PS C:\Users\Administrator\Desktop> if ($drive) { >> Initialize-PipRepository -RepositoryPath "${drive}\" >> } PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 5. 验证环境 PS C:\Users\Administrator\Desktop> Test-Environment ✅ Python可用: Python 3.10.10 ✅ pip可用: pip 25.2 from E:\Python310\lib\site-packages\pip (python 3.10) ⚠️ .NET SDK不可用 True PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 6. 安装包 PS C:\Users\Administrator\Desktop> Install-FromRepository "torch" -Version "2.8.0" 🌐 从镜像下载: torch Usage: E:\Python310\python.exe -m pip download [options] <requirement specifier> [package-index-options] ... E:\Python310\python.exe -m pip download [options] -r <requirements file> [package-index-options] ... E:\Python310\python.exe -m pip download [options] <vcs project url> ... E:\Python310\python.exe -m pip download [options] <local project path> ... E:\Python310\python.exe -m pip download [options] <archive url/path> ... no such option: --config ❌ 安装失败: 未找到下载的包文件 PS C:\Users\Administrator\Desktop> Install-FromRepository "torchvision" -Version "0.15.1" 🌐 从镜像下载: torchvision Usage: E:\Python310\python.exe -m pip download [options] <requirement specifier> [package-index-options] ... E:\Python310\python.exe -m pip download [options] -r <requirements file> [package-index-options] ... E:\Python310\python.exe -m pip download [options] <vcs project url> ... E:\Python310\python.exe -m pip download [options] <local project path> ... E:\Python310\python.exe -m pip download [options] <archive url/path> ... no such option: --config ❌ 安装失败: 未找到下载的包文件 PS C:\Users\Administrator\Desktop> Install-FromRepository "torchaudio" -Version "2.0.1" 🌐 从镜像下载: torchaudio Usage: E:\Python310\python.exe -m pip download [options] <requirement specifier> [package-index-options] ... E:\Python310\python.exe -m pip download [options] -r <requirements file> [package-index-options] ... E:\Python310\python.exe -m pip download [options] <vcs project url> ... E:\Python310\python.exe -m pip download [options] <local project path> ... E:\Python310\python.exe -m pip download [options] <archive url/path> ... no such option: --config ❌ 安装失败: 未找到下载的包文件 PS C:\Users\Administrator\Desktop> PS C:\Users\Administrator\Desktop> # 生成诊断报告 PS C:\Users\Administrator\Desktop> function Get-EnvironmentDiagnostics { >> $report = @() >> >> # Python信息 >> try { >> $pythonVersion = python --version 2>&1 >> $report += "Python: $pythonVersion" >> } catch { >> $report += "Python: ❌ 不可用" >> } >> >> # pip信息 >> try { >> $pipVersion = python -m pip --version 2>&1 >> $report += "pip: $pipVersion" >> } catch { >> $report += "pip: ❌ 不可用" >> } >> >> # .NET信息 >> try { >> $dotnetVersion = dotnet --version 2>&1 >> $report += ".NET SDK: $dotnetVersion" >> } catch { >> $report += ".NET SDK: ❌ 不可用" >> } >> >> # 环境变量 >> $report += "环境变量PATH: $env:PATH" >> >> # 输出报告 >> $report | Out-File "$env:TEMP\environment_diagnostics.txt" >> Write-Host "诊断报告已保存到: $env:TEMP\environment_diagnostics.txt" -ForegroundColor Cyan >> $report | ForEach-Object { Write-Host $_ } >> } PS C:\Users\Administrator\Desktop>”
最新发布
08-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值