Python Forum
TypeError("index() missing 1 required positional argument: 'pymydb'"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError("index() missing 1 required positional argument: 'pymydb'"
#1
# dbhost is optional, default is localhost
plugin = bottle_pymysql.Plugin( dbuser='nikos', dbpass='*******', dbname='counters', charset = 'utf8' )
app.install(plugin)
 

@app.route( '/' )
@auth_basic(is_authenticated_user)
def index( pymydb ):
 
    pdata = ''
    names = []
 
    pymydb.execute( '''SELECT name, phone, hits, money FROM clients ORDER BY hits DESC''' )
    data = pymydb.fetchall()
Error:
TypeError("index() missing 1 required positional argument: 'pymydb'",) Traceback: Traceback (most recent call last): File "/usr/lib64/python3.6/site-packages/bottle.py", line 862, in _handle return route.call(**args) File "/usr/lib64/python3.6/site-packages/bottle.py", line 1740, in wrapper rv = callback(*a, **ka) File "/usr/lib64/python3.6/site-packages/bottle.py", line 2690, in wrapper return func(*a, **ka) TypeError: index() missing 1 required positional argument: 'pymydb'
Can you help me fix this error?
index() has as an argument the bottle_pymysql keyword 'pymydb' but i'am not calling this function from within myscript it supposed to be run when script starts.

Why am i getting thsi error?
Reply
#2
Hello, any thoughts as to why i'm getting thsi error?
Reply
#3
Can you please provide minimal, runnable code that reproduces this issue?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Django views : positional argument ghoul 0 1,423 Nov-15-2021, 06:02 PM
Last Post: ghoul
  IndexError: list index out of range" & "TypeError: The view function f: Flask Web App joelbeater992 5 3,454 Aug-31-2021, 08:08 PM
Last Post: joelbeater992
  TypeError: to_capabilities() missing 1 required positional argument: 'self' OceansBlue 2 5,191 Dec-03-2020, 12:08 AM
Last Post: OceansBlue
  TypeError: missing 1 required positional argument (word counter Django app) Drone4four 2 14,532 Jul-11-2019, 09:34 PM
Last Post: Drone4four
  TypeError: get_names() takes 0 positional arguments but 1 was given Truman 2 10,162 Aug-15-2018, 10:32 PM
Last Post: Truman
  TypeError: Method takes takes exactly 1 argument but 2 given pras120687 1 9,077 Dec-15-2016, 07:10 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020