dlib and django. how to integrate and import dlib into django
NickName:Axil Ask DateTime:2018-01-14T06:42:29

dlib and django. how to integrate and import dlib into django

I am trying to use dlib in my django project. I am using aws ubuntu, but I was not able to use pip dlib, so I compiled directly according davisking instruction to use this PR https://github.com/davisking/dlib/pull/1040. So I was success to install compile dlib and install in my ubuntu.

Now is how to use dlib in django. I tried "import dlib" but its not recognized.

This is how I install dlib and last part of the execution.

$ python setup.py install
.....
.....
Processing dlib-19.8.99-py2.7-linux-x86_64.egg
creating /usr/local/lib/python2.7/dist-packages/dlib-19.8.99-py2.7-linux-x86_64.egg
Extracting dlib-19.8.99-py2.7-linux-x86_64.egg to /usr/local/lib/python2.7/dist-packages
Adding dlib 19.8.99 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/dlib-19.8.99-py2.7-linux-x86_64.egg
Processing dependencies for dlib==19.8.99
Finished processing dependencies for dlib==19.8.99

settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    ... 
    'mapwidgets',
    'dlib',
]

but it came out with errors below. removing this it still does not recognize "import dlib"

Traceback (most recent call last):
  File "manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)
  File "/home/deploy/somedotcom/somedotcomenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/deploy/somedotcom/somedotcomenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/home/deploy/somedotcom/somedotcomenv/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/deploy/somedotcom/somedotcomenv/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/deploy/somedotcom/somedotcomenv/lib/python3.5/site-packages/django/apps/config.py", line 94, in create
    module = import_module(entry)
  File "/home/deploy/somedotcom/somedotcomenv/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'dlib'

How can I start to use dlib in my django project, what is the steps now to import dlib ?

Copyright Notice:Content Author:「Axil」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/48244971/dlib-and-django-how-to-integrate-and-import-dlib-into-django

More about “dlib and django. how to integrate and import dlib into django” related questions

dlib and django. how to integrate and import dlib into django

I am trying to use dlib in my django project. I am using aws ubuntu, but I was not able to use pip dlib, so I compiled directly according davisking instruction to use this PR https://github.com/dav...

Show Detail

unable to import dlib in python

I successfully installed dlib for python, following instructions here. However, when I try to import the library I get this message: &gt;&gt;&gt; import dlib Traceback (most recent call last): ...

Show Detail

Pycharm does not import dlib

I just wanted to install dlib on my Windows 10. I installed cmake and MS Visual 14 2015, which is needed to compile it. So i opened my Anaconda Enviroment and typed pip install dlib it took a while...

Show Detail

Unable to integrate Dlib library in iOS app

I am trying to integrate dlib c++ library in my iOS project. When I add dlib I have to update compiler settings and compiler flags. I followed below guide: https://stackoverflow.com/a/53277024/1030...

Show Detail

How to install dlib in django azure web app service

I want to publish a django web app in azure that uses dlib and opencv for processing images When trying to deploy the app through local code, it fails with dlib unable to install due to cmake not...

Show Detail

Successfully installed dlib still dlib.DLIB_USE_CUDA returning false

I am trying to use GPU for @ageitgey face recognition api I installed and compiled dlib successfully during installation of dlib I got Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA...

Show Detail

dlib build fail, cannot import dlib

I'm trying to install dlib onto cloud9, but I keep getting this error. c++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropri...

Show Detail

The dlib library does not import in anaconda

I added the dlib library and it is shown in the environments in anaconda, but every time I run the code an error is showing up: ModuleNotFoundError Traceback (most recent call...

Show Detail

Dlib ImportError in Windows 10 on line _dlib_pybind11 import *, DLL Load Failed

I am able to successfully install Dlib with CUDA support in Windows 10 but getting an error during "import dlib" in my python code of computer vision project. Environment: Windows 10, Python 3.7.6 (

Show Detail

unable to import dlib in python(and restarting installation?)

I previously had the same issue with a different error here and thought it would be appropriate to ask a separate question. import dlib File "/usr/local/lib/python2.7/site-packages/dlib/__init_...

Show Detail