Top "Python-module" questions

A module is a file containing Python definitions and statements.

ImportError: No module named utils

I'm trying to import a utilities file but running into a weird error only when I run the code through …

python python-2.7 import module python-module
Reload a Module in Python 3.4

I know this might sound like a really stupid question but whatever. I've made a small script in Python and …

python python-3.x python-3.4 python-module
Simple data validation

I'm writing a python module that will contain some functions that will manipulate a mongodb database. How can I go …

python python-module validation
How to reload python module imported using `from module import *`

I saw in this useful Q&A that one can use reload(whatever_module) or, in Python 3, imp.reload(…

python python-import python-module
How do I extend a python module? Adding new functionality to the `python-twitter` package

What are the best practices for extending an existing Python module – in this case, I want to extend the python-twitter …

python module tweepy python-module python-twitter
__init__.py can't find local modules

Borrowing a simplified example at http://pythoncentral.io/how-to-create-a-python-package/ I have an analogous file structure as follows, where Mammals.py …

python packages init python-module
Can modules have properties the same way that objects can?

With python properties, I can make it such that obj.y calls a function rather than just returning a value. …

python properties python-module
ImportError: No module named backend_tkagg

I have such imports and code: import pandas as pd import numpy as np import statsmodels.formula.api as sm …

python numpy module pycharm python-module
Importing installed package from script raises "AttributeError: module has no attribute" or "ImportError: cannot import name"

I have a script named requests.py that imports the requests package. The script either can't access attributes from the …

python exception python-module shadowing
Python: What's the difference between __builtin__ and __builtins__?

I was coding today and noticed something. If I open a new interpreter session (IDLE) and check what's defined with …

python python-3.x python-2.7 language-design python-module