K
K
Konstantin Malyarov2019-01-21 21:25:49
Django
Konstantin Malyarov, 2019-01-21 21:25:49

Module import error in django (ImportError: No module named 'zeep')?

When importing a third-party library, an error occurs:

from django.shortcuts import redirect, HttpResponse
from django.contrib.auth.models import User
import zeep

# Create your views here.


# Create your views here.
def get_ref_book_list(request):
    if request.user.is_authenticated:
        wsdl = 'http://www.soapclient.com/xml/soapresponder.wsdl'
        client = zeep.Client(wsdl=wsdl)
        return HttpResponse(client.service.getRefbookList('my_token'))
    else:
        return redirect('/api-auth/login/', locals())

File "/home/pi/mis_asp/mis_asp/soap/urls.py", line 17, in <module>
    from soap import views
  File "/home/pi/mis_asp/mis_asp/soap/views.py", line 2, in <module>
    import zeep
ImportError: No module named 'zeep'

How to import a library (installed via pip)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2019-01-21
@dimonchik2013

do you use venv?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question