Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'distutils' | Installation error #73

Open
Elwii04 opened this issue Aug 25, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@Elwii04
Copy link

Elwii04 commented Aug 25, 2024

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 "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1304, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1325, in _find_and_load_unlocked
File "", line 929, in _load_unlocked
File "", line 994, in exec_module
File "", line 488, in call_with_frames_removed
File "C:\Users\elias\AppData\Local\Temp\tmpn8ves3cz.venv\Lib\site-packages\setuptools_init
.py", line 10, in
import distutils.core
ModuleNotFoundError: No module named 'distutils'

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

@Elwii04 Elwii04 added the bug Something isn't working label Aug 25, 2024
@Elwii04 Elwii04 changed the title Bug Report | ADD A SHORT SUMMARY OF THE BUG HERE ModuleNotFoundError: No module named 'distutils' | Installation errror Aug 25, 2024
@Elwii04 Elwii04 changed the title ModuleNotFoundError: No module named 'distutils' | Installation errror ModuleNotFoundError: No module named 'distutils' | Installation error Aug 25, 2024
@frutiemax92
Copy link

frutiemax92 commented Aug 29, 2024

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.

@skerit
Copy link

skerit commented Nov 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants
@skerit @JosephLai241 @Elwii04 @frutiemax92 and others