python 安装带有诗歌的jupyterlab时出错

t3irkdon  于 2023-02-18  发布在  Python
关注(0)|答案(2)|浏览(139)

我无法使用诗歌完成JupyterLab。我一直收到此错误。我已尝试通过以下方式删除缓存:

rm -rf ~/Library/Caches/pypoetry/artifacts/*

以及

poetry cache clear pypi --all

但我一直收到以下错误:

$ poetry add --group dev jupyterlab    
                                                                             
Using version ^3.6.1 for jupyterlab

Updating dependencies
Resolving dependencies... (2.6s)

Package operations: 12 installs, 0 updates, 0 removals

  • Installing y-py (0.5.5): Failed

  CalledProcessError

  Command '['/Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9', '--no-deps', '/Users/mc/Library/Caches/pypoetry/artifacts/be/5d/9c/38ed00c38e66f11b3f1295c0b4fa2565c954b8e0c8d63deac26e996efa/y_py-0.5.5.tar.gz']' returned non-zero exit status 1.

  at /opt/homebrew/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│ 
       532│ 

The following error occurred when trying to handle this error:

  EnvCommandError

  Command ['/Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9', '--no-deps', '/Users/mc/Library/Caches/pypoetry/artifacts/be/5d/9c/38ed00c38e66f11b3f1295c0b4fa2565c954b8e0c8d63deac26e996efa/y_py-0.5.5.tar.gz'] errored with the following return code 1, and output: 
  Processing /Users/mc/Library/Caches/pypoetry/artifacts/be/5d/9c/38ed00c38e66f11b3f1295c0b4fa2565c954b8e0c8d63deac26e996efa/y_py-0.5.5.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: subprocess-exited-with-error
    
    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [6 lines of output]
        
        Cargo, the Rust package manager, is not installed or is not on PATH.
        This package requires Rust and Cargo to compile extensions. Install it through
        the system's package manager or via https://rustup.rs/
        
        Checking for Rust toolchain....
        [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.
  hint: See above for details.
  

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/env.py:1540 in _run
      1536│                 output = subprocess.check_output(
      1537│                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1538│                 )
      1539│         except CalledProcessError as e:
    → 1540│             raise EnvCommandError(e, input=input_)
      1541│ 
      1542│         return decode(output)
      1543│ 
      1544│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

The following error occurred when trying to handle this error:

  PoetryException

  Failed to install /Users/mc/Library/Caches/pypoetry/artifacts/be/5d/9c/38ed00c38e66f11b3f1295c0b4fa2565c954b8e0c8d63deac26e996efa/y_py-0.5.5.tar.gz

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/pip.py:58 in pip_install
       54│ 
       55│     try:
       56│         return environment.run_pip(*args)
       57│     except EnvCommandError as e:
    →  58│         raise PoetryException(f"Failed to install {path.as_posix()}") from e
       59│

环境信息

$ poetry env info                                                                                                           

Virtualenv
Python:         3.9.16
Implementation: CPython
Path:           /Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9
Executable:     /Users/mc/Library/Caches/pypoetry/virtualenvs/showcase-project-lis5iaDt-py3.9/bin/python
Valid:          True

System
Platform:   darwin
OS:         posix
Python:     3.9.16
Path:       /opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9
Executable: /opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9

我怎样才能用y_py包解决这个问题呢?我真的需要安装rust才能像消息中说的那样使用jupyterlab和诗歌吗?

qlvxas9a

qlvxas9a1#

jupyterLab最新版本似乎有一个bug
https://github.com/jupyterlab/jupyterlab/issues/12436
只需安装jupyterlab旧版本:
poetry add --group dev jupyterlab==3.5.2

pprl5pva

pprl5pva2#

你需要在本地安装铁 rust 和货物来运行这个
rustup is an installer for the systems programming language之后,尝试运行poetry add --group dev jupyterlab

相关问题