Je n'ai pas détaillé l'enquête sur la cause, mais un mémo de la solution.
L'erreur suivante s'est produite lors de l'installation d'un repo git avec poetry. Nommez-le un repo nommé hoge.
(.venv) bash-3.2$ poetry update
Updating dependencies
Resolving dependencies... (10.2s)
Writing lock file
Package operations: 12 installs, 0 updates, 0 removals
- Installing hoge (0.0.1 acd565a)
[EnvCommandError]
Command ['/Users/kazeto/Works/aaa/.venv/bin/pip', 'install', '--no-deps', '-U', '-e', '/Users/kazeto/Works/aaa/.venv/src/hoge'] errored with the following return code 1, and output:
Obtaining file:///Users/kazeto/Works/aaa/.venv/src/hoge
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Installing collected packages: hoge
Running setup.py develop for hoge
ERROR: Command errored out with exit status 1:
command: /Users/kazeto/Works/aaa/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/kazeto/Works/aaa/.venv/src/hoge/setup.py'"'"'; __file__='"'"'/Users/kazeto/Works/aaa/.venv/src/hoge/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
cwd: /Users/kazeto/Works/aaa/.venv/src/hoge/
Complete output (3 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/kazeto/Works/aaa/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/kazeto/Works/aaa/.venv/src/hoge/setup.py'"'"'; __file__='"'"'/Users/kazeto/Works/aaa/.venv/src/hoge/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
À propos, lorsque j'ai essayé de vérifier le journal comme indiqué dans le journal des erreurs et que j'ai exécuté manuellement le code où l'erreur s'est produite, il est entré normalement et je n'ai pas bien compris la cause ...
(.venv) bash-3.2$ /Users/kazeto/Works/aaa/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/kazeto/Works/aaa/.venv/src/hoge/setup.py'"'"'; __file__='"'"'/Users/kazeto/Works/aaa/.venv/src/hoge/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(_le__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
running develop
running egg_info
creating hoge.egg-info
writing hoge.egg-info/PKG-INFO
writing dependency_links to hoge.egg-info/dependency_links.txt
writing top-level names to hoge.egg-info/top_level.txt
writing manifest file 'hoge.egg-info/SOURCES.txt'
reading manifest file 'hoge.egg-info/SOURCES.txt'
writing manifest file 'hoge.egg-info/SOURCES.txt'
running build_ext
Creating /Users/kazeto/Works/aaa/.venv/lib/python3.7/site-packages/hoge.egg-link (link to .)
Adding hoge 0.0.1 to easy-install.pth file
Installed
Et quand j'ai regardé dans .venv, j'ai trouvé des outils de configuration.
Pour le moment, installez-le en ajoutant setuptools à build-system avec pyproject.toml de git repo (hoge dans ce cas).
[build-system]
requires = ["poetry>=1.00"]
build-backend = "poetry.masonry.api"
[build-system]
requires = ["poetry>=1.00", "setuptools"]
build-backend = "poetry.masonry.api"
J'ai trouvé un problème maintenant. La version de la poésie est différente, mais c'est probablement celle-ci. https://github.com/python-poetry/poetry/issues/3001
Recommended Posts