python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.76k stars 2.27k forks source link

Issue with installing GitPython on Windows 10 / Python 3.7 #1243

Closed aaront closed 2 years ago

aaront commented 5 years ago

Issue

When trying to install the GitPython dependency on Windows 10 (with Python 3.7) in a project, I get the following error:

[PermissionError]
[WinError 5] Access is denied: 'C:\\Users\\aaron\\AppData\\Local\\Temp\\tmplx22xv9u\\unpacked\\gitdb-0.6.4\\gitdb\\test\\fixtures\\objects\\88\\8401851f15db0eed60eb1bc29dec5ddcace911'

(I've logged the output of poetry install -vvv in the gist: https://gist.github.com/aaront/9c1156015284a29f7c2bb5cd9435fdc8 )

Repeated attempts to install the package yield the same result (even attempted on 2 different machines). Also attempted to install the gitdb dependency itself first, to the same issue.

Installing this inside Ubuntu/WSL works without issues:

Creating virtualenv gitypython-test-py3.7 in /home/aaron/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (1.1s)

Writing lock file

Package operations: 14 installs, 0 updates, 0 removals

  - Installing zipp (0.5.2)
  - Installing importlib-metadata (0.18)
  - Installing smmap2 (2.0.5)
  - Installing atomicwrites (1.3.0)
  - Installing attrs (19.1.0)
  - Installing ddt (1.2.1)
  - Installing gitdb (0.6.4)
  - Installing gitdb2 (2.0.5)
  - Installing more-itertools (7.2.0)
  - Installing pluggy (0.12.0)
  - Installing py (1.8.0)
  - Installing six (1.12.0)
  - Installing gitpython (2.1.12)
  - Installing pytest (3.10.1)
  - Installing gitypython-test (0.1.0)
aaront commented 5 years ago

I should also note installing this with pip inside when running poetry shell does work.

kmray commented 5 years ago

I have also run into this issue:

Poetry 1.0.0a5 Python 3.6.6 Windows 10.0.17134

poetry lock -vvv
...
PyPI: Getting info for gitdb (0.6.4) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading sdist: gitdb-0.6.4.tar.gz
   1: Version solving took 8.980 seconds.
   1: Tried 1 solutions.

[PermissionError]
[WinError 5] Access is denied: 'C:\\Users\\kmray\\AppData\\Local\\Temp\\tmp4d1wsfpx\\unpacked\\gitdb-0.6.4\\gitdb\\test\\fixtures\\objects\\88\\8401851f15db0eed60eb1bc29dec5ddcace911'

Traceback (most recent call last):
  File "C:\Users\kmray\.poetry\lib\poetry\_vendor\py3.6\clikit\console_application.py", line 132, in run
    status_code = command.handle(parsed_args, io)
  File "C:\Users\kmray\.poetry\lib\poetry\_vendor\py3.6\clikit\api\command\command.py", line 119, in handle
    status_code = self._do_handle(args, io)
  File "C:\Users\kmray\.poetry\lib\poetry\_vendor\py3.6\clikit\api\command\command.py", line 167, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "C:\Users\kmray\.poetry\lib\poetry\_vendor\py3.6\cleo\commands\command.py", line 92, in wrap_handle
    return self.handle()
  File "C:\Users\kmray\.poetry\lib\poetry\console\commands\lock.py", line 26, in handle
    return installer.run()
  File "C:\Users\kmray\.poetry\lib\poetry\installation\installer.py", line 75, in run
    self._do_install(local_repo)
  File "C:\Users\kmray\.poetry\lib\poetry\installation\installer.py", line 167, in _do_install
    ops = solver.solve(use_latest=self._whitelist)
  File "C:\Users\kmray\.poetry\lib\poetry\puzzle\solver.py", line 38, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "C:\Users\kmray\.poetry\lib\poetry\puzzle\solver.py", line 173, in _solve
    self._package, self._provider, locked=locked, use_latest=use_latest
  File "C:\Users\kmray\.poetry\lib\poetry\mixology\__init__.py", line 7, in resolve_version
    return solver.solve()
  File "C:\Users\kmray\.poetry\lib\poetry\mixology\version_solver.py", line 79, in solve
    next = self._choose_package_version()
  File "C:\Users\kmray\.poetry\lib\poetry\mixology\version_solver.py", line 377, in _choose_package_version
    version = self._provider.complete_package(version)
  File "C:\Users\kmray\.poetry\lib\poetry\puzzle\provider.py", line 506, in complete_package
    repository=package.dependency.source_name,
  File "C:\Users\kmray\.poetry\lib\poetry\repositories\pool.py", line 115, in package
    package = repo.package(name, version, extras=extras)
  File "C:\Users\kmray\.poetry\lib\poetry\repositories\pypi_repository.py", line 175, in package
    release_info = self.get_release_info(name, version)
  File "C:\Users\kmray\.poetry\lib\poetry\repositories\pypi_repository.py", line 278, in get_release_info
    '{}:{}'.format(name, version), lambda: self._get_release_info(name, version)
  File "C:\Users\kmray\.poetry\lib\poetry\_vendor\py3.6\cachy\repository.py", line 174, in remember_forever
    val = value(callback)
  File "C:\Users\kmray\.poetry\lib\poetry\_vendor\py3.6\cachy\helpers.py", line 6, in value
    return val()
  File "C:\Users\kmray\.poetry\lib\poetry\repositories\pypi_repository.py", line 278, in <lambda>
    '{}:{}'.format(name, version), lambda: self._get_release_info(name, version)
  File "C:\Users\kmray\.poetry\lib\poetry\repositories\pypi_repository.py", line 340, in _get_release_info
    info = self._get_info_from_urls(urls)
  File "C:\Users\kmray\.poetry\lib\poetry\repositories\pypi_repository.py", line 450, in _get_info_from_urls
    return self._get_info_from_sdist(urls['sdist'][0])
  File "C:\Users\kmray\.poetry\lib\poetry\repositories\pypi_repository.py", line 588, in _get_info_from_sdist
    return info
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\contextlib.py", line 88, in __exit__
    next(self.gen)
  File "C:\Users\kmray\.poetry\lib\poetry\utils\helpers.py", line 39, in temporary_directory
    yield name
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\tempfile.py", line 809, in __exit__
    self.cleanup()
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\tempfile.py", line 813, in cleanup
    _shutil.rmtree(self.name)
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\shutil.py", line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  [Previous line repeated 3 more times]
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\shutil.py", line 389, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\shutil.py", line 387, in _rmtree_unsafe
    os.unlink(fullname)
brno32 commented 5 years ago

Several coworkers and I are also getting this issue on Windows 10 with a variety of poetry commands (though we're on Python 3.6). Usually, making a new virtualenv seems to help, but we've come across some operations that do not work even in a fresh environment

absassi commented 5 years ago

This seems to be duplicate of #1031 and would be fixed by #1032.

abn commented 2 years ago

The reported issue was fixed with https://github.com/python-poetry/poetry/commit/c12d86b7. Other cases covered in #5510.

github-actions[bot] commented 8 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.