我尝试使用安装 python 包(BentoML)pip install bentoml
,我收到以下错误,该错误给出了ModuleNotFoundError: No module named 'wrapt'
。但是,那wrapt
模块实际上包含在我的site-packages
文件夹,所以有一个pip install wrapt
结果是我已经收到的消息wrapt
安装。
我可以使用 pip 安装其他软件包,但是alembic
包导致此问题。我能够使用 Anaconda Python 使用 pip 进行安装,但我希望它与此 Python 版本一起安装。最好的前进方向是什么?
我在 Windows 10 设备上使用 Python 3.8.1。
ERROR: Command errored out with exit status 1:
command: 'c:\users\username\appdata\local\programs\python\python38\python.exe' 'c:\users\username\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\user~1.lastname\AppData\Local\Temp\tmpd30adik_'
cwd: C:\Users\username\AppData\Local\Temp\pip-install-qers2adl\alembic
Complete output (14 lines):
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "c:\users\username\appdata\local\programs\python\python38\lib\site.py", line 580, in <module>
main()
File "c:\users\username\appdata\local\programs\python\python38\lib\site.py", line 573, in main
execsitecustomize()
File "c:\users\username\appdata\local\programs\python\python38\lib\site-packages\certifi_win32\bootstrap.py", line 37, in _execsitecustomize
_register_bootstrap_functions()
File "c:\users\username\appdata\local\programs\python\python38\lib\site-packages\certifi_win32\bootstrap.py", line 25, in _register_bootstrap_functions
from . import wrapt_certifi
File "c:\users\username\appdata\local\programs\python\python38\lib\site-packages\certifi_win32\wrapt_certifi.py", line 3, in <module>
import wrapt
ModuleNotFoundError: No module named 'wrapt'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\username\appdata\local\programs\python\python38\python.exe' 'c:\users\username\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\user~1.lastname\AppData\Local\Temp\tmpd30adik_' Check the logs for full command output.
使用另一个版本的 Python 安装。打开 Anaconda 提示符(或同一设备上的其他版本的 Python),然后运行:
pip install alembic --target="c:\users\username\appdata\local\programs\python\python38\lib\site-packages"
这与我在尝试卸载/重新安装wrapt后破坏Python时使用的方法相同。另一个 Python 版本将 alembic 安装到正确的位置,并且原始安装可以正常工作。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)