草庐IT

require_dependency

全部标签

python - Requirements.txt 大于等于然后小于?

我的需求文件中有这一行django>=1.10,这是否意味着我需要Django版本>=1.10然后低于1.11? 最佳答案 是。pipmanual [doc]有一节关于“需求说明符”的格式。这些记录在PEP-508 [pep]中和PEP-440 [pep]:Thecomparisonoperatordeterminesthekindofversionclause:~=:Compatiblereleaseclause==:Versionmatchingclause!=:Versionexclusionclause,>=:Inclusi

python - 安装 BlueJeans session API 客户端时出现 "pipenv requires an #egg fragment for version controlled dependencies"警告

改编来自https://github.com/bluejeans/api-rest-meetings/tree/master/libs/python#pip-install的说明,在pipenvshell我正在尝试运行pipenvinstallgit+https://github.com/bluejeans/api-rest-meetings.git@pip-repo但是,我收到以下错误消息:⠋WARNING:pipenvrequiresan#eggfragmentforversioncontrolleddependencies.Pleaseinstallremotedependenc

python - 类型错误 : 'in <string>' requires string as left operand, 不是整数

为什么我在非常基本的Python脚本中会收到此错误?错误是什么意思?错误:Traceback(mostrecentcalllast):File"cab.py",line16,inifcabinline:TypeError:'in'requiresstringasleftoperand,notint脚本:importreimportsys#loco=sys.argv[1]cab=6176fileZ=open('cabs.txt')fileZ=list(set(fileZ))forlineinfileZ:ifcabinline:IPaddr=(line.strip().split())pr

python - 子进程 "TypeError: a bytes-like object is required, not ' str'"

我正在使用来自apreviouslyaskedquestionafewyearsago的代码但是,我认为这已经过时了。尝试运行代码时,我收到了上面的错误。我仍然是Python的新手,所以我无法从类似的问题中得到太多的澄清。有谁知道为什么会这样?importsubprocessdefgetLength(filename):result=subprocess.Popen(["ffprobe",filename],stdout=subprocess.PIPE,stderr=subprocess.STDOUT)return[xforxinresult.stdout.readlines()if"

python - Pandas 导入错误 : matplotlib is required for plotting

Pandas无法识别已安装的matplotlib库这是代码importpandasaspdimportnumpyasnpimportmatplotlib.pyplotasplt%matplotlibinlinets=pd.Series(np.random.randn(1000),index=pd.date_range('1/1/2000',periods=1000))ts=ts.cumsum()ts.plot()错误是c:\users\xxxxx\appdata\local\programs\python\python36\lib\site-packages\pandas\plotti

python - 你如何解决错误KeyError : 'A secret key is required to use CSRF.' when using a wtform in flask application?

我一直在尝试使用flask和wtforms以及firebase数据库构建网络应用程序,但我不断收到错误消息“KeyError:‘使用CSRF需要key。’”而且我不知道该怎么做解决它。这是我的代码:fromflaskimportFlask,render_template,requestfromfirebaseimportfirebasefromflask_wtfimportFlaskFormfromflask_wtf.csrfimportCSRFProtect,CSRFErrorfromwtformsimportDateField,StringField,TextAreaFieldfr

python 结构。错误: 'i' format requires -2147483648 <= number <= 2147483647

问题我愿意使用多处理模块(multiprocessing.Pool.starmap())进行特征工程。但是,它给出如下错误消息。我猜这个错误消息是关于输入的大小(2147483647=2^31−1?),因为相同的代码对于输入数据帧的分数(frac=0.05)运行顺利(train_scala,测试,TS).我将数据框的类型转换为尽可能小,但它并没有变得更好。anaconda版本为4.3.30,Python版本为3.6(64位)。并且系统的内存大小超过128GB,超过20个核心。您想提出任何建议或解决方案来克服这个问题吗?如果这个问题是由多处理模块的大数据引起的,我应该使用多少小数据来利用

python - 类型错误 : descriptor 'strftime' requires a 'datetime.date' object but received a 'Text'

我有一个变量testeddate,它有一个文本格式的日期,如4/25/2015。我正在尝试将其转换为%Y-%m-%d%H:%M:%S,如下所示:dt_str=datetime.strftime(testeddate,'%Y-%m-%d%H:%M:%S')但是我遇到了这个错误:TypeError:descriptor'strftime'requiresa'datetime.date'objectbutreceiveda'Text'我该如何解决? 最佳答案 您有一个Text对象。strftime函数需要一个日期时间对象。下面的代码采取一

python - 值错误 : Dependency on app with no migrations: customuser

我正在尝试使用Django框架启动网页。这是我的第一个Web开发项目。创建项目后,我尝试启动一个应用程序,该应用程序利用自定义用户并使用django-registration通过电子邮件验证进行注册。这是我运行managerunserver时发生的情况:这是models.py文件包含的内容:fromdjango.dbimportmodelsfromdjango.contrib.auth.modelsimportAbstractUserfromdjango.utils.translationimportugettext_lazyas_classUser(AbstractUser):use

Python 参数解析 : Mutually exclusive required group with a required option

我试图让一个必需的互斥组具有一个必需的参数。下面是我输入的代码#!/usr/bin/pythonimportargparseimportsys#CheckfortheoptionprovidedaspartofargumentsdefparseArgv():parser=argparse.ArgumentParser()group=parser.add_mutually_exclusive_group()group.add_argument("-v","--verbose",choices=[1,2,3,4],help="Increaseverbosity")group.add_arg