Linked Questions
19 questions linked to/from How to fix "ImportError: No module named ..." error in Python?
0
votes
0
answers
139
views
why i cannot invoke python script which is in the same project? [duplicate]
the project structure is as follows:
src
package1
a.py
c.py
i can import c from a.py, but why there is ImportError: No module named c, when i try to run a.py?
btw, i am using pydev
...
1160
votes
33
answers
1.7m
views
Importing modules from parent folder
I am running Python 2.5.
This is my folder tree:
ptdraft/
nib.py
simulations/
life/
life.py
(I also have __init__.py in each folder, omitted here for readability)
How do I import the ...
23
votes
5
answers
8k
views
Python import precedence: packages or modules?
I wasn't clear how to correctly name this question.
Case 1
Assume that I have the following directory structure.
foo
|
+- bar/__init__.py
|
+- bar.py
If I have
from foo import bar
How do I know ...
1
vote
4
answers
11k
views
Flask is not importing even though I installed it
I'm on Windows 10 and I am using PyCharm to run my application. I'm pretty new to Python and just coding in general.
I typed:
pip install flask
in the cmd prompt but forgot to open cmd prompt under ...
3
votes
2
answers
4k
views
How do I import a local python module when running a python script in Oozie?
I have two python files - my_python_A.py and my_python_B.py. The first file references the second (from my_python_B import *).
I'm executing the first python file from a shell action in Oozie (i.e. ...
John's user avatar
- 1,167
2
votes
1
answer
9k
views
how to unit test the database connection pymysql in python?
I am trying to write unit test case to test the following method by mocking the database. How to mock the database connection without actually connecting to the real database server.I tried with ...
2
votes
2
answers
10k
views
ImportError: No module named ... error in Python - set PYTHONPATH still not working
I have a problem similar to that described here How to fix "ImportError: No module named ..." error in Python? but I cannot fix it with the suggestion to set PYTHONPATH.
my directory looks ...
Ziqi's user avatar
- 2,580
2
votes
0
answers
4k
views
How to fix an "ImportError: No module named numpy" on AWS EC2 Server with AMI Linux but it installed?
For five days or so I could start a script with numpy without problems. I installed it like here in the forum proposed and it worked. when I try to start another python script with numpy today, I got ...
0
votes
1
answer
2k
views
Calling / running external .py files
I have a basic game up and running and I am part way through writing the code for the main menu section for the game which is launched to welcome the user.
I was wondering if it would be possible to ...
0
votes
2
answers
2k
views
ImportError: No module named... After 'sudo pip install..'
Similar to this question, I have problems importing my own modules and get an ImportError: No module named ....
For example, I have a module at myfolder/mymodule.py that I try to load with from ...
1
vote
2
answers
2k
views
"No Module name matrix_factorization_utilities" found
I am a beginner in Machine Learning.
I am getting this error in my machine learning recommendation model "No Module name matrix_factorization_utilities" foundScreen Shot of error.
I am using Python 3 ...
1
vote
1
answer
2k
views
How to use a Python module for your project as a git submodule
I just finished by basic learning of Python and I was trying to build something of my own.
I am making use of PyGithub and this is my source code, picked from here:
#!/usr/bin/python
import ...
0
votes
1
answer
711
views
How to import pyHook on Spyder (Python 3.7)
I'm trying to use pyHook to get my image to change when I click on it with the mouse. But when I run my code, I get an error.
My Code:
from __future__ import print_function
from PIL import Image
...
-3
votes
1
answer
493
views
How do I properly import/use classes and modules I built in Python in other classes/modules? [duplicate]
I am moving from a functional approach to a more object oriented approach for building a library of valuation models for (derivative) financial instruments in Python.
I keep getting error messages ...
0
votes
1
answer
397
views
"ImportError: No module" after uploading to IBM-Cloud
So I have a path structure that looks like this:
~/Dropbox/Coding/Python/Chessbotslack/scripts/Flask_interface.py
~/Dropbox/Coding/Python/Chessbotslack/database/spreadsheets.py
The first line of the ...