You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 10 64位系统下如何安装PyYAML?现有方案均无效

Hey there, let's work through this PyYAML installation headache you're dealing with on Windows 10 64-bit! Multiple Python versions can definitely throw a wrench in things, so let's break down the fixes step by step:

Step 1: Make sure you're using the right pip for your target Python version

Since you have multiple Python installs (3.2 through 3.6), your pip3 command might be pointing to a different Python version than you think. To confirm:

  • Open Command Prompt and run:
    pip3 --version
    
    Check the output path—if it's not pointing to your Python 3.5 installation (e.g., C:\Python35\Scripts\pip.exe), you'll need to use the absolute path to the correct pip executable instead of just pip3. For example:
    C:\Python35\Scripts\pip.exe install --upgrade PyYAML
    

Step 2: Verify your wheel file matches your Python's exact ABI and architecture

The "wheel not supported on this platform" error usually means the wheel file you downloaded doesn't align with your Python's build details. For Python 3.5 on Windows 64-bit:

  • Ensure the wheel filename follows the pattern PyYAML-<version>-cp35-cp35m-win_amd64.whl—the cp35m part is crucial (it indicates CPython 3.5 with pymalloc, which is standard for Windows builds).
  • If you tried a wheel without the m (like cp35 instead of cp35m), that's likely the issue. Double-check the wheel you download matches your Python's exact tag—you can confirm your Python's tag by running this in a Python 3.5 shell:
    import sysconfig
    print(sysconfig.get_config_var('SOABI'))
    
    For Python 3.5 64-bit Windows, this should output cp35-win_amd64 or cp35m-win_amd64.

Step 3: Try installing without pre-built wheels (source installation)

If wheel files keep failing, you can force pip to install from source. Note: This might require having the Visual C++ Build Tools installed (for compiling the C extensions), but PyYAML also has a pure-Python fallback that should work even without build tools. Run:

C:\Python35\Scripts\pip.exe install --no-binary :all: PyYAML==3.12

Step 4: Clean up old installations first

Sometimes leftover partial installs can cause conflicts. Uninstall any existing PyYAML versions first to start fresh:

C:\Python35\Scripts\pip.exe uninstall -y PyYAML

Then retry the upgrade or wheel installation.

Quick Tip: Run Command Prompt as Administrator

Occasionally, permission issues can block pip from writing to Python's installation directory. Right-click Command Prompt and select "Run as administrator" before executing your install commands to rule this out.


内容的提问来源于stack exchange,提问作者Micoloth

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:32:21