Top "Nameerror" questions

The Ruby or Python `NameError` exception.

How to convert user input to string in python 2.7

When I enter username = str(input("Username:")) password = str(input("Password:")) and after running the program, I fill in the …

python string python-2.7 user-input nameerror
NameError: name 'now' is not defined

From this source code: def numVowels(string): string = string.lower() count = 0 for i in range(len(string)): if string[i] == "…

python nameerror
Why do I keep getting this "name 'Model' is not defined" error in my Django project?

I've looked through the stackoverflow questions under this topic already and I moved my Trainer class to be above my …

python django model nameerror
Why is my python function not defined, when it exists in the same file?

I have a simple function, which I shall call myFunction. It takes two parameters, performs some calculations on them, and …

python function nameerror defined
Python: Can't import a function from another.py file

I have a file named handshake.py. Where there is a function send_data(argument). I want to import that …

python-2.7 visual-studio importerror scapy nameerror
python className not defined NameError

I have a class which i need to instantiate in order to call a method that it contains. When I …

python class nameerror
python global name 'collections' is not defined even I imported collections

The following is config.py: from collections import OrderedDict def test_config(fileName): tp_dict = collections.OrderedDict() with open("../../config/" + …

python function collections import nameerror
Why do I get NameError: name 'train_test_split' is not defined?

I've been following this tutorial I found online about speech analysis in Deep Learning, it kept giving me the nameerror. …

python deep-learning jupyter-notebook nameerror
Python - NameError: name itemgetter not defined

I just started learning Python came across this very simple code could not get it right: import operator; b=[(5,3),(1,3),(1,2),(2,-1),(4,9)] …

python nameerror
Closing a cx_Oracle Connection While Allowing for a Down Database

The following cx_Oracle code works fine when the database is up: #!C:\Python27 import cx_Oracle try: conn = cx_…

python database-connection cx-oracle nameerror try-finally