nameerror

Rails3 and Sass::Plugin::options

丶灬走出姿态 提交于 2020-01-03 12:58:33
问题 When I try to add Sass::Plugin.options[:style] = :compact to environment.rb When I try to start up my server I get: uninitialized constant Sass (NameError) I have added gem 'haml', '3.0.0' to my Gemfile . Anybody ran into this? 回答1: I tried what you described and it worked fine for me. I'm using haml 3.0.4 which is the latest version. You may want to run a gem update haml on your system and try again. The list of changes from 3.0.0 to 3.0.4 are at http://sass-lang.com/docs/yardoc/file.SASS

NameError: name 'pd' is not defined

≯℡__Kan透↙ 提交于 2020-01-03 08:48:09
问题 I am attempting run in Jupyter import pandas as pd import matplotlib.pyplot as plt # plotting import numpy as np # dense matrices from scipy.sparse import csr_matrix # sparse matrices %matplotlib inline However when loading the dataset with wiki = pd.read_csv('people_wiki.csv') # add id column wiki['id'] = range(0, len(wiki)) wiki.head(10) the following error persists NameError Traceback (most recent call last) <ipython-input-1-56330c326580> in <module>() ----> 1 wiki = pd.read_csv('people

calling class from an external module causes NameError, in IDLE it works fine

时光毁灭记忆、已成空白 提交于 2020-01-02 10:05:01
问题 i have the following code in a module called code_database.py class Entry(): def enter_data(self): self.title = input('enter a title: ') print('enter the code, press ctrl-d to end: ') self.code = sys.stdin.readlines() self.tags = input('enter tags: ') def save_data(self): with open('entry.pickle2', 'ab') as f: pickle.dump(self, f) in idle the class-defined methods work fine: >>> import code_database >>> entry = code_database.Entry() >>> entry.enter_data() enter a title: a enter the code,

'NameError: global name is not defined' under pdb, for dictionary that does exist

喜你入骨 提交于 2020-01-01 05:44:06
问题 I've encountered an issue re scopes in a lambda function. I can successfully output foo to stdout but I get an error when using max() including a lambda - see simplified code below... All in all, I am trying find the largest value for a nested key budget within an unknown number of first order keys. (Pdb) foo = self.some_method() # some_method() returns a dict, printed in the next step (Pdb) pp foo {'1': {'count': 1, 'extra_data': {'activity-count': 1, 'budget': 0, [...MORE KEY-VALUE PAIRS

NameError: name 'n' is not defined [duplicate]

前提是你 提交于 2019-12-25 19:04:26
问题 This question already has answers here : input() error - NameError: name '…' is not defined (13 answers) Pycharm Not seeing something as defined when it is (1 answer) Closed 29 days ago . This works in jupyter notebook but when I try to run it from the command line in PyCharm it says that 'n' is undefined. There are other functions that are mentioned at the end but the only one I care about right now is game_rules(game, balance, profit). When I go through the function and press 'n' so the

Python MVC architecture Temperature Conversion: Why am I getting “NameError: global name 'view' is not defined”

岁酱吖の 提交于 2019-12-25 18:24:22
问题 This isn't a difficult question, but I can't wrap my head around it when dealing with MVC architecture (passing arguments between the VIEW, MODEL, and CONTROLLER). Error in question: Exception in Tkinter callback Traceback (most recent call last): File "C:\Python33\lib\tkinter__init__.py", line 1482, in call return self.func(*args) File "C:\Users\Mike\Desktop\code\Assignment 6\glue.py", line 37, in buttonPressed self.model.convertTempF2C(view.fahrenheitEntrySpace.get) NameError: global name

isinstance not working correctly with beautifulsoup(NameError)

杀马特。学长 韩版系。学妹 提交于 2019-12-25 16:58:14
问题 I'm using isinstance to select some html tags and passing them to a Beautifulsoup function. The problem is I keep getting NameErrors from what should be perfectly executable code. def horse_search(tag): return (tag.has_attr('href') and isinstance(tag.previous_element, span)) ... for tag in soup.find_all(horse_search): print (tag) NameError: global name 'span' is not defined Also I'm getting errors from the example code in the documentation of Beautifulsoup using isinstance in conjunction with

Unable to detect face and eye with OpenCV in Python

浪尽此生 提交于 2019-12-25 09:16:00
问题 This code is to detect face and eyes using webcam but getting this error Traceback (most recent call last): File "D:/Acads/7.1 Sem/BTP/FaceDetect-master/6.py", line 28, in <module> eyes = eyeCascade.detectMultiScale(roi) NameError: name 'roi' is not defined but when i use this code do detect faces and eyes in a image its working properly without any error import matplotlib import matplotlib.pyplot as plt import cv2 import sys import numpy as np import os faceCascade = cv2.CascadeClassifier(

NameError says variable is not defined, but only in some places

时间秒杀一切 提交于 2019-12-25 06:57:57
问题 I am trying to implement a keep-alive that sends some data every 30 seconds to keep a telnet connection open. My code calls reinitScore every second. This function will sometimes call calculateWinner , which sends the data through telnet via stelnet.send(data) . The problem is, when I call stelnet.send(data) inside any function, it raises a NameError: global name 'stelnet' is not defined . My questions is: why would stelnet.send(data) work in one place, and not another? Here is the part of my

Python Temperature conversion MVC style: why am I getting “TypeError: buttonPressed() missing 1 required positional argument: 'self'”

瘦欲@ 提交于 2019-12-25 03:27:52
问题 newbie-wanna-be python-programmer here. I had a homework assignment (that I couldn't get) and now that the class is over, I feel comfortable asking for help here. I'm still really curious about this error and what I'm doing wrong... I'm sure it's related to how the CONTROLLER and the VIEW are referring to each other, but I this error is beyond my understanding. I've been stuck on this for about three days. I could really use help- because I really want to understand python and MVC. Please see