question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installing from git repo breaks when upgrading pip from version 21.2.4 to 21.3

See original GitHub issue

Environment

  • Pythonnet version: 3.0.0.dev1
  • Python version: 3.9.7
  • Operating System: Windows
  • .NET Runtime: All

Details

This fails:

  1. python -m pip install pip==21.3
  2. pip install git+https://github.com/pythonnet/pythonnet

with error message:

Error reading git repository information: Unsupported repository version 1. Only versions up to 0 are supported.

I first filed the issue under the pip project, but there it got closed with a comment about it being a Python.NET build system issue.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yaakov-hcommented, Nov 14, 2021

As a possible workaround you can set the environment variable EnableSourceControlManagerQueries to false:

C:\Temp>python -m pip install pip==21.3
Collecting pip==21.3
  Downloading pip-21.3-py3-none-any.whl (1.7 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.7 MB 6.8 MB/s
Installing collected packages: pip
  WARNING: The scripts pip.exe, pip3.9.exe and pip3.exe are installed in 'C:\Users\Yaakov\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.3
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\Yaakov\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
C:\Temp>pip install git+https://github.com/pythonnet/pythonnet
Collecting git+https://github.com/pythonnet/pythonnet
  Cloning https://github.com/pythonnet/pythonnet to c:\users\yaakov\appdata\local\temp\pip-req-build-tm3tl3x6
  Running command git clone --filter=blob:none -q https://github.com/pythonnet/pythonnet 'C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6'
  Resolved https://github.com/pythonnet/pythonnet to commit 39f51fe8e45966b88532ae6feb8821ae8a4c71ea
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing wheel metadata (pyproject.toml) ... done
Collecting clr-loader
  Downloading clr_loader-0.1.6-py3-none-any.whl (45 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 45 kB 1.4 MB/s
Collecting cffi>=1.13
  Downloading cffi-1.15.0-cp39-cp39-win_amd64.whl (180 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 180 kB ...
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: pythonnet
  Building wheel for pythonnet (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Yaakov\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' 'C:\Users\Yaakov\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\Yaakov\AppData\Local\Temp\tmpf672g51e'
       cwd: C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6
  Complete output (31 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  copying clr.py -> build\lib
  creating build\lib\pythonnet
  copying pythonnet\__init__.py -> build\lib\pythonnet
  creating build\lib\pythonnet\find_libpython
  copying pythonnet\find_libpython\__init__.py -> build\lib\pythonnet\find_libpython
  copying pythonnet\find_libpython\__main__.py -> build\lib\pythonnet\find_libpython
  running build_dotnet
  Running dotnet build...
  dotnet build src/runtime/Python.Runtime.csproj --configuration release --output C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6\build\lib\pythonnet/runtime
  Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
  Copyright (C) Microsoft Corporation. All rights reserved.

    Determining projects to restore...
    Restored C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6\src\runtime\Python.Runtime.csproj (in 3.27 sec).
  C:\Users\Yaakov\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): error : Error reading git repository information: Unsupported repository version 1. Only versions up to 0 are supported. [C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6\src\runtime\Python.Runtime.csproj]
  C:\Users\Yaakov\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6\src\runtime'. [C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6\src\runtime\Python.Runtime.csproj]

  Build FAILED.

  C:\Users\Yaakov\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): warning : Unable to locate repository with working directory that contains directory 'C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6\src\runtime'. [C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6\src\runtime\Python.Runtime.csproj]
  C:\Users\Yaakov\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): error : Error reading git repository information: Unsupported repository version 1. Only versions up to 0 are supported. [C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-tm3tl3x6\src\runtime\Python.Runtime.csproj]
      1 Warning(s)
      1 Error(s)

  Time Elapsed 00:00:04.15
  error: command 'C:\\Program Files\\dotnet\\dotnet.exe' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pythonnet
Failed to build pythonnet
ERROR: Could not build wheels for pythonnet, which is required to install pyproject.toml-based projects
WARNING: You are using pip version 21.3; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\Yaakov\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
C:\Temp>set EnableSourceControlManagerQueries=false
C:\Temp>pip install git+https://github.com/pythonnet/pythonnet
Collecting git+https://github.com/pythonnet/pythonnet
  Cloning https://github.com/pythonnet/pythonnet to c:\users\yaakov\appdata\local\temp\pip-req-build-jdoizq3h
  Running command git clone --filter=blob:none -q https://github.com/pythonnet/pythonnet 'C:\Users\Yaakov\AppData\Local\Temp\pip-req-build-jdoizq3h'
  Resolved https://github.com/pythonnet/pythonnet to commit 39f51fe8e45966b88532ae6feb8821ae8a4c71ea
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing wheel metadata (pyproject.toml) ... done
Collecting clr-loader
  Using cached clr_loader-0.1.6-py3-none-any.whl (45 kB)
Collecting cffi>=1.13
  Using cached cffi-1.15.0-cp39-cp39-win_amd64.whl (180 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: pythonnet
  Building wheel for pythonnet (pyproject.toml) ... done
  Created wheel for pythonnet: filename=pythonnet-3.0.0.dev1-py3-none-any.whl size=248166 sha256=8a5d3782196500b60150fe0ad44111cab2e24c5337fc2e193ce098d5ea2f09cd
  Stored in directory: C:\Users\Yaakov\AppData\Local\Temp\pip-ephem-wheel-cache-s1hikrkr\wheels\8d\f2\7a\76977e88048edad6338951680c5f603bce38ea13b92255546a
Successfully built pythonnet
Installing collected packages: pycparser, cffi, clr-loader, pythonnet
Successfully installed cffi-1.15.0 clr-loader-0.1.6 pycparser-2.21 pythonnet-3.0.0.dev1
WARNING: You are using pip version 21.3; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\Yaakov\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
0reactions
lostmsucommented, Dec 21, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking editable installation with `No module named pip ...
I can reproduce the issue locally as well with Arch Linux, 21.3 fails, 21.2.4 works. This only happens in editable mode (using -e...
Read more >
Pip broken after upgrade. Cannot unsinstall or ...
This seems to have completely broken my pip install and I cannot figure out how to reset it. $ pip3 --version pip 8.1.1...
Read more >
pip install pip==1.0.2
pip. pip is a tool for installing and managing Python packages, such as those found in the Python Package Index. pip is a...
Read more >
Changelog - pip documentation v23.2.1
Only calculate topological installation order, for packages that are going to be installed/upgraded. This fixes an AssertionError that occurred when determiningΒ ...
Read more >
Failing image_build - Renku forum - Discourse
So this issue was originally introduced by a breaking change in setuptools 58 that broke quite a few old packages. We fixed it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found