Are you able to tell me why I cannot use the request_kerberos module ? this is my code:
from django.http import HttpResponseNotFound ,HttpResponseRedirect
import requests
from requests_kerberos import HTTPKerberosAuth, OPTIONAL
I have already installed this module ,but when I'm opening the webpage I see that:
No module named winkerberos
I've checked the code and the problem is here ,kerberos.py file, first 4 lines:
try:
import kerberos
except ImportError:
import winkerberos as kerberos
winkerberos is for Windows OS and I'm using the CentOS
So, why my system cannot import that module ?
Related
Hi I'm using ebooklib in python and I'm getting this error
ModuleNotFoundError: No module named 'ebooklib'
I have successfully installed this library and it appears in my pip3 packages list.
I'm importing this in my python file like this
import os
import logging
import sys
import json
import traceback
from ast import literal_eval
from htmlparse import MyHTMLParser
from ebooklib import epub
I don't know what's wrong.
I had the same issue & fixed it by adding:
> export PYTHONPATH="/usr/local/lib/python3.8/site-packages:$PYTHONPATH"
to my .bash_profile file.
To see where your ebooklib is installed to
print(ebooklib.__file__)
I am trying to run a program. It said in it's readme to install requirements first, so I did and it installed pyforms and python_docx
But now when I execute command
python
and i get the error ModuleNotFoundError: No module named 'pyforms.gui'
How can that be fixed?
I tried manually installing pyforms-gui and got message that I already have this module installed.
# -*- coding: utf-8 -*-
import pyforms
from pyforms.controls import ControlButton
from pyforms.gui.controls.ControlEmptyWidget import ControlEmptyWidget #problematic line
from pyforms.gui.controls.ControlProgress import ControlProgress
from generation import Project
from widgets.stage_13 import Stage13Window
from widgets.stage_5 import Stage5Window
from .initial_data_editor import InitialDataEditor
Your import statement is incorrect. The correct imports are given here. Note that pyform.gui is now pyforms_gui.
from pyforms_gui.controls.control_emptywidget import ControlEmptyWidget
from pyforms_gui.controls.control_progress import ControlProgress
I coded this:
from datetime import datetime, timedelta
import json
import time
import urllib2
...
req=urllib2.Request(api_url,binary_data,header)
f=urllib2.urlopen(req)
My python version is the 3.6.5 so i´m supposed to have the urllib2 installed already but every time i get this error:
import urllib2
ModuleNotFoundError: no module named 'URLLIB2'
I changed the name to urllib3 as it appears in my anaconda folder but it crashes anyway....
what do i do?
Urllib2 is meant for Python 2, it is no longer used in Python 3. The standard module is now called urllib (you can find the documentation for it here: https://docs.python.org/3/library/urllib.html).
Try this instead:
import urllib.request
req=urllib.request.Request(api_url,binary_data,header)
f=urllib.request.urlopen(req)
urllib.request.Request(): https://docs.python.org/3/library/urllib.request.html#urllib.request.Request
urllib.request.urlopen():https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen
I'm getting the following error while running a flask app:
from gevent.wsgi import WSGIServer
ModuleNotFoundError: No module named 'gevent.wsgi'
gevent is already installed and the requirement is satisfied.
Pip version is 10.11 and Python 3.6.
OS: Windows 10 x64
Using Anaconda VM
This same code worked in another machine, so somewhere I am missing configuration, but I can't track/find it.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import json
from pprint import pprint
from rasa_core.channels import HttpInputChannel
from rasa_core import utils
from rasa_core.agent import Agent
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.channels.channel import UserMessage
from rasa_core.channels.direct import CollectingOutputChannel
from rasa_core.channels.rest import HttpInputComponent
from flask import Blueprint, request, jsonify, abort
def run(serve_forever=True):
#path to your NLU model
interpreter = RasaNLUInterpreter("models/nlu/default/current")
# path to your dialogues models
agent = Agent.load("models/dialogue", interpreter=interpreter)
#http api endpoint for responses
input_channel = SimpleWebBot()
if serve_forever:
agent.handle_channel(HttpInputChannel(5004, "/chat", input_channel))
return agent
if __name__ == '__main__':
utils.configure_colored_logging(loglevel="INFO")
run()
Try using:
from gevent.pywsgi import WSGIServer
Instead of:
from gevent.wsgi import WSGIServer
The import statement you quoted needs to be updated to:
from gevent.pywsgi import WSGIServer
The gevent.wsgi module has been deprecated and was removed when gevent 1.3 was released. Its replacement is the gevent.pywsgi module, which has been around for some time.
It looks like in your case, the rasa-core library you're using is the one with the bad import line. This was fixed starting in the 0.9.0 release, so you should update that dependency to a newer version.
I've deployed my application to AWS Lambda with Zappa. The deployment went fine without any issues. But when I try to reach the app via AWS API Gateway I get a 500 response.
The logs says
Unable to import module 'handler': No module named builtins
The environment runs on Python 2.7. I've added future to the Pipfile but it still won't work.
When I check the code in Lambda I can see the following code
from __future__ import unicode_literals
import base64
import boto3
import collections
import datetime
import importlib
import inspect
import json
import logging
import os
import sys
import traceback
import zipfile
from builtins import str
I can't find what can be wrong. Does anyone have a clue?
I solved the problem. I'm using pipenv to install my packages, but for some reason the packages wasn't installed inside the virtual environment, which made Zappa to not include them to AWS Lambda. I had to install them manually in PyCharm by going through Settings > Project > Project Interpreter and add the packages there. Thanks for your help.