No module named 'sklearn' while running django server - django

I saved a model using joblib and was trying to run server using but it shows no module as sklearn even though it is downloaded in the environment, can anyone please help?

Related

compiled django application fails to run ASGI channels

I'm building a django application using Pyinstaller.
When I run the application i get an error from dapne server.
"daphne\server.py:13: UserWarning: Something has already installed a non-asyncio Twisted reactor. Attempting to uninstall it; you can fix this warning by importing daphne.server early in your codebase or finding the package that imports Twisted and importing it later on."
In addition, when I compare the console log of the EXE application and a regular run of the django application I notice the following difference.
In the regular run which works as expected I see the following print:
"Django version 2.1.5, using settings 'cfehome.settings'
Starting ASGI/Channels version 2.1.5 development server at http://0.0.0.0:8000/"
however, when I run the application from the EXE I see:
"Django version 2.1.5, using settings 'cfehome.settings'
Starting development server at http://0.0.0.0:8000/"
Appreciate any lead to understand this behavior and ways to fix it.
I know this is old but for others seeking answer. There's a simple fix:
Before importing raven in settings.py, import daphne.server So, your settings.py will look like this:
import daphne.server
import raven
For further information you can read: https://github.com/django/channels/issues/793
I hope it will help.

django image upload cannot import name _imaging

uploading image in DJANGO web app hosted in azure is not working it is showing me an error
error cannot import name _imaging
but it works fine in local machine. I tried installing different version of pillow but it still displaying the error
i have a model in django that accepts text and image i am actually trying this from django admin and also it works fine locally i dont know what happed when i ship the code it displays the above error.i think the problem is with the azure
Please see my previous case : install odbc driver to azure app service to install pillow package in your azure django app.
In addition , as #Andrey said you could check if PIL and Pillow both installed in your django app via KUDU. Please refer to this case :ImportError: cannot import name _imaging.
Hope it helps you.
On Windows install pillow from .exe package

Flask running on a different console?

I am using Flask using pythonanywhere (https://www.pythonanywhere.com) and I noticed that everytime I launch a Flask application, it runs on Python3.4 console.
Is it possible to switch the console such that the Flask application I'm building would run on different python consoles such as python 2.7?
The reason is that one of the libraries I need to import is cv2 (opencv) and python3.4 console does not seem to have it installed while python 2.7 does.
Does anyone have any idea of how to do this?
Thank you in advance!

Django-fobi on google app engine

I am successfully able to install django-fobi in my virtual environment but when I hit localhost:8080/admin it gives me the following error:
ImportError: No module named fobi.contrib.plugins.form_handlers.mail
I get this error when i run my django project on google app engine.
You have likely configured something wrong. Could you post your project setup somewhere?

webfaction hosted django app, shopify module will not import

I've recently created a site with a django app hosted by webfaction. In general, things are running as expected, but I am also trying to use the ShopifyAPI, and get "Import error, no module named shopify" traced to one of my views.py. Everything worked when developing on localhost.
I SSHed into the host server and tried to install the ShopifyAPI with easy_install. It seemed to have reported being successfully installed, but I'm not sure if this actually does anything real on an external server?
Does anybody have suggestions? Any limitations on ShopifyAPI that I may not have considered?
Thanks!
The easy_install command will install the module for Python2.4. You are likely using Python2.6 or Python2.7. If you are using Python2.6, enter:
easy_install-2.6 ShopifyAPI instead of easy_install ShopifyAPI.
If you are using Python2.7, enter:
easy_install-2.7 ShopifyAPI insead of easy_install ShopifyAPI.
You can read more about using easy_install on Webfaction here
After installing the API, restart your Apache instance and it should see the module as expected.