Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tornado Error In database.py line 58 - NameError global name 'CONVERSIONS' is not defined

Tags:

python

tornado

I'm trying to run the Tornado Demo 'Blog'. I've changed the database options in the blog.py file. but when i try to run the blog.py file i get the following error!!enter image description here

blog.py file link

database.py file link

What needs to be done to get past this error??

like image 961
4sh1sh Avatar asked May 18 '12 06:05

4sh1sh


People also ask

How to avoid global name 'Unicode' is not defined error in Python?

In Python 3.x, the unicode () function has been replaced with the str () function. So, to avoid the NameError: global name 'unicode' is not defined error , you can use the str () function instead of the unicode () function, as shown below.

Why do I get a variable name error in Python?

In most cases, this error is triggered when Python sees a variable name (Global or Local) and doesn't know what it's for. These errors can happen if you forget to initialize a variable , if you misspell a variable, or if you misspell a reserved word such as "True".

Can I use filenotfounderror in dataloader?

Add FileNotFoundError for compatibility with Python 2 and use in dataloader. Fixes pytorch#6932 Add FileNotFoundError for compatibility with Python 2 and use in dataloader. Fixes #6932 Add FileNotFoundError for compatibility with Python 2 and use in dataloader.


2 Answers

I met the same problem. If you're using Ubuntu, try "sudo apt-get install python-MySQLdb"

like image 90
satgi Avatar answered Sep 19 '22 00:09

satgi


Install MySQLdb (required by tornado.database).

like image 41
Cole Maclean Avatar answered Sep 19 '22 00:09

Cole Maclean