"pip install models"失败,错误代码 1"没有名为 'base' 的模块



在Windows 10 上使用Python 3.9

我需要导入模块";TSheets";但它在它的一个依赖项上抛出了一个异常:

from tsheets.api import TSheets

出现异常:ModuleNotFoundError:没有名为"models"的模块

当我尝试安装型号

pip install models

我得到输出

Collecting models
Using cached models-0.9.3.tar.gz (16 kB)
ERROR: Command errored out with exit status 1:
command: 'c:python39python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\rober\AppData\Local\Temp\pip-install-utzl8ihq\models_a160fe5c40f44b6180918e508f09440a\setup.py'"'"'; __file__='"'"'C:\Users\rober\AppData\Local\Temp\pip-install-utzl8ihq\models_a160fe5c40f44b6180918e508f09440a\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersroberAppDataLocalTemppip-pip-egg-info-ijs4wmiu'
cwd: C:UsersroberAppDataLocalTemppip-install-utzl8ihqmodels_a160fe5c40f44b6180918e508f09440a
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersroberAppDataLocalTemppip-install-utzl8ihqmodels_a160fe5c40f44b6180918e508f09440asetup.py", line 25, in <module>
import models
File "C:UsersroberAppDataLocalTemppip-install-utzl8ihqmodels_a160fe5c40f44b6180918e508f09440amodels__init__.py", line 23, in <module>
from base import *
ModuleNotFoundError: No module named 'base'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/92/3c/ac1ddde60c02b5a46993bd3c6f4c66a9dbc100059da8333178ce17a22db5/models-0.9.3.tar.gz#sha256=b5aa29c6b57a667cda667dd9fbd33bbd15c14cc285e57dda64f4f4c0fd35e0ae (from https://pypi.org/simple/models/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我在Windows上看到过类似的问题,结果是路径问题,但我不确定如何解决这种特殊情况。

我的Python 3.9安装路径为C:\Python39,以避免任何Windows用户问题。

当我尝试时也会出现错误

pip install base

谢谢你的任何想法或建议!

PyPI上的models包与TSheets无关。请参阅本期:

https://github.com/TSheetsTeam/api_python/issues/7

根据一条评论,从github回购安装它应该会修复它:

pip install --upgrade git+https://github.com/TSheetsTeam/api_python.git@301666970a2b70bb43b712923b8e48c412fda13a#egg=tsheets

相关内容

最新更新