Skip to content
Nilay Kabariya

Home · Topic · 15 entries

Python and pip errors on Windows and Linux, tested

Python 3.12 removed distutils, 3.15 arrived before most compiled packages had wheels for it, and Windows adds its own layer: a Store placeholder named python.exe, a pip that is installed but not on PATH, and compilers that are not there. Every entry below was reproduced on a real Windows 11 machine or a clean Linux container, with the exact error and what actually fixed it.

Entries

  1. No.094

    Python CERTIFICATE_VERIFY_FAILED, tested on 3.12 to 3.15

    certificate verify failed: unable to get local issuer certificate, or Basic Constraints of CA cert not marked critical on Python 3.13+. Each cause tested.

    > requests.exceptions.SSLError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/

    FIXED3 minWindows
  2. No.089

    module 'openai' has no attribute 'ChatCompletion', tested

    AttributeError: module 'openai' has no attribute 'ChatCompletion', or 'no longer supported in openai>=1.0.0'. Five SDK versions tested.

    > AttributeError: module 'openai' has no attribute 'ChatCompletion'

    AI3 min
  3. No.088

    Responses.create() unexpected keyword argument: new names

    max_tokens, messages, response_format, seed: their names in OpenAI's Responses API, tested. Plus the 'proxies' TypeError from httpx 0.28.

    > TypeError: Responses.create() got an unexpected keyword argument 'max_tokens'

    AI6 min
  4. No.087

    Claude SDK: unexpected keyword argument temperature, betas

    Messages.create() got an unexpected keyword argument after an anthropic upgrade, plus what SDK 2.0 (October 21) breaks next. Python and TypeScript, tested.

    > TypeError: Messages.create() got an unexpected keyword argument 'temperature'

    AI4 min
  5. No.083

    ModuleNotFoundError: No module named X, but it's installed

    pip installed it into one Python and your code runs another: a venv not activated, a Jupyter kernel, a second Python. Five cases reproduced, and the check.

    > Traceback (most recent call last):

    FIXED3 min
  6. No.082

    No module named 'pkg_resources': setuptools 82 removed it

    Installing setuptools no longer fixes it: setuptools 82 dropped pkg_resources, and 3.12+ venvs ship without setuptools. Tested with pip, uv and TensorBoard.

    > Traceback (most recent call last):

    FIXED3 min
  7. No.075

    Python was not found, or pip not recognized (Windows fix)

    "Python was not found" comes from a Microsoft Store placeholder python.exe, not Python, and exits with 9009. How to see which python.exe wins, and the pip fix.

    > Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.

    FIXED3 minWindows
  8. No.074

    pip error: externally-managed-environment, tested on 8 systems

    Ubuntu 24.04+, Debian 12+ and Homebrew Python block pip install; Ubuntu 22.04, Fedora and Docker python images don't. Which fix to use: venv, uv, pipx or apt.

    > error: externally-managed-environment

    FIXED4 min
  9. No.070

    No module named 'distutils' on Python 3.12+ (node-gyp, setuptools)

    Python 3.12 removed distutils. setuptools brings it back for Python code; npm installs need a newer npm (node-gyp 10+); msvccompiler needs setuptools below 74.

    > ModuleNotFoundError: No module named 'distutils'

    FIXED3 min
  10. No.065

    No matching distribution found for torch: 5 causes, tested

    pip says Could not find a version that satisfies the requirement torch (from versions: none). Five causes reproduced on Windows, and the fix for each.

    > ERROR: Could not find a version that satisfies the requirement torch (from versions: none)

    FIXED4 minWindows
  11. No.064

    Fix: Microsoft Visual C++ 14.0 or greater is required

    pip install fails on Windows asking for Microsoft C++ Build Tools. Four causes reproduced, Failed building wheel for pyyaml fixed, and when Build Tools help.

    > error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

    FIXED7 minWindows
  12. No.063

    Python 3.15 on Windows: which packages install (tested)

    Most of the stack is ready: numpy, pandas, scipy, scikit-learn, polars, pydantic, FastAPI, Django and the OpenAI and Anthropic SDKs all install on 3.15, and so do PyTorch (since torch 2.15.0) and sentencepiece (since 0.2.3). What fails on Windows: TensorFlow (no 3.15 builds at all), PyYAML and everything that needs it, such as transformers (no 3.15 wheel, so pip tries to compile it), jupyterlab, and langchain (Rust and C dependencies with no 3.15 wheels).

    TESTED10 minWindows
  13. No.060

    Claude "temperature is deprecated for this model" (400)

    Switching to Claude Sonnet 5.5, Haiku 5.5 or Opus 4.7 breaks code that sets temperature, even temperature: 0. Every case tested, in Node and Python.

    > BadRequestError: 400 {"type":"error","error":{"type":"invalid_request_error","message":"`temperature` is deprecated for this model."}}

    AI4 min
  14. No.022

    Fix: Could not resolve authentication method (Anthropic / Claude SDK)

    Anthropic's SDK can't find your key. The old and new wording, ANTHROPIC_API_KEY vs ANTHROPIC_AUTH_TOKEN, and the 401 you get when a key is in the wrong one.

    > Error: Could not resolve authentication method. Expected either apiKey or authToken to be set.

    AI4 min
  15. No.020

    Fix: The OPENAI_API_KEY environment variable is missing or empty

    OpenAI's SDK or Codex CLI says your key is missing, though it's in .env. Every wording and its fix, plus the 401 you get when an old key wins.

    > OpenAIError: The OPENAI_API_KEY environment variable is missing or empty; either provide it,

    AI7 min

Post card · Every Sunday

What broke this week.

One email on Sundays: the Node, TypeScript, Python and AI SDK releases that broke builds that week, each one reproduced, with a link to the fix that worked. Never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text