我尝试使用pip install bentoml安装python包(BentoML),并收到以下错误消息,其中给出了一个ModuleNotFoundError: No module named 'wrapt'。但是,wrapt模块实际上包含在我的site-packages文件夹中,因此pip install wrapt会显示一条消息,表明我已经安装了wrapt。
我可以使用pip安装其他包,但是alembic包导致了这个问题。我可以通过我的Anaconda Python使用pip进行安装,但我希望它与这个Python版本一起安装。最好的前进方式是什么?
我在Windows10设备上使用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.发布于 2020-07-07 05:22:00
使用其他版本的Python进行安装。打开Anaconda提示符(或同一设备上的另一个Python版本),然后运行:
pip install alembic --target="c:\users\username\appdata\local\programs\python\python38\lib\site-packages"
这与我在尝试卸载/重新安装wrapt后中断Python时使用的方法相同。另一个Python版本会将alembic安装到正确的位置,并且原始安装可以正常工作。
https://stackoverflow.com/questions/62680281
复制相似问题