Tin Nguyen
Tin Nguyen

Reputation: 429

Receiving EnvCommandError when run poetry install on Apple M1 MacOs Monterey

I'm facing the issue when running poetry install command in my new Macbook Pro using Apple M1 chip and MacOS Monterey. I tried many suggestions so far but still cannot make it fixed. Python version: 3.8.12

>>> poetry install                     
Installing dependencies from lock file

Package operations: 20 installs, 0 updates, 0 removals

  • Installing scipy (1.6.0): Failed

  EnvCommandError

  Command ['/Users/<retacted>/Library/Caches/pypoetry/virtualenvs/reporting-executor-3zOoUFwf-py3.8/bin/pip', 'install', '--no-deps', 'file:///Users/<retacted>/Library/Caches/pypoetry/artifacts/e2/fc/a9/d781fc7053c9e0aa0b94b47220fee30ba4ef114e7d11b36b3cc68b1b95/scipy-1.6.0.tar.gz'] errored with the following return code 1, and output: 
  Processing /Users/<retacted>/Library/Caches/pypoetry/artifacts/e2/fc/a9/d781fc7053c9e0aa0b94b47220fee30ba4ef114e7d11b36b3cc68b1b95/scipy-1.6.0.tar.gz
    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 metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /Users/<retacted>/Library/Caches/pypoetry/virtualenvs/reporting-executor-3zOoUFwf-py3.8/bin/python /Users/<retacted>/Library/Caches/pypoetry/virtualenvs/reporting-executor-3zOoUFwf-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /var/folders/54/n12zwf1n74vg5knvnd37ph880000gp/T/tmpusexpj06
         cwd: /private/var/folders/54/n12zwf1n74vg5knvnd37ph880000gp/T/pip-req-build-xbw8rqq2
    Complete output (4 lines):
    setup.py:461: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /private/var/folders/54/n12zwf1n74vg5knvnd37ph880000gp/T/pip-modern-metadata-1_oeqwwo'), proceeding with generating Cython sources and expanding templates
      warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
    Error: 'None' must be installed before running the build.

Here is what I tried:

error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      setup.py:461: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /private/var/folders/54/n12zwf1n74vg5knvnd37ph880000gp/T/pip-modern-metadata-rsi6te2b'), proceeding with generating Cython sources and expanding templates
        warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
      Error: 'None' must be installed before running the build.
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

Upvotes: 1

Views: 4989

Answers (1)

Hans Bambel
Hans Bambel

Reputation: 956

We had a similar issue and it seems to be a Python version issue: https://github.com/python-poetry/poetry/issues/2629

We downgraded to Python 3.7 for example. Maybe try other versions that is still fine for your project.

Upvotes: 1

Related Questions