[x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
OS version and name: Windows 7
0.12.11.toml.txt to upload): pyproject.toml.txtCan be reproduced on my laptop with the below script. When attempting to add Numpy, it returns a directory not empty error and can't get past that.
poetry new test_numpy
cd test_numpy
poetry install
poetry add numpy -vvv
In the debug message below, Poetry downloads numpy-1.16.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.wh but I'm on a Windows system
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
(py37) C:\Users\king.kyle\Developer\_test_numpy>poetry install
Updating dependencies
Resolving dependencies...
Nothing to install or update
Writing lock file
- Installing test_numpy (0.1.0)
(py37) C:\Users\king.kyle\Developer\_test_numpy>poetry add numpy -vvv
Using virtualenv: C:\Users\king.kyle\AppData\Local\pypoetry\Cache\virtualenvs\mm-upgrade-utility-py3.7
PyPI: No release information found for numpy-0.9.6, skipping
PyPI: No release information found for numpy-0.9.8, skipping
PyPI: No release information found for numpy-1.0.3, skipping
PyPI: No release information found for numpy-1.0.4, skipping
PyPI: No release information found for numpy-1.0b1, skipping
PyPI: No release information found for numpy-1.0b4, skipping
PyPI: No release information found for numpy-1.0b5, skipping
PyPI: No release information found for numpy-1.0rc1, skipping
PyPI: No release information found for numpy-1.0rc2, skipping
PyPI: No release information found for numpy-1.0rc3, skipping
PyPI: No release information found for numpy-1.1.1, skipping
PyPI: No release information found for numpy-1.2.0, skipping
PyPI: No release information found for numpy-1.2.1, skipping
PyPI: No release information found for numpy-1.4.0, skipping
PyPI: 45 packages found for numpy *
Using version ^1.16 for numpy
Updating dependencies
Resolving dependencies...
1: fact: test-numpy is 0.1.0
1: derived: test-numpy
1: fact: test-numpy depends on numpy (^1.16)
1: fact: test-numpy depends on pytest (^3.0)
1: selecting test-numpy (0.1.0)
1: derived: pytest (^3.0)
1: derived: numpy (^1.16)
1: fact: pytest (3.10.1) depends on py (>=1.5.0)
1: fact: pytest (3.10.1) depends on six (>=1.10.0)
1: fact: pytest (3.10.1) depends on attrs (>=17.4.0)
1: fact: pytest (3.10.1) depends on more-itertools (>=4.0.0)
1: fact: pytest (3.10.1) depends on atomicwrites (>=1.0)
1: fact: pytest (3.10.1) depends on pluggy (>=0.7)
1: fact: pytest (3.10.1) depends on colorama (*)
1: selecting pytest (3.10.1)
1: derived: colorama (*)
1: derived: pluggy (>=0.7)
1: derived: atomicwrites (>=1.0)
1: derived: more-itertools (>=4.0.0)
1: derived: attrs (>=17.4.0)
1: derived: six (>=1.10.0)
1: derived: py (>=1.5.0)
PyPI: No release information found for numpy-0.9.6, skipping
PyPI: No release information found for numpy-0.9.8, skipping
PyPI: No release information found for numpy-1.0.3, skipping
PyPI: No release information found for numpy-1.0.4, skipping
PyPI: No release information found for numpy-1.0b1, skipping
PyPI: No release information found for numpy-1.0b4, skipping
PyPI: No release information found for numpy-1.0b5, skipping
PyPI: No release information found for numpy-1.0rc1, skipping
PyPI: No release information found for numpy-1.0rc2, skipping
PyPI: No release information found for numpy-1.0rc3, skipping
PyPI: No release information found for numpy-1.1.1, skipping
PyPI: No release information found for numpy-1.2.0, skipping
PyPI: No release information found for numpy-1.2.1, skipping
PyPI: No release information found for numpy-1.4.0, skipping
PyPI: 1 packages found for numpy >=1.16,<2.0
PyPI: Getting info for numpy (1.16.0) from PyPI
PyPI: No dependencies found, downloading archives
PyPI: Downloading sdist: numpy-1.16.0.zip
PyPI: Downloading wheel: numpy-1.16.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
1: Version solving took 15.665 seconds.
1: Tried 1 solutions.
[OSError]
[WinError 145] The directory is not empty: 'C:\\Users\\KING~1.KYL\\AppData\\Local\\Temp\\tmp774m6ge1'
Exception trace:
C:\Users\king.kyle\.poetry\lib\poetry\_vendor\py3.7\cleo\application.py in run() at line 94
status_code = self.do_run(input_, output_)
C:\Users\king.kyle\.poetry\lib\poetry\console\application.py in do_run() at line 89
return super(Application, self).do_run(i, o)
C:\Users\king.kyle\.poetry\lib\poetry\_vendor\py3.7\cleo\application.py in do_run() at line 197
status_code = command.run(input_, output_)
C:\Users\king.kyle\.poetry\lib\poetry\console\commands\command.py in run() at line 77
return super(BaseCommand, self).run(i, o)
C:\Users\king.kyle\.poetry\lib\poetry\_vendor\py3.7\cleo\commands\base_command.py in run() at line 146
status_code = self.execute(input_, output_)
C:\Users\king.kyle\.poetry\lib\poetry\_vendor\py3.7\cleo\commands\command.py in execute() at line 107
return self.handle()
C:\Users\king.kyle\.poetry\lib\poetry\console\commands\add.py in handle() at line 139
status = installer.run()
C:\Users\king.kyle\.poetry\lib\poetry\installation\installer.py in run() at line 76
self._do_install(local_repo)
C:\Users\king.kyle\.poetry\lib\poetry\installation\installer.py in _do_install() at line 158
ops = solver.solve(use_latest=self._whitelist)
C:\Users\king.kyle\.poetry\lib\poetry\puzzle\solver.py in solve() at line 38
packages, depths = self._solve(use_latest=use_latest)
C:\Users\king.kyle\.poetry\lib\poetry\puzzle\solver.py in _solve() at line 171
self._package, self._provider, locked=locked, use_latest=use_latest
C:\Users\king.kyle\.poetry\lib\poetry\mixology\__init__.py in resolve_version() at line 7
return solver.solve()
C:\Users\king.kyle\.poetry\lib\poetry\mixology\version_solver.py in solve() at line 79
next = self._choose_package_version()
C:\Users\king.kyle\.poetry\lib\poetry\mixology\version_solver.py in _choose_package_version() at line 378
version = self._provider.complete_package(version)
C:\Users\king.kyle\.poetry\lib\poetry\puzzle\provider.py in complete_package() at line 462
package.name, package.version.text, extras=package.requires_extras
C:\Users\king.kyle\.poetry\lib\poetry\repositories\pool.py in package() at line 49
package = repository.package(name, version, extras=extras)
C:\Users\king.kyle\.poetry\lib\poetry\repositories\pypi_repository.py in package() at line 146
release_info = self.get_release_info(name, version)
C:\Users\king.kyle\.poetry\lib\poetry\repositories\pypi_repository.py in get_release_info() at line 249
"{}:{}".format(name, version), lambda: self._get_release_info(name, version)
C:\Users\king.kyle\.poetry\lib\poetry\_vendor\py3.7\cachy\repository.py in remember_forever() at line 174
val = value(callback)
C:\Users\king.kyle\.poetry\lib\poetry\_vendor\py3.7\cachy\helpers.py in value() at line 6
return val()
C:\Users\king.kyle\.poetry\lib\poetry\repositories\pypi_repository.py in <lambda>() at line 249
"{}:{}".format(name, version), lambda: self._get_release_info(name, version)
C:\Users\king.kyle\.poetry\lib\poetry\repositories\pypi_repository.py in _get_release_info() at line 371
info = self._get_info_from_urls(urls)
C:\Users\king.kyle\.poetry\lib\poetry\repositories\pypi_repository.py in _get_info_from_urls() at line 399
return self._get_info_from_wheel(urls["bdist_wheel"])
C:\Users\king.kyle\.poetry\lib\poetry\repositories\pypi_repository.py in _get_info_from_wheel() at line 425
return info
C:\Users\king.kyle\AppData\Local\Continuum\anaconda2\envs\py37\lib\contextlib.py in __exit__() at line 119
next(self.gen)
C:\Users\king.kyle\.poetry\lib\poetry\utils\helpers.py in temporary_directory() at line 35
yield name
C:\Users\king.kyle\AppData\Local\Continuum\anaconda2\envs\py37\lib\tempfile.py in __exit__() at line 805
self.cleanup()
C:\Users\king.kyle\AppData\Local\Continuum\anaconda2\envs\py37\lib\tempfile.py in cleanup() at line 809
_shutil.rmtree(self.name)
C:\Users\king.kyle\AppData\Local\Continuum\anaconda2\envs\py37\lib\shutil.py in rmtree() at line 507
return _rmtree_unsafe(path, onerror)
C:\Users\king.kyle\AppData\Local\Continuum\anaconda2\envs\py37\lib\shutil.py in _rmtree_unsafe() at line 395
onerror(os.rmdir, path, sys.exc_info())
C:\Users\king.kyle\AppData\Local\Continuum\anaconda2\envs\py37\lib\shutil.py in _rmtree_unsafe() at line 393
os.rmdir(path)
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...
The Numpy release files include valid Windows wheels, but it looks Poetry attempts to install the first one (...cp27m-macosx_10_6_intel...): https://pypi.org/project/numpy/#files
The correct release should be: numpy-1.16.0-cp37-cp37m-win32.whl. Downloading this wheel file and installing directly works: poetry add numpy --path C:\Users\king.kyle\Developer\numpy-1.16.0-cp37-cp37m-win32.whl
I just ran into the same issue when creating a new project.
I generated the pyproject.toml and then it failed to poetry install with the same error.
I then used poetry remove numpy, which started installing the dependencies into the virtual environment, and interestingly happily installed numpy as it was a dependency of pandas. So it installed fine... just not when it was directly referenced in the pyproject.toml (it was the first dependency in the list).
Edit: So I don't know how I got it to install correctly before. I can no longer do it without getting the wheel manually.
Is there a way around this problem without manually downloading the wheel? This is actually a major frustration right now, as nobody can sensibly create new projects, as everything we do involves numpy (or pandas).
I think this is a larger issue with Poetry, so I created a new ticket to track this: #944
In the meantime, I found that downloading and linking the correct wheel files for Numpy, pywin32, and pypiwin32 were the only workaround :face_with_head_bandage:
I'm ~90% certain that I fixed it! I need to add a test, prep a PR for master (instead of develop), and fix a few small things, but you can start using my development branch until it's merged: ~debug/issue-944-pickWheel~ (Use fix/944-select_wheel instead)
git clone https://github.com/KyleKing/poetry.git
cd poetry
git checkout fix/944-select-wheel
poetry install
# Manually edit: "./poetry/__version__.py" with a new version like: 0.12.11a0
poetry version 0.12.11a0
poetry build
To use in Python2 or Python3 environment:
pip install ./<pathTo>/poetry/dist/poetry-0.12.11a0-py2.py3-none-any.whl
poetry install
poetry add numpy # rejoice!
Let me know if that helps resolve your issue and if this fix works
I submitted a PR (#955)
.whl instead of .whl.txt and pip install .../poetry-0.12.11a0-py2.py3-none-any.whl): poetry-0.12.11a0-py2.py3-none-any.whl.txt.whl instead of .whl.txt and pip install .../poetry-0.12.11b0-py2.py3-none-any.whl):'.txt' then run pip install)
Most helpful comment
I submitted a PR (#955)
.whlinstead of.whl.txtandpip install .../poetry-0.12.11a0-py2.py3-none-any.whl): poetry-0.12.11a0-py2.py3-none-any.whl.txt.whlinstead of.whl.txtandpip install .../poetry-0.12.11b0-py2.py3-none-any.whl):poetry-0.12.11b0-py2.py3-none-any.whl.txt
(rename removing
'.txt'then runpip install)