I am making a program that displays the average number of machines built over a certain number of days. The company gave me some code to work with but it says
"ModuleNotFoundError: No module named 'app'"
and I am pretty sure I downloaded Flask correctly. I already tried uninstalling Flask and reinstalling it. Does anyone have any idea what this error is caused by and how to fix it?
Here's the directory:
The 'app' folder:
The stuff I imported:
i got what you are doing.. you do not need to write the folder name for importing files
you can write
import queries
not
from app import queries
no need to use import app from app too
Related
I am trying to develop a localhost website but now I got this error:
ImportError: cannot import name '_encode_idna' from partially initialized module 'werkzeug._internal' (most likely due to a circular import)
Could anyone help me? Thanks a lot.
You are writing code inside your Flask package. Move your code outside your environment.
You have created file website.py at the path Lib/site-packagese/Flask/ which is wrong. Move your project outside of Lib. More appropriate place would be you home directory or desktop or any other place but not Lib.
I just tried to import app.model.preprocessor and it gave me the following error:
ModuleNotFoundError: No module named 'app.model'
I am using code from a tutorial. Does anyone know why my computer doesn't want to import app.model? I did install app with pip3.
So I figured it out. App is a class written by Siraj. I didn't pull the entire git because I thought this was just using frameworks. Sorry!
So the git contains an app folder with a model folder inside. So it's not the 'app' that is publicly accessible as a framework.
I've been having troubles import pysftp. I currently have a server running some python scripts on a database, and decided to try and update this module which some of the scripts use. It broke a bunch of the scripts and then I had to go back and fix the versioning and to allow everything to function.
So far the only module I'm not able to import or use is pysftp. It throws the attached error. I've tried going into sites-manager and removing the files from there, however it has yet to help. Everything else has been working. Updating doesn't work either.
Any indication on how to resolve this error is greatly appreciated.
Error is:
ImportError: cannot import name util
I haven't been able to find a package called util to install. Please help! Attached link is of the trace.
http://imgur.com/a/9lQUj
I'm working to build a app to upload image to imgur on GAE with python27, I have downloaded some extra modules from github (pyimgur), which require some modules to be in the app directory which I have installed & placed it under LIB directory & I was able to eliminate each error one by one until till last one turned up, I'm not sure how to fix it, as I couldn't find any pip module for it. The error I am getting is
ImportError: No module named termios
So I do I install it? or Include it?
other module required {which I've them installed & placed it under my app directory are}
1.auth
2.decorator
3.httplib2
4.oauth2
5.pyimgur
6.requests
here's :gae error log it's on line 30
It looks like there are a number of pyimgur libraries available. I would make sure that you are using the correct one.
It looks like you are trying to use this library based on the other dependencies you have installed (decorator, oauth2, requests) https://github.com/Damgaard/PyImgur
However, there is no auth module in that library, so line 28 of your uploadimage.py file doesn't make any sense because there is no auth to import.
from pyimgur import auth
Try out the library I linked instead.
It's weird to me that the import fails even when it's in the sys.path.
today, I set up a google app engine django environment on ubuntu in my lab's pc. And it works fine when I checked out the code and ran it in windows(same pc in the lab).
But when I went to the dorm, and checked out the code and start to run, it failed weirdly.
I print the sys.path, like this:
['/home/tower/googlecode/mygae', '/home/tower/googlecode/mygae/.google_appengine', '/home/tower/googlecode/mygae/.google_appengine/lib/antlr3', ...]
and when I ran python complained
from google.appengine.api import apiproxy_stub_map
ImportError: No module named appengine.api
it's easy to know the google module is in the '/home/tower/googlecode/mygae/.google_appengine'
directory, and the__init__.py for each module is present.
So what can be the reason for this weird thing? Or what I messed up probably?
thanks.
Can you import google and google.appengine?
Are you sure interpreter has read and traverse access rights to the module tree?
I had the same problem on Ubuntu when I wanted to play with google.appengine in console. First I tried to fix it by removing the /usr/lib/python2.7/dist-packages/google package altogether but Ubuntu One complained. Finally I resolved it by merging the GAE SDK google package into the package that caused the collision.
The contents of the /usr/lib/python2.7/dist-packages/google dir now look like this:
/google
/appengine
/net
/protobuf
/pyglib
/storage
/__init__.py
/__init__.pyc
Looks like you're getting a module (or package) called 'google' from elsewhere -- perhaps /home/tower/googlecode/mygae -- and THAT google module has no appengine in it. To check, print google.__file__ and if possible google.__path__; that should be informative.
Sometimes you can get an import error for a module when the error is something different, like a syntax error. Try putting
import pdb;pdb.set_trace()
just before the import and then s(tep) into the import, and n(ext) thruogh the module in question to see of you get an error.