我正在尝试使用 PIP 安装 jupyter。我在 Windows 10 Enterprise 上运行 python 3.12.0、pip 23.2.1。
我从 pip install jupyter 收到以下错误
Collecting pywinpty (from jupyter-server<3,>=2.4.0->notebook->jupyter)
Using cached pywinpty-2.0.11.tar.gz (26 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... 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]
然后我尝试安装 Cargo 和 Rust 包。我能够安装 Cargo,但 pip install Rust 出现以下错误
PS C:\Users\moodya03> pip install Rust
Collecting Rust
Using cached RUST-1.3.1-py3-none-any.whl (49 kB)
Collecting pysam (from Rust)
Using cached pysam-0.22.0.tar.gz (4.6 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [39 lines of output]
# pysam: cython is available - using cythonize if necessary
# pysam: htslib mode is shared
# pysam: HTSLIB_CONFIGURE_OPTIONS=None
'.' is not recognized as an internal or external command,
operable program or batch file.
'.' is not recognized as an internal or external command,
operable program or batch file.
Makefile:142: htscodecs.mk: No such file or directory
make: uname: Command not found
Makefile:326: Extraneous text after `else' directive
Makefile:329: Extraneous text after `else' directive
Makefile:329: *** only one `else' per conditional. Stop.
# pysam: htslib configure options: None
Traceback (most recent call last):
File "C:\Users\moodya03\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\moodya03\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\moodya03\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\moodya03\AppData\Local\Temp\1\pip-build-env-s8kcfoba\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\moodya03\AppData\Local\Temp\1\pip-build-env-s8kcfoba\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
self.run_setup()
File "C:\Users\moodya03\AppData\Local\Temp\1\pip-build-env-s8kcfoba\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "C:\Users\moodya03\AppData\Local\Temp\1\pip-build-env-s8kcfoba\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "<string>", line 442, in <module>
File "<string>", line 82, in run_make_print_config
File "C:\Users\moodya03\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\moodya03\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['make', '-s', 'print-config']' returned non-zero exit status 2.
[end of output]
有人可以建议一种解决方法来安装不需要 Anaconda 的 jupyter 吗?
解决步骤
pywinpty 包需要 Rust 和 Cargo 来编译扩展。这些工具无法使用 pip 安装。您可以从 Rust 官方网站下载它们并将它们添加到您的 PATH 中。
。