ModuleNotFoundError: No module named 'distutils' | Installation error
DO NOT DELETE THIS TEMPLATE
Describe The Bug
When following the installation guide I get this error:
C:\Users\elias\Downloads\scraper filter\URS>poetry install Installing dependencies from lock file
Package operations: 40 installs, 0 updates, 0 removals
- Installing numpy (1.24.3): Failed
ChefBuildError
Backend 'setuptools.build_meta:legacy' is not available.
Traceback (most recent call last):
File "C:\Users\elias\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyproject_hooks_in_process_in_process.py", line 77, in build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\elias\AppData\Local\Programs\Python\Python312\Lib\importlib_init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
at ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\poetry\installation\chef.py:164 in _prepare 160│ 161│ error = ChefBuildError("\n\n".join(message_parts)) 162│ 163│ if error is not None: → 164│ raise error from None 165│ 166│ return path 167│ 168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
Note: This error originates from the build backend, and is likely not a problem with poetry but with numpy (1.24.3) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "numpy (==1.24.3)"'.
Expected Behavior
--
Actual Behavior
Error on installation
Steps To Reproduce
run: git clone --depth=1 https://github.com/JosephLai241/URS.git cd URS poetry install poetry shell maturin develop --release
When running "poetry shell" it seems to kind of work:
C:\Users\elias\Downloads\scraper filter\URS>poetry shell Spawning shell within C:\Users\elias\Downloads\scraper filter\URS.venv
(urs-py3.12) C:\Users\elias\Downloads\scraper filter\URS>
but when running "maturin develop --release" it does not find command "maturin"
Machine Specs
- Operating System: Windows 10
- Python Version: Python 3.9
Additional Context
N/A
Same error on my side with numpy:
poetry install
Installing dependencies from lock file
Package operations: 40 installs, 0 updates, 0 removals
- Installing numpy (1.24.3): Failed
ChefBuildError
Backend 'setuptools.build_meta:__legacy__' is not available.
Cannot import 'setuptools.build_meta'
at ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\poetry\installation\chef.py:164 in _prepare
160│
161│ error = ChefBuildError("\n\n".join(message_parts))
162│
163│ if error is not None:
→ 164│ raise error from None
165│
166│ return path
167│
168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
Note: This error originates from the build backend, and is likely not a problem with poetry but with numpy (1.24.3) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "numpy (==1.24.3)"'.
I had to reinstall Poetry, delete the lock file to make it work.
The documentation says that URS works on Python 3.11+, but that is a lie. At least: the committed poetry.lock file does not work with Python 3.12. So indeed: just delete that file and try again. That's what fixed it for me.
Had the same issue and was able to resolve by deleting poetry.lock and running poetry install