Skip to content
Advertisement

Why am I not able to install lmdb using pip?

I’m following the turorial found here: https://realpython.com/storing-images-in-python/.

The first few steps in the tutorial work well; however, when I get to the step

$ pip install lmdb

I get more than 100 errors, and the installer gives up. I’m wondering how to correct this problem.

My entry of the step shown above looks like this in the Pycharm terminal:

(venv) C:UsersUserPycharmProjectsOpenCVExamples>pip install lmdb

After entering the pip command shown above, I see the following on the screen:

Collecting lmdb
Using cached https://files.pythonhosted.org/packages/86/5
/6ad690daeaa00b328606bf2fa435244a11cc2dd9aedac6ef4d2ef2a21f6e/lmdb
0.96.tar.gz
Installing collected packages: lmdb
Running setup.py install for lmdb ... error

Then I get a dump showing the following steps that were taken:

py-lmdb: Using bundled liblmdb; override with LMDB_FORCE_SYSTEM=1.
py-lmdb: Using CPython extension; override with LMDB_FORCE_CFFI=1.
running install
running build
running build_py
creating build
creating buildlib.win32-3.7
creating buildlib.win32-3.7lmdb
copying lmdbcffi.py -> buildlib.win32-3.7lmdb
copying lmdbtool.py -> buildlib.win32-3.7lmdb
copying lmdb_config.py -> buildlib.win32-3.7lmdb
copying lmdb__init__.py -> buildlib.win32-3.7lmdb
copying lmdb__main__.py -> buildlib.win32-3.7lmdb
running build_ext
building 'cpython' extension
creating buildtemp.win32-3.7
creating buildtemp.win32-3.7Release
creating buildtemp.win32-3.7Releaselmdb
creating buildtemp.win32-3.7Releaselib

Next, I get a few warnings then a list of more than 100 errors. The warnings and the first few errors are shown below:

cl : Command line warning D9025 : overriding '/DNDEBUG' with '/UNDEBUG'
cl : Command line warning D9025 : overriding '/W3' with '/w'
error C2146: syntax error: missing ')' before identifier 'uintptr_t'
error C2059: syntax error: ')'
error C2085: '_StackCookie': not in formal parameter list

Finally, I get an error at the end a red font. The final error is:

Command "C:UsersUserPycharmProjectsOpenCVExamplesvenvScript
python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Use
\AppData\Local\Temp\pip-install-227nwnf7\lmdd
\setup.py';f=getattr(tokenize, 'open',
open)(__file__);code=f.read().replace('rn',
'n');f.close();exec(compile(code, __file__, 'exec'))" install --record
C:UsersUserAppDataLocalTe
mppip-record-a9unp95qinstall-record.txt --single-version-externally
managed --compile --install-headers C:UsersUserPycharmProject
OpenCVExamplesvenvincludesitepython3.7lmdb" fai
led with error code 1 in C:UsersUserAppDataLocalTemppip-install
227nwnf7lmdb

Advertisement

Answer

Since nobody has entered an official answer after 2.5 years, I decided to copy the answer given above in the comments by furas:

It seems there is error in C/C++ code. So you can write to author or you may try to use Anaconda which should have precompiled module LMDB and it doesn’t use C/C++ compiler. You can also check on Unofficial Windows Binaries for Python Extension Packages

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement