astral-sh / uv

An extremely fast Python package installer and resolver, written in Rust.
https://astral.sh/
Apache License 2.0
16k stars 477 forks source link

Windows failure when installing with cache #4190

Open befelix opened 2 months ago

befelix commented 2 months ago

I get an error when running python -m uv pip install --verbose 'antlr4-python3-runtime==4.9.3' on an Windows CI server. The error does not occur when installing with the --no-cache flag. Nor is it reproducible on a local Windows machine. pip installs it without issues.

platform: Windows uv version: uv 0.2.9 (e9fc99e62 2024-06-06) python version: 3.11.8 command: python -m uv pip install --verbose 'antlr4-python3-runtime==4.9.3'

Here's the log from CI, please let me know if you need additional information.

DEBUG Searching for Python interpreter in parent interpreter
DEBUG Found CPython 3.11.8 at `C:\actions-runner\_work\mypkg2\mypkg2\testenv\Scripts\python.exe` (parent interpreter)
DEBUG Using Python 3.11.8 environment at testenv\Scripts\python.exe
DEBUG Acquired lock for `testenv`
DEBUG At least one requirement is not satisfied: antlr4-python3-runtime==4.9.3
DEBUG Using registry request timeout of 30s
DEBUG Solving with installed Python version: 3.11.8
DEBUG Adding direct dependency: antlr4-python3-runtime==4.9.3
DEBUG Found fresh response for: https://pypi.org/simple/antlr4-python3-runtime/
DEBUG Searching for a compatible version of antlr4-python3-runtime (==4.9.3)
DEBUG Selecting: antlr4-python3-runtime==4.9.3 (antlr4-python3-runtime-4.9.3.tar.gz)
DEBUG Acquired lock for `\\?\C:\Windows\System32\config\systemprofile\AppData\Local\uv\cache\built-wheels-v3\pypi\antlr4-python3-runtime\4.9.3`
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/3e/38/7859ff46355f76f8d19459005ca000b6e7012f2f1ca597746cbcd1fbfe5e/antlr4-python3-runtime-4.9.3.tar.gz
DEBUG Using cached metadata for: antlr4-python3-runtime==4.9.3
DEBUG Tried 2 versions: antlr4-python3-runtime 1, root 1
Resolved 1 package in 10ms
DEBUG Identified uncached requirement: antlr4-python3-runtime==4.9.3
DEBUG Preserving seed package: pip==24.0
DEBUG Preserving seed package: setuptools==65.5.0
DEBUG Preserving seed package: uv==0.2.9
DEBUG Acquired lock for `\\?\C:\Windows\System32\config\systemprofile\AppData\Local\uv\cache\built-wheels-v3\pypi\antlr4-python3-runtime\4.9.3`
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/3e/38/7859ff46355f76f8d19459005ca000b6e7012f2f1ca597746cbcd1fbfe5e/antlr4-python3-runtime-4.9.3.tar.gz
DEBUG Building: antlr4-python3-runtime==4.9.3
DEBUG Solving with installed Python version: 3.11.8
DEBUG Adding direct dependency: setuptools>=40.8.0
DEBUG Found fresh response for: https://pypi.org/simple/setuptools/
DEBUG Searching for a compatible version of setuptools (>=40.8.0)
DEBUG Selecting: setuptools==70.0.0 (setuptools-70.0.0-py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/de/88/70c5767a0e43eb4451c2200f07d042a4bcd7639276003a9c54a68cfcc1f8/setuptools-70.0.0-py3-none-any.whl.metadata
DEBUG Tried 2 versions: root 1, setuptools 1
DEBUG Installing in setuptools==70.0.0 in \\?\C:\Windows\System32\config\systemprofile\AppData\Local\uv\cache\.tmpOwmiGG\.venv
DEBUG Requirement already cached: setuptools==70.0.0
DEBUG Installing build requirement: setuptools==70.0.0
DEBUG Calling `setuptools.build_meta:__legacy__.get_requires_for_build_wheel()`
DEBUG Installing extra requirements for build backend
DEBUG Solving with installed Python version: 3.11.8
DEBUG Adding direct dependency: setuptools>=40.8.0
DEBUG Adding direct dependency: wheel*
DEBUG Searching for a compatible version of setuptools (>=40.8.0)
DEBUG Selecting: setuptools==70.0.0 (setuptools-70.0.0-py3-none-any.whl)
DEBUG Found fresh response for: https://pypi.org/simple/wheel/
DEBUG Searching for a compatible version of wheel (*)
DEBUG Selecting: wheel==0.43.0 (wheel-0.43.0-py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl.metadata
DEBUG Tried 3 versions: root 1, setuptools 1, wheel 1
DEBUG Installing in setuptools==70.0.0, wheel==0.43.0 in \\?\C:\Windows\System32\config\systemprofile\AppData\Local\uv\cache\.tmpOwmiGG\.venv
DEBUG Requirement already installed: setuptools==70.0.0
DEBUG Requirement already cached: wheel==0.43.0
DEBUG Installing build requirement: wheel==0.43.0
DEBUG Calling `setuptools.build_meta:__legacy__.build_wheel("\\\\?\\C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\uv\\cache\\built-wheels-v3\\pypi\\antlr4-python3-runtime\\4.9.3\\VVyfgYJbhfC_zVg-P7WcC\\.tmpz1fJ06", {}, None)`
error: Failed to download distributions
  Caused by: Failed to fetch wheel: antlr4-python3-runtime==4.9.3
  Caused by: Failed to build: `antlr4-python3-runtime==4.9.3`
  Caused by: Build backend failed to build wheel through `build_wheel()` with exit code: 1
--- stdout:
running bdist_wheel
running build
running build_py
copying src\antlr4\BufferedTokenStream.py -> build\lib\antlr4
copying src\antlr4\CommonTokenFactory.py -> build\lib\antlr4
copying src\antlr4\CommonTokenStream.py -> build\lib\antlr4
copying src\antlr4\FileStream.py -> build\lib\antlr4
copying src\antlr4\InputStream.py -> build\lib\antlr4
copying src\antlr4\IntervalSet.py -> build\lib\antlr4
copying src\antlr4\Lexer.py -> build\lib\antlr4
copying src\antlr4\ListTokenSource.py -> build\lib\antlr4
copying src\antlr4\LL1Analyzer.py -> build\lib\antlr4
copying src\antlr4\Parser.py -> build\lib\antlr4
copying src\antlr4\ParserInterpreter.py -> build\lib\antlr4
copying src\antlr4\ParserRuleContext.py -> build\lib\antlr4
copying src\antlr4\PredictionContext.py -> build\lib\antlr4
copying src\antlr4\Recognizer.py -> build\lib\antlr4
copying src\antlr4\RuleContext.py -> build\lib\antlr4
copying src\antlr4\StdinStream.py -> build\lib\antlr4
copying src\antlr4\Token.py -> build\lib\antlr4
copying src\antlr4\TokenStreamRewriter.py -> build\lib\antlr4
copying src\antlr4\Utils.py -> build\lib\antlr4
copying src\antlr4\__init__.py -> build\lib\antlr4
copying src\antlr4\atn\ATN.py -> build\lib\antlr4\atn
copying src\antlr4\atn\ATNConfig.py -> build\lib\antlr4\atn
copying src\antlr4\atn\ATNConfigSet.py -> build\lib\antlr4\atn
copying src\antlr4\atn\ATNDeserializationOptions.py -> build\lib\antlr4\atn
copying src\antlr4\atn\ATNDeserializer.py -> build\lib\antlr4\atn
copying src\antlr4\atn\ATNSimulator.py -> build\lib\antlr4\atn
copying src\antlr4\atn\ATNState.py -> build\lib\antlr4\atn
copying src\antlr4\atn\ATNType.py -> build\lib\antlr4\atn
copying src\antlr4\atn\LexerAction.py -> build\lib\antlr4\atn
copying src\antlr4\atn\LexerActionExecutor.py -> build\lib\antlr4\atn
copying src\antlr4\atn\LexerATNSimulator.py -> build\lib\antlr4\atn
copying src\antlr4\atn\ParserATNSimulator.py -> build\lib\antlr4\atn
copying src\antlr4\atn\PredictionMode.py -> build\lib\antlr4\atn
copying src\antlr4\atn\SemanticContext.py -> build\lib\antlr4\atn
copying src\antlr4\atn\Transition.py -> build\lib\antlr4\atn
copying src\antlr4\atn\__init__.py -> build\lib\antlr4\atn
copying src\antlr4\dfa\DFA.py -> build\lib\antlr4\dfa
copying src\antlr4\dfa\DFASerializer.py -> build\lib\antlr4\dfa
copying src\antlr4\dfa\DFAState.py -> build\lib\antlr4\dfa
copying src\antlr4\dfa\__init__.py -> build\lib\antlr4\dfa
copying src\antlr4\tree\Chunk.py -> build\lib\antlr4\tree
copying src\antlr4\tree\ParseTreeMatch.py -> build\lib\antlr4\tree
copying src\antlr4\tree\ParseTreePattern.py -> build\lib\antlr4\tree
copying src\antlr4\tree\ParseTreePatternMatcher.py -> build\lib\antlr4\tree
copying src\antlr4\tree\RuleTagToken.py -> build\lib\antlr4\tree
copying src\antlr4\tree\TokenTagToken.py -> build\lib\antlr4\tree
copying src\antlr4\tree\Tree.py -> build\lib\antlr4\tree
copying src\antlr4\tree\Trees.py -> build\lib\antlr4\tree
copying src\antlr4\tree\__init__.py -> build\lib\antlr4\tree
copying src\antlr4\error\DiagnosticErrorListener.py -> build\lib\antlr4\error
copying src\antlr4\error\ErrorListener.py -> build\lib\antlr4\error
copying src\antlr4\error\Errors.py -> build\lib\antlr4\error
copying src\antlr4\error\ErrorStrategy.py -> build\lib\antlr4\error
copying src\antlr4\error\__init__.py -> build\lib\antlr4\error
copying src\antlr4\xpath\XPath.py -> build\lib\antlr4\xpath
copying src\antlr4\xpath\__init__.py -> build\lib\antlr4\xpath
running build_scripts
copying and adjusting bin\pygrun -> build\scripts-3.11
installing to build\bdist.win-amd64\wheel
running install
running install_lib
running install_egg_info
running egg_info
writing src\antlr4_python3_runtime.egg-info\PKG-INFO
writing dependency_links to src\antlr4_python3_runtime.egg-info\dependency_links.txt
writing requirements to src\antlr4_python3_runtime.egg-info\requires.txt
writing top-level names to src\antlr4_python3_runtime.egg-info\top_level.txt
reading manifest file 'src\antlr4_python3_runtime.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src\antlr4_python3_runtime.egg-info\SOURCES.txt'
removing 'build\bdist.win-amd64\wheel\.\antlr4_python3_runtime-4.9.3-py3.11.egg-info' (and everything under it)
Copying src\antlr4_python3_runtime.egg-info to build\bdist.win-amd64\wheel\.\antlr4_python3_runtime-4.9.3-py3.11.egg-info
--- stderr:
warning: no files found matching '*.py' under directory 'test'
warning: no files found matching '*.c' under directory 'test'
error: [Errno 2] No such file or directory: 'build\\bdist.win-amd64\\wheel\\.\\antlr4_python3_runtime-4.9.3-py3.11.egg-info\\dependency_links.txt'
---
Error: Process completed with exit code 1.
charliermarsh commented 2 months ago

Are you able to reproduce this on GitHub Actions, or is it some other CI setup?

befelix commented 2 months ago

Are you able to reproduce this on GitHub Actions, or is it some other CI setup?

I just tested it and it works on GH runners. I was running on non-public ones. It also works in my setup if I move the cache directory, so at this point my guess is some form of permission error in the cache directory (though it's still weird, since the cache works for packages that ship wheels). I'll let you know if I find out something more concrete - maybe it is something that uv could check for.

ktakita1011 commented 1 month ago

I am also experiencing a similar issue. When I use rye add OmegaConf when i activate uv on rye, I encounter the same error.

Andrew-Chen-Wang commented 1 month ago
Screenshot 2024-07-06 at 14 21 51

Not sure if this is related, but also having issues in a private repo:

    steps:
    - uses: actions/checkout@v4
    - name: Install Python
      uses: actions/setup-python@v5
      with:
        python-version: 3.12
        cache: 'pip'
    - name: Install Dependencies (Windows)
      if: matrix.os == 'windows-latest'
      run: |
        powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
        uv pip install --system -r bin/requirements/requirements-dev-windows.txt

nvm I see https://github.com/actions/setup-python/issues/822

MarcusJellinghaus commented 2 weeks ago

I have similar issues:

I now started to have individual cache folders for each github runner, and clean the cache at the beginning of the CI pipeline. That does not speed up the CI pipeline, but solves some of the issues:

[...]
DEBUG Found not-modified response for: https://nexus.myinfo.org:8443/repository/myit-pypi-group/packages/lxml/5.2.2/lxml-5.2.2-cp39-cp39-win_amd64.whl#sha256=610b5c77428a50269f38a534057444c249976433f40f53e3b47e68349cca1425

  � No solution found when resolving dependencies:

  \u2570\u2500\u25b6 Because there is no version of pyarrow==17.0.0 and you require

      pyarrow==17.0.0, we can conclude that the requirements are

      unsatisfiable.

init: exit 1 (2.41 seconds) C:\actions-runner-4\_work\my_utility\my_utility> uv pip install --verbose --index-url https://nexus.myinfo.org:8443/repository/my-pypi-group/simple --extra-index-url https://nexus.myinfo.org:8443/repository/myit-pypi-group/simple --native-tls -r C:\actions-runner-4\_work\my_utility\my_utility\requirements.txt -r C:\actions-runner-4\_work\my_utility\my_utility\requirements_test.txt pid=4676

  init: FAIL code 1 (4.98 seconds)

  evaluation failed :( (7.39 seconds)