attributeerror

IndexError: list index out of range, not sure why

与世无争的帅哥 提交于 2019-12-10 12:36:08
问题 What I would like the program to do is to take sequences related to a certain barcode and perform the defined function (average length and standard deviation of sequences, minus the barcode and non-relevant txt, identified by the same barcode). I have written something similar and based it off the similar program but I keep getting an indexerror. The idea is that all the sequences with the first barcode will be processed as barcodeCounter = 0 and the second one as barcodeCounter = 1, etc.

Using discord.py on linux I get the error 'Bot' object has no attribute 'join_voice_channel'

橙三吉。 提交于 2019-12-08 11:22:52
问题 Code in question: bot = commands.Bot(command_prefix='!') @bot.command(pass_context=True) async def yt(ctx, url): author = ctx.message.author voice_channel = author.voice.channel vc = await bot.join_voice_channel(voice_channel) player = await vc.create_ytdl_player(url, before_options="-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5") player.start() Error I receive: Traceback (most recent call last): File "/home/wilkins30/.local/lib/python3.7/site-packages/discord/ext/commands/core.py

instance has no attribute [closed]

天大地大妈咪最大 提交于 2019-12-08 09:56:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . im new to python and am struggling to understand why i keep getting "AttributeError: worker instance has no attribute 'workerNo'" when i call main(). beltLength = 5 class worker: def __init__(self, wId): workerNo = wId def main(): production_Line = productionLine() workers = [] for index in xrange(0, beltLength

openpyxl+load_workbook+AttributeError: 'NoneType' object has no attribute 'date1904'

自古美人都是妖i 提交于 2019-12-08 04:32:45
问题 When I use openpyxl to load the Excel file( .xlsx), this error displays (the last the link is the sample Excel file): from openpyxl import * wb = load_workbook("D:/develop/workspace/exman/test sample/510001653.xlsx") Traceback (most recent call last): File "", line 1, in File "C:\Python34\lib\site-packages\openpyxl-2.5.0-py3.4.egg\openpyxl\reader\ xcel.py", line 161, in load_workbook parser.parse() File "C:\Python34\lib\site-packages\openpyxl-2.5.0-py3.4.egg\openpyxl\packagi g\workbook.py",

Error in included django template is not rendered

霸气de小男生 提交于 2019-12-07 14:15:56
问题 I have this simple template that uses the imgix plugin like so: // template_b.html {% get_imgix project.picture %} This line causes an error and should be replaced by {% get_imgix project.picture.url %} This piece of code is inside a template that is included: // template_a.html {% include "template_b.html" %} It seems that when the template tags fails, in the first case (an AttributeError is raised), the template is simply ignored. No error is raised if the DEBUG setting is False . While

Scrapy shell return without response

試著忘記壹切 提交于 2019-12-07 07:03:32
问题 I have a little problem with scrapy to crawl a website. I followed the tutorial of scrapy to learn how crawl a website and I was interested to test it on the site 'https://www.leboncoin.fr' but the spider doesn't work. So, I tried : scrapy shell 'https://www.leboncoin.fr' But, I haven't a response of the site. $ scrapy shell 'https://www.leboncoin.fr' 2017-05-16 08:31:26 [scrapy.utils.log] INFO: Scrapy 1.3.3 started (bot: all_cote) 2017-05-16 08:31:26 [scrapy.utils.log] INFO: Overridden

Python AttributeError: module 'string' has no attribute 'maketrans'

 ̄綄美尐妖づ 提交于 2019-12-07 05:10:30
I am receiving the below error when trying to run a command in Python 3.5.2 shell: Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> folder = 'C:/users/kdotz/desktop' >>> f = open(folder + '/genesis.txt', 'r') >>> import operator, time, string >>> start=time.time() >>> genesis = {} >>> for line in f: line=line.split() for word in line: word = word.lower() new_word=word.translate(string.maketrans("",""), string.punctutation) if new_word in genesis: genesis[new_word]+=1 else: genesis

Python Attribute Error when running script: type object 'BaseCommand' has no attribute 'option_list'

自闭症网瘾萝莉.ら 提交于 2019-12-06 23:47:41
问题 I saw this post on how to run a python script from django: http://www.djangotutsme.com/how-to-run-python-script-from-django/ I tried the example but get the following error when running python manage.py runscript myscript . I have Python 2.7, Django 1.10 and django extensions 1.6.1 installed. Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/lib/python2.7/site-packages/Django-1.10.dev20151201151517-py2.7.egg/django/core

AttributeError when importing modules in Python 3

自古美人都是妖i 提交于 2019-12-06 15:48:31
I am trying to write a script that makes use of the json and requests modules. Before I wrote the script, I was playing around with commands on the interactive shell, and since creating an actual file for my code, everything has somehow broken. The first time I ran the code, a pycache folder appeared in the folder and I think that is somehow breaking everthing. The code, when run line by line in the shell, no longer works either with the presence of this pycache folder. My code is as follows: import json import requests r = requests.get('http://api.wunderground.com/api/78c2f37e6d924b1b/hourly

Matplotlib, plotting pandas series: AttributeError: 'tuple' object has no attribute 'xaxis'

早过忘川 提交于 2019-12-06 06:40:52
I am plotting Pandas Series data, which records the sum of "events" each week in 1981. The series is named 'weekly_data'. 1981-03-16 1826 1981-03-23 1895 1981-03-30 1964 1981-04-06 1978 1981-04-13 2034 1981-04-20 2073 1981-04-27 2057 dtype: int64 I would like to place ticks by year, and by week. When I try to plot this, I receive an AttributeError: fig = plt.figure(figsize=(12,5)) ax = plt.subplots(111) plt.plot(weekly_data, color = 'green' ) yloc = YearLocator() mloc = MonthLocator() ax.xaxis.set_major_locator(yloc) ax.xaxis.set_minor_locator(mloc) ax.grid(True) plt.show() The error is