Building wheel for hiredis setup py error

Hi, can't install hiredis which fails at building wheel. Please advise. wheel 0.29.0 py36h3597b6d_1 pip install hiredis Collecting hiredis Using cached hiredis-0.2.0.tar.gz Building wheels for ...
pip install hiredis
Collecting hiredis
  Using cached hiredis-0.2.0.tar.gz
Building wheels for collected packages: hiredis
  Running setup.py bdist_wheel for hiredis ... error
  Complete output from command /home/pete/.virtualenvs/test/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fdl026_h/hiredis/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpmbs6wzj5pip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/hiredis
  copying hiredis/version.py -> build/lib.linux-x86_64-3.6/hiredis
  copying hiredis/__init__.py -> build/lib.linux-x86_64-3.6/hiredis
  running build_clib
  building 'hiredis_for_hiredis_py' library
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/vendor
  creating build/temp.linux-x86_64-3.6/vendor/hiredis
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-fWqO4P/python3.6-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c vendor/hiredis/read.c -o build/temp.linux-x86_64-3.6/vendor/hiredis/read.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-fWqO4P/python3.6-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c vendor/hiredis/sds.c -o build/temp.linux-x86_64-3.6/vendor/hiredis/sds.o
  x86_64-linux-gnu-ar rc build/temp.linux-x86_64-3.6/libhiredis_for_hiredis_py.a build/temp.linux-x86_64-3.6/vendor/hiredis/read.o build/temp.linux-x86_64-3.6/vendor/hiredis/sds.o
  running build_ext
  building 'hiredis.hiredis' extension
  creating build/temp.linux-x86_64-3.6/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-fWqO4P/python3.6-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ivendor -I/usr/include/python3.6m -I/home/pete/.virtualenvs/test/include/python3.6m -c src/reader.c -o build/temp.linux-x86_64-3.6/src/reader.o
  In file included from src/reader.h:4:0,
                   from src/reader.c:1:
  src/hiredis.h:4:20: fatal error: Python.h: Nie ma takiego pliku ani katalogu
   #include <Python.h>
                      ^
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for hiredis
  Running setup.py clean for hiredis
Failed to build hiredis
Installing collected packages: hiredis
  Running setup.py install for hiredis ... error
    Complete output from command /home/pete/.virtualenvs/test/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fdl026_h/hiredis/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-cb3nah3u-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pete/.virtualenvs/test/include/site/python3.6/hiredis:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/hiredis
    copying hiredis/version.py -> build/lib.linux-x86_64-3.6/hiredis
    copying hiredis/__init__.py -> build/lib.linux-x86_64-3.6/hiredis
    running build_clib
    building 'hiredis_for_hiredis_py' library
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/vendor
    creating build/temp.linux-x86_64-3.6/vendor/hiredis
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-fWqO4P/python3.6-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c vendor/hiredis/read.c -o build/temp.linux-x86_64-3.6/vendor/hiredis/read.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-fWqO4P/python3.6-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c vendor/hiredis/sds.c -o build/temp.linux-x86_64-3.6/vendor/hiredis/sds.o
    x86_64-linux-gnu-ar rc build/temp.linux-x86_64-3.6/libhiredis_for_hiredis_py.a build/temp.linux-x86_64-3.6/vendor/hiredis/read.o build/temp.linux-x86_64-3.6/vendor/hiredis/sds.o
    running build_ext
    building 'hiredis.hiredis' extension
    creating build/temp.linux-x86_64-3.6/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-fWqO4P/python3.6-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ivendor -I/usr/include/python3.6m -I/home/pete/.virtualenvs/test/include/python3.6m -c src/reader.c -o build/temp.linux-x86_64-3.6/src/reader.o
    In file included from src/reader.h:4:0,
                     from src/reader.c:1:
    src/hiredis.h:4:20: fatal error: Python.h: Nie ma takiego pliku ani katalogu
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/home/pete/.virtualenvs/test/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fdl026_h/hiredis/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-cb3nah3u-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pete/.virtualenvs/test/include/site/python3.6/hiredis" failed with error code 1 in /tmp/pip-build-fdl026_h/hiredis/

I upgraded my python to version 3.10, but when I was installing dependencies for one of my projects (which worked fine before), I got this error from hiredis (hiredis==2.0.0):

 ERROR: Command errored out with exit status 1:
   command: /home/sajad/com/nilva/codebase/nilmal/nilmal-django-backend/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pp4tya0l/hiredis_77cc0a3cc0244a81bdc153910e791620/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pp4tya0l/hiredis_77cc0a3cc0244a81bdc153910e791620/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-11hzakag
       cwd: /tmp/pip-install-pp4tya0l/hiredis_77cc0a3cc0244a81bdc153910e791620/
  Complete output (27 lines):
  /tmp/pip-install-pp4tya0l/hiredis_77cc0a3cc0244a81bdc153910e791620/setup.py:7: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
    import sys, imp, os, glob, io
  /home/sajad/com/nilva/codebase/nilmal/nilmal-django-backend/venv/lib/python3.10/site-packages/setuptools/dist.py:691: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
    warnings.warn(
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.10
  creating build/lib.linux-x86_64-3.10/hiredis
  copying hiredis/__init__.py -> build/lib.linux-x86_64-3.10/hiredis
  copying hiredis/version.py -> build/lib.linux-x86_64-3.10/hiredis
  copying hiredis/hiredis.pyi -> build/lib.linux-x86_64-3.10/hiredis
  copying hiredis/py.typed -> build/lib.linux-x86_64-3.10/hiredis
  running build_ext
  building 'hiredis.hiredis' extension
  creating build/temp.linux-x86_64-3.10
  creating build/temp.linux-x86_64-3.10/src
  creating build/temp.linux-x86_64-3.10/vendor
  creating build/temp.linux-x86_64-3.10/vendor/hiredis
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ivendor -I/home/sajad/com/nilva/codebase/nilmal/nilmal-django-backend/venv/include -I/usr/include/python3.10 -c src/hiredis.c -o build/temp.linux-x86_64-3.10/src/hiredis.o
  In file included from src/hiredis.c:1:
  src/hiredis.h:4:10: fatal error: Python.h: No such file or directory
      4 | #include <Python.h>
        |          ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for hiredis

I’m not sure what the problem is, could anyone help?

am trying to install channels_redis in Django using pip but so far am getting this error:

 Building wheel for hiredis (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      C:UsersTeacher-5F84DFAppDataLocalTemppip-install-a7pi2nhvhiredis_6b689b761b5b44cc87e6dbe9cbaa0597setup.py:7: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
        import sys, imp, os, glob, io
      c:usersteacher-5f84dfappdatalocalprogramspythonpython310libsite-packagessetuptoolsdist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        warnings.warn(
      running bdist_wheel
      running build
      running build_py
      creating build
      creating buildlib.win-amd64-3.10
      creating buildlib.win-amd64-3.10hiredis
      copying hiredisversion.py -> buildlib.win-amd64-3.10hiredis
      copying hiredis__init__.py -> buildlib.win-amd64-3.10hiredis
      copying hiredishiredis.pyi -> buildlib.win-amd64-3.10hiredis
      copying hiredispy.typed -> buildlib.win-amd64-3.10hiredis
      running build_ext
      building 'hiredis.hiredis' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

Я пытался установить pip install python-dev-tools но ничего не получилось. Пожалуйста, помогите, я застрял.

Вам необходимо скачать Microsoft C++ build tool.

enter image description here

Вернуться на верх

У меня проблема с установкой channels_redis на 32-разрядной версии python 3.6, pip 9 и Windows 10 со следующими ошибками:

Фатальная ошибка C1510: не удается загрузить языковой ресурс clui.dll.
ошибка: команда ‘C: Program Files (x86) Microsoft Visual Studio 14.0 VC bin cl.exe’ не прошла со статусом выхода 4

================================================== ==================

Ошибка: команда ‘C: Program Files (x86) Microsoft Visual Studio 14.0 VC bin cl.exe’ не прошла со статусом выхода 4

Я пытаюсь найти двоичные файлы hiredis для Windows, но ничего не могу найти.

Журнал ошибок:

     running build_clib
     building 'hiredis_for_hiredis_py' library
     creating buildtemp.win32-3.6
     creating buildtemp.win32-3.6vendor
     creating buildtemp.win32-3.6vendorhiredis
     C:Program Files (x86)Microsoft Visual Studio 14.0VCbincl.exe /c              /nologo /Ox /W3 /GL /DNDEBUG /MT /Tcvendor/hiredis/read.c /Fobuildtemp.win32-3.6vendor/hiredis/read.obj
     fatal error C1510: Cannot load language resource clui.dll.
     error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' failed with exit status 4

     ----------------------------------------
     Running setup.py clean for hiredis
   Failed to build hiredis
   Installing collected packages: msgpack, hiredis, aioredis, channels-redis
     Running setup.py install for hiredis: started
       Running setup.py install for hiredis: finished with status 'error'
       Complete output from command               C:UsersaheDesktopMouscmwstestenvScriptspython.exe -u -c "import        setuptools, tokenize;__file__='C:\Users\---\AppData\Local\Temp\pycharm-packaging\hiredis\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersaheAppDataLocalTemppip-9to4gn6g-recordinstall-record.txt --single-version-externally-managed --compile --install-headers C:Users---scmwstestenvincludesitepython3.6hiredis:
       running install
running build
running build_py
creating build
creating buildlib.win32-3.6
creating buildlib.win32-3.6hiredis
copying hiredisversion.py -> buildlib.win32-3.6hiredis
copying hiredis__init__.py -> buildlib.win32-3.6hiredis
warning: build_py: byte-compiling is disabled, skipping.

running build_clib
building 'hiredis_for_hiredis_py' library
creating buildtemp.win32-3.6
creating buildtemp.win32-3.6vendor
creating buildtemp.win32-3.6vendorhiredis
C:Program Files (x86)Microsoft Visual Studio 14.0VCbincl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT /Tcvendor/hiredis/read.c /Fobuildtemp.win32-3.6vendor/hiredis/read.obj
fatal error C1510: Cannot load language resource clui.dll.
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' failed with exit status 4

----------------------------------------

    Failed building wheel for hiredis
   Command "C:Users---scmwstestenvScriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\---\AppData\Local\Temp\pycharm-packaging\hiredis\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:Users---AppDataLocalTemppip-9to4gn6g-recordinstall-record.txt --single-version-externally-managed --compile --install-headers C:Users---scmwstestenvincludesitepython3.6hiredis" failed with error code 1 in C:Users---AppDataLocalTemppycharm-packaginghiredis

#python #django #redis #pip #django-channels

Вопрос:

для работы с каналами Django мне нужно установить «channels_redis«. при установке «channels_redis» я столкнулся с этой ошибкой, есть какие-нибудь мысли?

кстати, я нахожусь в Windows, и сначала он показал мне ошибку C , а после установки средств сборки Microsoft visual studio исчез, а теперь это.

   ERROR: Command errored out with exit status 1:
   command: 'E:Programming projectsDjangochannelschat_launch01venvScriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0]
 = '"'"'C:UsersKaNiAppDataLocalTemppip-install-dt2d0_z3hiredis_a7d15f1044b343288a4bc87864c6418esetup.py'"'"'; __file__='"'"'C:
UsersKaNiAppDataLocalTemppip-install-dt2d0_z3hiredis_a7d15f1044b343288a4bc87864c6418esetup.py'"'"';f=getattr(tokenize, '"'"'open'"
'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d
 'C:UsersKaNiAppDataLocalTemppip-wheel-m0bnautd'
       cwd: C:UsersKaNiAppDataLocalTemppip-install-dt2d0_z3hiredis_a7d15f1044b343288a4bc87864c6418e
  Complete output (23 lines):
  C:UsersKaNiAppDataLocalTemppip-install-dt2d0_z3hiredis_a7d15f1044b343288a4bc87864c6418esetup.py:7: DeprecationWarning: the imp module
is deprecated in favour of importlib; see the module's documentation for alternative uses
    import sys, imp, os, glob, io
  E:Programming projectsDjangochannelschat_launch01venvlibsite-packagessetuptoolsdist.py:642: UserWarning: Usage of dash-separated 'des
cription-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
    warnings.warn(
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.9
  creating buildlib.win-amd64-3.9hiredis
  copying hiredisversion.py -> buildlib.win-amd64-3.9hiredis
  copying hiredis__init__.py -> buildlib.win-amd64-3.9hiredis
  running build_ext
  building 'hiredis.hiredis' extension
  creating buildtemp.win-amd64-3.9
  creating buildtemp.win-amd64-3.9Release
  creating buildtemp.win-amd64-3.9Releasesrc
  creating buildtemp.win-amd64-3.9Releasevendor
  creating buildtemp.win-amd64-3.9Releasevendorhiredis
  d:Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29910binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ivendor -IE:
Programming projectsDjangochannelschat_launch01venvinclude -Ic:userskaniappdatalocalprogramspythonpython39include -Ic:userskania
ppdatalocalprogramspythonpython39include -Id:Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29910include -IC:Program Files
(x86)Windows Kits10include10.0.10240.0ucrt /Tcsrchiredis.c /Fobuildtemp.win-amd64-3.9Releasesrchiredis.obj
  hiredis.c
  c:userskaniappdatalocalprogramspythonpython39includepyconfig.h(200): fatal error C1083: Cannot open include file: 'basetsd.h': No suc
h file or directory
  error: command 'd:Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29910binHostX86x64cl.exe' failed with exit code
2
  ----------------------------------------
  ERROR: Failed building wheel for hiredis
 

Ответ №1:

Это происходит из-за некоторой проблемы с вашими инструментами сборки. Следовательно,

  1. Если ваши инструменты сборки не отвечают вашей проблеме, попробуйте установить инструменты сборки вручную по этой ссылке.
  2. После этого вам необходимо перезагрузить компьютер или ноутбук.
  3. Затем попробуйте снова запустить свой код

Foreword

Recently, the pilot library will be used to train the verification code model, but it can’t be installed alive or dead

Environment

Installed in docker, python3

Try to install

pip install pillow

easy_install Pillow

pipenv install pillow

As a result, life and death just can’t fit it

Errors are reported as follows:

Collecting pillow
  Using cached https://files.pythonhosted.org/packages/5b/bb/cdc8086db1f15d0664dd22a62c69613cdc00f1dd430b5b19df1bea83f2a3/Pillow-6.2.1.tar.gz
Building wheels for collected packages: pillow
  Building wheel for pillow (setup.py) ... error
  ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-heq42z9x --python-tag cp37:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Image.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_util.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/features.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_version.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
  copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
  running egg_info
  writing src/Pillow.egg-info/PKG-INFO
  writing dependency_links to src/Pillow.egg-info/dependency_links.txt
  writing top-level names to src/Pillow.egg-info/top_level.txt
  reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.c'
  warning: no files found matching '*.h'
  warning: no files found matching '*.sh'
  warning: no previously-included files found matching '.appveyor.yml'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.codecov.yml'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'azure-pipelines.yml'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  no previously-included directories found matching '.azure-pipelines'
  no previously-included directories found matching '.travis'
  writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  running build_ext
  
  
  The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.
  
  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  Traceback (most recent call last):
    File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 888, in <module>
      zip_safe=not (debug_build() or PLATFORM_MINGW),
    File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 687, in build_extensions
      raise RequiredDependencyException(f)
  __main__.RequiredDependencyException: jpeg
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 903, in <module>
      raise RequiredDependencyException(msg)
  __main__.RequiredDependencyException:
  
  The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.
  
  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  
  
  ----------------------------------------
  ERROR: Failed building wheel for pillow
  Running setup.py clean for pillow
Failed to build pillow
Installing collected packages: pillow
  Running setup.py install for pillow ... error
    ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3r__g4ou/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Image.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_util.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/features.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_version.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.7/PIL
    copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.7/PIL
    running egg_info
    writing src/Pillow.egg-info/PKG-INFO
    writing dependency_links to src/Pillow.egg-info/dependency_links.txt
    writing top-level names to src/Pillow.egg-info/top_level.txt
    reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.c'
    warning: no files found matching '*.h'
    warning: no files found matching '*.sh'
    warning: no previously-included files found matching '.appveyor.yml'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.codecov.yml'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.readthedocs.yml'
    warning: no previously-included files found matching 'azure-pipelines.yml'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    no previously-included directories found matching '.azure-pipelines'
    no previously-included directories found matching '.travis'
    writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
    running build_ext
    
    
    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html
    
    Traceback (most recent call last):
      File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 888, in <module>
        zip_safe=not (debug_build() or PLATFORM_MINGW),
      File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/lib/python3.7/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 687, in build_extensions
        raise RequiredDependencyException(f)
    __main__.RequiredDependencyException: jpeg
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-1vq2qpq_/pillow/setup.py", line 903, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:
    
    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html
    
    
    ----------------------------------------
ERROR: Command "/usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-1vq2qpq_/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3r__g4ou/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-1vq2qpq_/pillow/

Solving

I searched hard on the Internet and finally found the answer in stack overflow. It turned out that there was a lack of dependency package

https://stackoverflow.com/questions/44043906/the-headers-or-library-files-could-not-be-found-for-jpeg-installing-pillow-on/44044479#44044479

Solution

In build   Add the following contents to the dockerfile file:

FROM python:alpine
RUN apk --update add libxml2-dev libxslt-dev libffi-dev gcc musl-dev libgcc openssl-dev curl
RUN apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev
RUN pip install Pillow

So you can build successfully

You can enter the container

Install these dependencies directly, and then you can install them directly in the container without rebuilding the image

apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev

Supplement

Well, you can use it happily. Others may be permission errors, or switch to the installation source

aghasemi

Hi,

Is there a way to recognise if a wheel is a pure Python one or contains C/Native extensions?

meshy

kariharju

Struggling with the questions: «When do I dare to recommend an update to a newer Python version?»
The answer to that depends on not just the most common libs having wheels supported but actually having the wheels built for different OSs and python versions.

When using Python in actual production environments having a reference place like https://caniuse.com was back-in-day for figuring out what features were «safe» to use would be kind of critical.
Have attempted Python 3.10 and 3.9 but so many wheels missing and differences between Window / Linux / macOS that we are basically stuck in 3.7

So the question is could the Python version and OS arguments be added to this site somehow?

frankier

It seem that in the rush to use wheels, many people are now no longer publishing source packages. This causes havoc with new versions of Python which will go way back into the past looking for a version with a source package

Here’s a couple of examples:

  • pytorch/vision#2359
  • hfst/hfst#462

It would be nice to include in the messaging/tracking that both should be published.

luto65

Dear all,
it would be very useful if tflite_runtime wheels could be made available for armv6l
Greetings

Lx

From the Python Wheels homepage:

…and when you’d normally run python setup.py sdist upload, run instead python setup.py sdist bdist_wheel upload.

This is a security risk according to the Python Packaging User Guide:

Warning: In other resources you may encounter references to using python setup.py register and python setup.py upload. These methods of registering and uploading a package are strongly discouraged as it may use a plaintext HTTP or unverified HTTPS connection on some Python versions, allowing your username and password to be intercepted during transmission.

and may therefore warrant at least a mention that the use of something else is encouraged.

tensor-buddy

Is there a dlib (machine-learning) wheel for linux?

vielmetti

I have a report from @NotAFile at WorksOnArm/equinix-metal-arm64-cluster#116 (comment) that there are no wheels for arm64.

The problem of wheels is that there is no PEP specification for linux ARM wheels. The manylinux1 and manylinux2010 platform tags only apply to x86(_64), due to being based on Centos7, which does not support anything else. So before any wheels could be uploaded, a manylinux standard for ARM would be required.

The result of this is that packages that have a lot of dependencies build slowly on arm64.

LuisR69

Thonny shell log reports a runtime warning while executing «import tensorflow» instruction: compile version 3.4 of module ‘tensorflow.python.framework.fast_tensor_util’ does not match runtime version 3.5

stardust85

Since manylinux standard for binary wheels is already in place and used, we should update «You don’t need a compiler on Windows and Mac» to «on Linux, Windows and Mac»

hugovk

toddrme2178

I looked at the top 25 packages on the wheels website, and only 6 had license files. So although the website and the python packaging guidelines both strongly encourage people to add license files, it seems most packages still aren’t doing so. So maybe something else could be done to get the message out.

Perhaps something automated, either in the wheels build process, wheels upload process, pypi account, or this website (or some combination) could be done to warn packagers that they are missing the file.

cclauss

paul-hammant

Righ now if you click on the Wheel/egg/project name (green or white) it goes to the actual Pypi page for the same. What about a ‘status’ page for each project on pythonwheels.com that includes a bunch of information, including the link to the Pypi page.

Info that could be retained in standardized markdown:

  • When the Wheel conversion work was completed.
  • A statement about commitment to keep publishing that way by the leads/maintainers.
  • Problems encountered in the attempt to get a wheel published in this way (Win/Mac/etc problems included). Note: Maintainer tardiness is a thing, and mere users of an Egg could contribute PRs to these pages, but should stick to high-esteem language.
  • Links to CI that show a «dry-run» wheel-publishing check for the active branch of the repo in question.

Maybe a red/orange/green traffic light is possible. A badge too, hosted statically on PythonWheels.com, for inclusion back on the project page:

image

jdufresne

From the wheel documentation

Several open source licenses require the license text to be included in every distributable artifact of the project. Currently, the only way to to do this with “wheel” is to specify the license_file key in the [metadata] section of the project’s setup.cfg:

I think pythonwheels.com should encourage people to use this feature when adding a wheel to their project for the first time. I’ve noticed most packages don’t include this.

It would be useful to be able to use pythonwheels.com as a source of best practices when fixing this in projects.

DheerajAgarwal

Hi,

can’t install hiredis which fails at building wheel. Please advise. The issue is also raised at hiredis issue#62

wheel 0.29.0 py36h3597b6d_1

pip install hiredis
Collecting hiredis
  Using cached hiredis-0.2.0.tar.gz
Building wheels for collected packages: hiredis
  Running setup.py bdist_wheel for hiredis ... error
  Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yy/_lh_xrrx7r92m999snj4dt1nvs_f1b/T/pip-build-im8m7cxh/hiredis/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/yy/_lh_xrrx7r92m999snj4dt1nvs_f1b/T/tmplgz4f1q6pip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.6
  creating build/lib.macosx-10.9-x86_64-3.6/hiredis
  copying hiredis/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/hiredis
  copying hiredis/version.py -> build/lib.macosx-10.9-x86_64-3.6/hiredis
  running build_clib
  building 'hiredis_for_hiredis_py' library
  creating build/temp.macosx-10.9-x86_64-3.6
  creating build/temp.macosx-10.9-x86_64-3.6/vendor
  creating build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis
  /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -c vendor/hiredis/read.c -o build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis/read.o
  /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -c vendor/hiredis/sds.c -o build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis/sds.o
  x86_64-apple-darwin13.4.0-ar rc build/temp.macosx-10.9-x86_64-3.6/libhiredis_for_hiredis_py.a build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis/read.o build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis/sds.o
  unable to execute 'x86_64-apple-darwin13.4.0-ar': No such file or directory
  error: command 'x86_64-apple-darwin13.4.0-ar' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for hiredis

np1

Hi, I followed the instructions on the website (pip install wheel, universal=1 in setup.cfg) but when I tried uploading to pypi with: python setup.py sdist bdist_wheel upload I got the following output:

[...]
installing to build/bdist.linux-i686/wheel
running install
running install_egg_info
Copying mps.egg-info to build/bdist.linux-i686/wheel/mps-0.20.10.data/purelib/mps-0.20.10.egg-info
running install_scripts
creating build/bdist.linux-i686/wheel/mps-0.20.10.data/scripts
copying build/scripts-2.7/mps -> build/bdist.linux-i686/wheel/mps-0.20.10.data/scripts
changing mode of build/bdist.linux-i686/wheel/mps-0.20.10.data/scripts/mps to 775
creating build/bdist.linux-i686/wheel/mps-0.20.10.dist-info/WHEEL
running upload
Submitting dist/mps-0.20.10.tar.gz to https://pypi.python.org/pypi
Server response (200): OK
Submitting /f/h/projects/github/mps/dist/mps-0.20.10-cp27-none-linux_i686.whl to https://pypi.python.org/pypi
Upload failed (400): Binary wheel for an unsupported platform

This is the first time I have tried using wheel, does anyone know what the issue is? This is the setup.py I was using: https://raw.githubusercontent.com/np1/mps/master/setup.py

pydanny

ololoe

Ipython is displayed as green, but installing on windows fails because there is no wheel for some binary dependency. So you have to check all dependencies or the site is just useless.

jaddison

pythonwheels.com

Looks like it’s using the default *.cloudfront.com cert, which (obviously) doesn’t have pythonwheels.com as a common name on the cert.

redis / hiredis-py
Goto Github
PK

View Code? Open in Web Editor
NEW

447.0
447.0
94.0
162 KB

Python wrapper for hiredis

License: Other

Python 41.63%

C 58.37%

hiredis-py’s Introduction

This README is just a fast quick start document. You can find more detailed documentation at redis.io.

What is Redis?

Redis is often referred to as a data structures server. What this means is that Redis provides access to mutable data structures via a set of commands, which are sent using a server-client model with TCP sockets and a simple protocol. So different processes can query and modify the same data structures in a shared way.

Data structures implemented into Redis have a few special properties:

  • Redis cares to store them on disk, even if they are always served and modified into the server memory. This means that Redis is fast, but that it is also non-volatile.
  • The implementation of data structures emphasizes memory efficiency, so data structures inside Redis will likely use less memory compared to the same data structure modelled using a high-level programming language.
  • Redis offers a number of features that are natural to find in a database, like replication, tunable levels of durability, clustering, and high availability.

Another good example is to think of Redis as a more complex version of memcached, where the operations are not just SETs and GETs, but operations that work with complex data types like Lists, Sets, ordered data structures, and so forth.

If you want to know more, this is a list of selected starting points:

  • Introduction to Redis data types. https://redis.io/topics/data-types-intro
  • Try Redis directly inside your browser. https://try.redis.io
  • The full list of Redis commands. https://redis.io/commands
  • There is much more inside the official Redis documentation. https://redis.io/documentation

Building Redis

Redis can be compiled and used on Linux, OSX, OpenBSD, NetBSD, FreeBSD.
We support big endian and little endian architectures, and both 32 bit
and 64 bit systems.

It may compile on Solaris derived systems (for instance SmartOS) but our
support for this platform is best effort and Redis is not guaranteed to
work as well as in Linux, OSX, and *BSD.

It is as simple as:

To build with TLS support, you’ll need OpenSSL development libraries (e.g.
libssl-dev on Debian/Ubuntu) and run:

To build with systemd support, you’ll need systemd development libraries (such
as libsystemd-dev on Debian/Ubuntu or systemd-devel on CentOS) and run:

To append a suffix to Redis program names, use:

% make PROG_SUFFIX="-alt"

You can build a 32 bit Redis binary using:

After building Redis, it is a good idea to test it using:

If TLS is built, running the tests with TLS enabled (you will need tcl-tls
installed):

% ./utils/gen-test-certs.sh
% ./runtest --tls

Fixing build problems with dependencies or cached build options

Redis has some dependencies which are included in the deps directory.
make does not automatically rebuild dependencies even if something in
the source code of dependencies changes.

When you update the source code with git pull or when code inside the
dependencies tree is modified in any other way, make sure to use the following
command in order to really clean everything and rebuild from scratch:

This will clean: jemalloc, lua, hiredis, linenoise and other dependencies.

Also if you force certain build options like 32bit target, no C compiler
optimizations (for debugging purposes), and other similar build time options,
those options are cached indefinitely until you issue a make distclean
command.

Fixing problems building 32 bit binaries

If after building Redis with a 32 bit target you need to rebuild it
with a 64 bit target, or the other way around, you need to perform a
make distclean in the root directory of the Redis distribution.

In case of build errors when trying to build a 32 bit binary of Redis, try
the following steps:

  • Install the package libc6-dev-i386 (also try g++-multilib).
  • Try using the following command line instead of make 32bit:
    make CFLAGS="-m32 -march=native" LDFLAGS="-m32"

Allocator

Selecting a non-default memory allocator when building Redis is done by setting
the MALLOC environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc.

To force compiling against libc malloc, use:

To compile against jemalloc on Mac OS X systems, use:

Monotonic clock

By default, Redis will build using the POSIX clock_gettime function as the
monotonic clock source. On most modern systems, the internal processor clock
can be used to improve performance. Cautions can be found here:
http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/

To build with support for the processor’s internal instruction clock, use:

% make CFLAGS="-DUSE_PROCESSOR_CLOCK"

Verbose build

Redis will build with a user-friendly colorized output by default.
If you want to see a more verbose output, use the following:

Running Redis

To run Redis with the default configuration, just type:

% cd src
% ./redis-server

If you want to provide your redis.conf, you have to run it using an additional
parameter (the path of the configuration file):

% cd src
% ./redis-server /path/to/redis.conf

It is possible to alter the Redis configuration by passing parameters directly
as options using the command line. Examples:

% ./redis-server --port 9999 --replicaof 127.0.0.1 6379
% ./redis-server /etc/redis/6379.conf --loglevel debug

All the options in redis.conf are also supported as options using the command
line, with exactly the same name.

Running Redis with TLS:

Please consult the TLS.md file for more information on
how to use Redis with TLS.

Playing with Redis

You can use redis-cli to play with Redis. Start a redis-server instance,
then in another terminal try the following:

% cd src
% ./redis-cli
redis> ping
PONG
redis> set foo bar
OK
redis> get foo
"bar"
redis> incr mycounter
(integer) 1
redis> incr mycounter
(integer) 2
redis>

You can find the list of all the available commands at https://redis.io/commands.

Installing Redis

In order to install Redis binaries into /usr/local/bin, just use:

You can use make PREFIX=/some/other/directory install if you wish to use a
different destination.

make install will just install binaries in your system, but will not configure
init scripts and configuration files in the appropriate place. This is not
needed if you just want to play a bit with Redis, but if you are installing
it the proper way for a production system, we have a script that does this
for Ubuntu and Debian systems:

% cd utils
% ./install_server.sh

Note: install_server.sh will not work on Mac OSX; it is built for Linux only.

The script will ask you a few questions and will setup everything you need
to run Redis properly as a background daemon that will start again on
system reboots.

You’ll be able to stop and start Redis using the script named
/etc/init.d/redis_<portnumber>, for instance /etc/init.d/redis_6379.

Code contributions

Note: By contributing code to the Redis project in any form, including sending
a pull request via Github, a code fragment or patch via private email or
public discussion groups, you agree to release your code under the terms
of the BSD license that you can find in the COPYING file included in the Redis
source distribution.

Please see the CONTRIBUTING.md file in this source distribution for more
information. For security bugs and vulnerabilities, please see SECURITY.md.

Redis internals

If you are reading this README you are likely in front of a Github page
or you just untarred the Redis distribution tar ball. In both the cases
you are basically one step away from the source code, so here we explain
the Redis source code layout, what is in each file as a general idea, the
most important functions and structures inside the Redis server and so forth.
We keep all the discussion at a high level without digging into the details
since this document would be huge otherwise and our code base changes
continuously, but a general idea should be a good starting point to
understand more. Moreover most of the code is heavily commented and easy
to follow.

Source code layout

The Redis root directory just contains this README, the Makefile which
calls the real Makefile inside the src directory and an example
configuration for Redis and Sentinel. You can find a few shell
scripts that are used in order to execute the Redis, Redis Cluster and
Redis Sentinel unit tests, which are implemented inside the tests
directory.

Inside the root are the following important directories:

  • src: contains the Redis implementation, written in C.
  • tests: contains the unit tests, implemented in Tcl.
  • deps: contains libraries Redis uses. Everything needed to compile Redis is inside this directory; your system just needs to provide libc, a POSIX compatible interface and a C compiler. Notably deps contains a copy of jemalloc, which is the default allocator of Redis under Linux. Note that under deps there are also things which started with the Redis project, but for which the main repository is not redis/redis.

There are a few more directories but they are not very important for our goals
here. We’ll focus mostly on src, where the Redis implementation is contained,
exploring what there is inside each file. The order in which files are
exposed is the logical one to follow in order to disclose different layers
of complexity incrementally.

Note: lately Redis was refactored quite a bit. Function names and file
names have been changed, so you may find that this documentation reflects the
unstable branch more closely. For instance, in Redis 3.0 the server.c
and server.h files were named redis.c and redis.h. However the overall
structure is the same. Keep in mind that all the new developments and pull
requests should be performed against the unstable branch.

server.h

The simplest way to understand how a program works is to understand the
data structures it uses. So we’ll start from the main header file of
Redis, which is server.h.

All the server configuration and in general all the shared state is
defined in a global structure called server, of type struct redisServer.
A few important fields in this structure are:

  • server.db is an array of Redis databases, where data is stored.
  • server.commands is the command table.
  • server.clients is a linked list of clients connected to the server.
  • server.master is a special client, the master, if the instance is a replica.

There are tons of other fields. Most fields are commented directly inside
the structure definition.

Another important Redis data structure is the one defining a client.
In the past it was called redisClient, now just client. The structure
has many fields, here we’ll just show the main ones:

struct client {
    int fd;
    sds querybuf;
    int argc;
    robj **argv;
    redisDb *db;
    int flags;
    list *reply;
    // ... many other fields ...
    char buf[PROTO_REPLY_CHUNK_BYTES];
}

The client structure defines a connected client:

  • The fd field is the client socket file descriptor.
  • argc and argv are populated with the command the client is executing, so that functions implementing a given Redis command can read the arguments.
  • querybuf accumulates the requests from the client, which are parsed by the Redis server according to the Redis protocol and executed by calling the implementations of the commands the client is executing.
  • reply and buf are dynamic and static buffers that accumulate the replies the server sends to the client. These buffers are incrementally written to the socket as soon as the file descriptor is writable.

As you can see in the client structure above, arguments in a command
are described as robj structures. The following is the full robj
structure, which defines a Redis object:

struct redisObject {
    unsigned type:4;
    unsigned encoding:4;
    unsigned lru:LRU_BITS; /* LRU time (relative to global lru_clock) or
                            * LFU data (least significant 8 bits frequency
                            * and most significant 16 bits access time). */
    int refcount;
    void *ptr;
};

Basically this structure can represent all the basic Redis data types like
strings, lists, sets, sorted sets and so forth. The interesting thing is that
it has a type field, so that it is possible to know what type a given
object has, and a refcount, so that the same object can be referenced
in multiple places without allocating it multiple times. Finally the ptr
field points to the actual representation of the object, which might vary
even for the same type, depending on the encoding used.

Redis objects are used extensively in the Redis internals, however in order
to avoid the overhead of indirect accesses, recently in many places
we just use plain dynamic strings not wrapped inside a Redis object.

server.c

This is the entry point of the Redis server, where the main() function
is defined. The following are the most important steps in order to startup
the Redis server.

  • initServerConfig() sets up the default values of the server structure.
  • initServer() allocates the data structures needed to operate, setup the listening socket, and so forth.
  • aeMain() starts the event loop which listens for new connections.

There are two special functions called periodically by the event loop:

  1. serverCron() is called periodically (according to server.hz frequency), and performs tasks that must be performed from time to time, like checking for timed out clients.
  2. beforeSleep() is called every time the event loop fired, Redis served a few requests, and is returning back into the event loop.

Inside server.c you can find code that handles other vital things of the Redis server:

  • call() is used in order to call a given command in the context of a given client.
  • activeExpireCycle() handles eviction of keys with a time to live set via the EXPIRE command.
  • performEvictions() is called when a new write command should be performed but Redis is out of memory according to the maxmemory directive.
  • The global variable redisCommandTable defines all the Redis commands, specifying the name of the command, the function implementing the command, the number of arguments required, and other properties of each command.

commands.c

This file is auto generated by utils/generate-command-code.py, the content is based on the JSON files in the src/commands folder.
These are meant to be the single source of truth about the Redis commands, and all the metadata about them.
These JSON files are not meant to be used by anyone directly, instead that metadata can be obtained via the COMMAND command.

networking.c

This file defines all the I/O functions with clients, masters and replicas
(which in Redis are just special clients):

  • createClient() allocates and initializes a new client.
  • The addReply*() family of functions are used by command implementations in order to append data to the client structure, that will be transmitted to the client as a reply for a given command executed.
  • writeToClient() transmits the data pending in the output buffers to the client and is called by the writable event handler sendReplyToClient().
  • readQueryFromClient() is the readable event handler and accumulates data read from the client into the query buffer.
  • processInputBuffer() is the entry point in order to parse the client query buffer according to the Redis protocol. Once commands are ready to be processed, it calls processCommand() which is defined inside server.c in order to actually execute the command.
  • freeClient() deallocates, disconnects and removes a client.

aof.c and rdb.c

As you can guess from the names, these files implement the RDB and AOF
persistence for Redis. Redis uses a persistence model based on the fork()
system call in order to create a process with the same (shared) memory
content of the main Redis process. This secondary process dumps the content
of the memory on disk. This is used by rdb.c to create the snapshots
on disk and by aof.c in order to perform the AOF rewrite when the
append only file gets too big.

The implementation inside aof.c has additional functions in order to
implement an API that allows commands to append new commands into the AOF
file as clients execute them.

The call() function defined inside server.c is responsible for calling
the functions that in turn will write the commands into the AOF.

db.c

Certain Redis commands operate on specific data types; others are general.
Examples of generic commands are DEL and EXPIRE. They operate on keys
and not on their values specifically. All those generic commands are
defined inside db.c.

Moreover db.c implements an API in order to perform certain operations
on the Redis dataset without directly accessing the internal data structures.

The most important functions inside db.c which are used in many command
implementations are the following:

  • lookupKeyRead() and lookupKeyWrite() are used in order to get a pointer to the value associated to a given key, or NULL if the key does not exist.
  • dbAdd() and its higher level counterpart setKey() create a new key in a Redis database.
  • dbDelete() removes a key and its associated value.
  • emptyDb() removes an entire single database or all the databases defined.

The rest of the file implements the generic commands exposed to the client.

object.c

The robj structure defining Redis objects was already described. Inside
object.c there are all the functions that operate with Redis objects at
a basic level, like functions to allocate new objects, handle the reference
counting and so forth. Notable functions inside this file:

  • incrRefCount() and decrRefCount() are used in order to increment or decrement an object reference count. When it drops to 0 the object is finally freed.
  • createObject() allocates a new object. There are also specialized functions to allocate string objects having a specific content, like createStringObjectFromLongLong() and similar functions.

This file also implements the OBJECT command.

replication.c

This is one of the most complex files inside Redis, it is recommended to
approach it only after getting a bit familiar with the rest of the code base.
In this file there is the implementation of both the master and replica role
of Redis.

One of the most important functions inside this file is replicationFeedSlaves() that writes commands to the clients representing replica instances connected
to our master, so that the replicas can get the writes performed by the clients:
this way their data set will remain synchronized with the one in the master.

This file also implements both the SYNC and PSYNC commands that are
used in order to perform the first synchronization between masters and
replicas, or to continue the replication after a disconnection.

Script

The script unit is composed of 3 units:

  • script.c — integration of scripts with Redis (commands execution, set replication/resp, …)
  • script_lua.c — responsible to execute Lua code, uses script.c to interact with Redis from within the Lua code.
  • function_lua.c — contains the Lua engine implementation, uses script_lua.c to execute the Lua code.
  • functions.c — contains Redis Functions implementation (FUNCTION command), uses functions_lua.c if the function it wants to invoke needs the Lua engine.
  • eval.c — contains the eval implementation using script_lua.c to invoke the Lua code.

Other C files

  • t_hash.c, t_list.c, t_set.c, t_string.c, t_zset.c and t_stream.c contains the implementation of the Redis data types. They implement both an API to access a given data type, and the client command implementations for these data types.
  • ae.c implements the Redis event loop, it’s a self contained library which is simple to read and understand.
  • sds.c is the Redis string library, check https://github.com/antirez/sds for more information.
  • anet.c is a library to use POSIX networking in a simpler way compared to the raw interface exposed by the kernel.
  • dict.c is an implementation of a non-blocking hash table which rehashes incrementally.
  • cluster.c implements the Redis Cluster. Probably a good read only after being very familiar with the rest of the Redis code base. If you want to read cluster.c make sure to read the Redis Cluster specification.

Anatomy of a Redis command

All the Redis commands are defined in the following way:

void foobarCommand(client *c) {
    printf("%s",c->argv[1]->ptr); /* Do something with the argument. */
    addReply(c,shared.ok); /* Reply something to the client. */
}

The command function is referenced by a JSON file, together with its metadata, see commands.c described above for details.
The command flags are documented in the comment above the struct redisCommand in server.h.
For other details, please refer to the COMMAND command. https://redis.io/commands/command/

After the command operates in some way, it returns a reply to the client,
usually using addReply() or a similar function defined inside networking.c.

There are tons of command implementations inside the Redis source code
that can serve as examples of actual commands implementations (e.g. pingCommand). Writing
a few toy commands can be a good exercise to get familiar with the code base.

There are also many other files not described here, but it is useless to
cover everything. We just want to help you with the first steps.
Eventually you’ll find your way inside the Redis code base :-)

Enjoy!

hiredis-py’s People

hiredis-py’s Issues

Bump for python 3.9

Can we bump to 3.9?
It works fine when building from source and installing (hiredis 1.1.0).

Build wheels for Python 3.7.1

New maintainer needed

I have neither the time nor the energy to fulfil the maintainer role here.
I failed to spend enough time in the past and haven’t pushed out a release in nearly 3 years.

If anyone is actively using this project and wants to take over, please reach me over email.

Error Compilation OmniOS

Hi,

I had troubles installing hiredis using pip install hiredis on OmniOS however I found a solution that I wanted to share:
CFLAGS=python-config --cflags' -std=c99 -m64' pip install hiredis
(I’m guessing that the SmartOS users will have the same problem.)

I tried to send a pull request to make it available for everyone but I don’t know well enough distutils. Hence maybe someone will figure out a way to make it work with this ticket.

Cheers,

Mathieu

Retrieve partial multi bulk replies.

When a large multibulk reply is transmitted over the network, it can take a while to transmit and process.

Right now, the only API to read parsed tokens is hiredis.Reader.gets().
I’d like to have something, that in case of a multibulk reply, we can already receive a partial multibulk answer, and stream the remaining parts as soon as they’re received and feeded to the parser.

That’s especially useful for asynchronous code (like asyncio-redis).

Warnings when installing

Installing on Linux (Ubuntu 16.04) under Python3.6 and using easy_install gives these warnings, but still seems to work.

Searching for hiredis
Reading https://pypi.python.org/simple/hiredis/
Downloading https://pypi.python.org/packages/1b/98/4766d85124b785ff1989ee1c79631a1b6ecfcb444ff39999a87877b2027e/hiredis-0.2.0.tar.gz#md5=b410cf2f2062d87ab841c33d8345761e
Best match: hiredis 0.2.0
Processing hiredis-0.2.0.tar.gz
Writing /tmp/easy_install-iethl5pn/hiredis-0.2.0/setup.cfg
Running hiredis-0.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-iethl5pn/hiredis-0.2.0/egg-dist-tmp-sk0axbvv
- warning: no previously-included files found matching 'vendor/hiredis/example*'
- warning: no previously-included files found matching 'vendor/hiredis/text*'
- zip_safe flag not set; analyzing archive contents...
- hiredis.__pycache__.hiredis.cpython-36: module references __file__
creating /usr/local/lib/python3.6/dist-packages/hiredis-0.2.0-py3.6-linux-x86_64.egg
Extracting hiredis-0.2.0-py3.6-linux-x86_64.egg to /usr/local/lib/python3.6/dist-packages
Adding hiredis 0.2.0 to easy-install.pth file
Installed /usr/local/lib/python3.6/dist-packages/hiredis-0.2.0-py3.6-linux-x86_64.egg
Processing dependencies for hiredis

easy_install hiredis # not work

C:Users...>easy_install hiredis
Searching for hiredis
Reading https://pypi.python.org/simple/hiredis/
Best match: hiredis 0.1.3
Downloading https://pypi.python.org/packages/source/h/hiredis/hiredis-0.1.3.tar.gz#md5=69a66903399d6a1e69f3a62e11d34d26
Processing hiredis-0.1.3.tar.gz
Writing c:windowstempeasy_install-_yzdqchiredis-0.1.3setup.cfg
Running hiredis-0.1.3setup.py -q bdist_egg --dist-dir c:windowstempeasy_install-_yzdqchiredis-0.1.3egg-dist-tmp-4zqgsv
warning: no previously-included files found matching 'vendorhiredisexample*'
warning: no previously-included files found matching 'vendorhiredistext*'
hiredis.c
vendor/hiredis/hiredis.c(35) : fatal error C1083: Не удается открыть файл include: unistd.h: No suchfile or directory
error: DistutilsError('Setup script exited with error: CompileError(DistutilsExecError('command\'"C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\cl.exe"\' failed with exit status 2',),)',)

Can’t build on macosx 10.7

Hi! I’m getting trouble installing package on Leon. Or I’d better open this issue on main hiredis repo?
….
Running setup.py install for hiredis
building ‘hiredis’ library
/Developer/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -fwrapv -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Ivendor/hiredis -c vendor/hiredis/hiredis.c -o build/temp.macosx-10.7-x86_64-2.7/vendor/hiredis/hiredis.o
vendor/hiredis/hiredis.c:691:21: error: second argument to ‘va_arg’ is of incomplete type ‘void’
va_arg(ap,void);
^~~~~~~~~~~~~~~
/Developer/usr/bin/../lib/clang/3.0/include/stdarg.h:35:50: note: instantiated from:
#define va_arg(ap, type) builtin_va_arg(ap, type)
^
vendor/hiredis/hiredis.c:691:31: note: instantiated from:
va_arg(ap,void);
^~~~
1 error generated.
error: command ‘/Developer/usr/bin/clang’ failed with exit status 1
Complete output from command /Users/demon/Work/sportlook.ru/env/bin/python -c «import setuptools;__file
=’/Users/demon/Work/sportlook.ru/env/build/hiredis/setup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record /var/folders/s5/3z_j0lyx3r9__09nfn7vb7wh0000gn/T/pip-4asypi-record/install-record.txt —install-headers /Users/demon/Work/sportlook.ru/env/bin/../include/site/python2.7:
running install

running build

running build_py

creating build

creating build/lib.macosx-10.7-x86_64-2.7

creating build/lib.macosx-10.7-x86_64-2.7/hiredis

copying hiredis/init.py -> build/lib.macosx-10.7-x86_64-2.7/hiredis

copying hiredis/version.py -> build/lib.macosx-10.7-x86_64-2.7/hiredis

running build_clib

building ‘hiredis’ library

creating build/temp.macosx-10.7-x86_64-2.7

creating build/temp.macosx-10.7-x86_64-2.7/vendor

creating build/temp.macosx-10.7-x86_64-2.7/vendor/hiredis

/Developer/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -fwrapv -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Ivendor/hiredis -c vendor/hiredis/hiredis.c -o build/temp.macosx-10.7-x86_64-2.7/vendor/hiredis/hiredis.o

vendor/hiredis/hiredis.c:691:21: error: second argument to ‘va_arg’ is of incomplete type ‘void’

                va_arg(ap,void);

                ^~~~~~~~~~~~~~~

/Developer/usr/bin/../lib/clang/3.0/include/stdarg.h:35:50: note: instantiated from:

define va_arg(ap, type) __builtin_va_arg(ap, type)

vendor/hiredis/hiredis.c:691:31: note: instantiated from:

1 error generated.

error: command ‘/Developer/usr/bin/clang’ failed with exit status 1


Command /Users/demon/Work/sportlook.ru/env/bin/python -c «import setuptools;file=’/Users/demon/Work/sportlook.ru/env/build/hiredis/setup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record /var/folders/s5/3z_j0lyx3r9__09nfn7vb7wh0000gn/T/pip-4asypi-record/install-record.txt —install-headers /Users/demon/Work/sportlook.ru/env/bin/../include/site/python2.7 failed with error code 1
Storing complete log in /Users/demon/.pip/pip.log

compialtion error on Ubuntu 11.04 64 bit

$sudo pip install hiredis —upgrade

sudo pip install hiredis —upgrade
Downloading/unpacking hiredis
Running setup.py egg_info for package hiredis

Installing collected packages: hiredis
Running setup.py install for hiredis
building ‘hiredis’ library
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/hiredis.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/hiredis.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/net.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/net.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/sds.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/sds.o
ar rc build/temp.linux-x86_64-2.7/libhiredis.a build/temp.linux-x86_64-2.7/vendor/hiredis/hiredis.o build/temp.linux-x86_64-2.7/vendor/hiredis/net.o build/temp.linux-x86_64-2.7/vendor/hiredis/sds.o
building ‘hiredis.hiredis’ extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Isrc -Ivendor -I/usr/include/python2.7 -c src/hiredis.c -o build/temp.linux-x86_64-2.7/src/hiredis.o
In file included from src/hiredis.c:1:0:
src/hiredis.h:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command ‘gcc’ failed with exit status 1
Complete output from command /usr/bin/python -c «import setuptools;file=’/home/salimane/htdocs/7ksns/trunk/build/hiredis/setup.py’;execfile(file)» install —single-version-externally-managed —record /tmp/pip-lmiuw4-record/install-record.txt:
running install

running build

running build_py

copying hiredis/init.py -> build/lib.linux-x86_64-2.7/hiredis

copying hiredis/version.py -> build/lib.linux-x86_64-2.7/hiredis

running build_clib

building ‘hiredis’ library

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/hiredis.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/hiredis.o

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/net.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/net.o

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/sds.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/sds.o

ar rc build/temp.linux-x86_64-2.7/libhiredis.a build/temp.linux-x86_64-2.7/vendor/hiredis/hiredis.o build/temp.linux-x86_64-2.7/vendor/hiredis/net.o build/temp.linux-x86_64-2.7/vendor/hiredis/sds.o

running build_ext

building ‘hiredis.hiredis’ extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Isrc -Ivendor -I/usr/include/python2.7 -c src/hiredis.c -o build/temp.linux-x86_64-2.7/src/hiredis.o

In file included from src/hiredis.c:1:0:

src/hiredis.h:4:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: command ‘gcc’ failed with exit status 1


Command /usr/bin/python -c «import setuptools;file=’/home/salimane/htdocs/7ksns/trunk/build/hiredis/setup.py’;execfile(file)» install —single-version-externally-managed —record /tmp/pip-lmiuw4-record/install-record.txt failed with error code 1
Storing complete log in /home/salimane/.pip/pip.log

Installation error — can’t find Microsoft SDKS/…/lib

Hi. I’m trying to install hiredis-py but I’m getting this issue:

error: [WinError 3] The system cannot find the path specified: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\lib'

In the specified folder (v8.1) I only have a folder called ExtensionSDKs. I couldn’t find a reference for needing a Microsoft SDK anywhere here. Am I doing something wrong?

Thanks in advance.

Can’t install in virtualenv on Ubuntu 11.10 64 bit (Error: None)

I can’t install hiredis (only) in virtualenv, no problems when installed globally :(

(TICKETS)[email protected]:/usr/local/pythonenv$ sudo pip install hiredis -E TICKETS

Downloading/unpacking hiredis
  Running setup.py egg_info for package hiredis

Installing collected packages: hiredis
  Running setup.py install for hiredis
    error: None
    Complete output from command /usr/local/pythonenv/TICKETS/bin/python -c "import setuptools;__file__='/usr/local/pythonenv/TICKETS/build/hiredis/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-dn9RxE-record/install-record.txt --install-headers /usr/local/pythonenv/TICKETS/include/site/python2.7:
    running install

running build

running build_py

running build_clib

error: None

----------------------------------------
Command /usr/local/pythonenv/TICKETS/bin/python -c "import setuptools;__file__='/usr/local/pythonenv/TICKETS/build/hiredis/setup.py';exec(compile(open(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-dn9RxE-record/install-record.txt --install-headers /usr/local/pythonenv/TICKETS/include/site/python2.7 failed with error code 1
Storing complete log in /home/ju/.pip/pip.log

Memory leak when querying large dataset

I query around 500 MB data from Redis on frequent basis. When I don’t add hiredis, everything works fine but when hiredis is installed, there occurs a memory leak which eventually leads to process crash.

Capture status replies.

At the moment status messages (like OK) are just returned as bytes.

I need the parser to distinguish between received bytes and status messages (prefixed with a ‘+’ sign.)

Any way to do this?

Thanks

(It’s for asyncio-redis.)

bdist_rpm doesn’t work

I tried creating an RPM and installing it on CentOS 6, but I am getting the following error after installing:

>>> import hiredis
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "hiredis/__init__.py", line 1, in <module>
    from .hiredis import Reader, HiredisError, ProtocolError, ReplyError
ImportError: No module named hiredis

Steps to reproduce:

$ git clone https://github.com/redis/hiredis-py
$ cd hiredis-py
$ git submodule update --init --recursive
$ python setup.py bdist_rpm
$ rpm -ivh dist/hiredis-0.2.0-1.x86_64.rpm

The version of python is 2.6.6 and setuptools 0.6.

Update README for Python 3

The README currently recommends the python-dev apt package to get the development headers. That’s for Python 2, though. For Python 3 you need python3-dev. Perhaps instead:

«On Ubuntu/Debian systems, install them with apt-get install python-dev or apt-get install python3-dev.

UnicodeDecodeError in setup.py

Problem description

Cannot install hiredis on Windows.

Steps to reproduce

  1. Install Python
  2. Run:
py -3.8 -m pip install hiredis

Actual result

C:>py -3.8 -m pip install hiredis
Collecting hiredis
  Using cached https://files.pythonhosted.org/packages/9e/e0/c160dbdff032ffe68e4b3c576cba3db22d8ceffc9513ae63368296d1bcc8/hiredis-1.0.0.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'C:Python38python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\user\AppData\Local\Temp\pip-install-rrjljd7j\hiredis\setup.py'"'"'; __file__='"'"'C:\Users\user\AppData\Local\Temp\pip-install-rrjljd7j\hiredis\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersuserAppDataLocalTemppip-install-rrjljd7jhiredispip-egg-info'
         cwd: C:UsersuserAppDataLocalTemppip-install-rrjljd7jhiredis
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UsersuserAppDataLocalTemppip-install-rrjljd7jhiredissetup.py", line 22, in <module>
        long_description=open('README.md', 'r').read(),
      File "C:Python38libencodingscp1251.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 2251: character maps to <undefined>
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Expected result

No errors.

Additional information

hiredis 1.0.0, 0.3.1, 0.3.0 are affected. hiredis 0.2.0 is not affected.

New 0.2.0 packages uploaded to PyPi

Sorry to open an issue but new packages for the 0.2.0 version have been pushed to pypi and we have checks on file hashes failing in CI.

Can this release be trusted?

Performance question

Due to some benchmarking and slowness issues we see:

  1. Does Hiredis prep the request and only then transmit to Redis server or does it start the session and stream data as we go?

  2. If i have a slow connection, will Redis get slowness because it takes a lot of time to pull the results / send the request (like zadd 40K records)

Add wheel to PYPI package.

Fast convert redis streams output to a numpy array or pandas dataframe

Hi, refering to my own question — do you have any suggestions how I can change the reader to yield an already type converted numpy/ pandas time series friendly array?

Can’t install inside a virtualenv

Hi there,

When I install hiredis for global environment, it works, but when I try to install it inside a virtualenv it gives me this error:

Downloading/unpacking hiredis
Running setup.py egg_info for package hiredis
running egg_info
writing pip-egg-info/hiredis.egg-info/PKG-INFO
writing top-level names to pip-egg-info/hiredis.egg-info/top_level.txt
writing dependency_links to pip-egg-info/hiredis.egg-info/dependency_links.txt
warning: manifest_maker: standard file ‘-c’ not found

reading manifest file 'pip-egg-info/hiredis.egg-info/SOURCES.txt'
writing manifest file 'pip-egg-info/hiredis.egg-info/SOURCES.txt'

Installing collected packages: hiredis
Running setup.py install for hiredis
Running command /home/diogo/Envs/bruce/bin/python2.7 -c «import setuptools;file=’/home/diogo/Envs/bruce/build/hiredis/setup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record /tmp/pip-NnXIVL-record/install-record.txt —install-headers /home/diogo/Envs/bruce/include/site/python2.7
running install
running build
running build_py
copying hiredis/version.py -> build/lib.linux-x86_64-2.7/hiredis
copying hiredis/init.py -> build/lib.linux-x86_64-2.7/hiredis
running build_clib
error: None
Complete output from command /home/diogo/Envs/bruce/bin/python2.7 -c «import setuptools;file=’/home/diogo/Envs/bruce/build/hiredis/setup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record /tmp/pip-NnXIVL-record/install-record.txt —install-headers /home/diogo/Envs/bruce/include/site/python2.7:
running install

running build

running build_py

copying hiredis/version.py -> build/lib.linux-x86_64-2.7/hiredis

copying hiredis/init.py -> build/lib.linux-x86_64-2.7/hiredis

running build_clib

error: None


Command /home/diogo/Envs/bruce/bin/python2.7 -c «import setuptools;file=’/home/diogo/Envs/bruce/build/hiredis/setup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record /tmp/pip-NnXIVL-record/install-record.txt —install-headers /home/diogo/Envs/bruce/include/site/python2.7 failed with error code 1
Exception information:
Traceback (most recent call last):
File «/home/diogo/Envs/bruce/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg/pip/basecommand.py», line 126, in main
self.run(options, args)
File «/home/diogo/Envs/bruce/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg/pip/commands/install.py», line 228, in run
requirement_set.install(install_options, global_options)
File «/home/diogo/Envs/bruce/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg/pip/req.py», line 1100, in install
requirement.install(install_options, global_options)
File «/home/diogo/Envs/bruce/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg/pip/req.py», line 572, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File «/home/diogo/Envs/bruce/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg/pip/init.py», line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command /home/diogo/Envs/bruce/bin/python2.7 -c «import setuptools;file=’/home/diogo/Envs/bruce/build/hiredis/setup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record /tmp/pip-NnXIVL-record/install-record.txt —install-headers /home/diogo/Envs/bruce/include/site/python2.7 failed with error code 1

Can anyone help me on this?

Thanks a lot,

Diogo

build_ext: cannot find -lhiredis_for_hiredis_py

Hi,

pip install hiredis --global-option=build_ext fails for me on both Ubuntu and CentOS.

I understand that hiredis_for_hiredis_py should refer to files in vendor/hiredis/? Am I doing something wrong?

Thanks!

Request: RESP 3 support

hi, i am the author of one of the python redis implementations, and i am currently working on implementing resp3 in my fallback parser.

are there already plans to support RESP 3? if yes how are you planning to implement protocol switching?

this is somehow important because with RESP 3 parsers/clients are expected to return programming language native responses, like dicts, lists or sets.

since i mimic the api of hiredis-py, i would think it would be nice if there is a function to tell the parser to switch protocols.

something like parsert.protocol = 3

what do you think?

Kind regards

build hiredis failed with Python3.6.2 ubuntu:18.04 in docker

Hi,

can’t install hiredis on ubuntu18.04 by Dockerfile
I have installed python3-dev
here is the error

Collecting hiredis (from aioredis==1.1.0->-r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/1b/98/4766d85124b785ff1989ee1c79631a1b6ecfcb444ff39999a87877b2027e/hiredis-0.2.0.tar.gz (46kB)
Building wheels for collected packages: tornado, aiokafka, hiredis
  Running setup.py bdist_wheel for tornado: started
  Running setup.py bdist_wheel for tornado: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/29/8c/cf/6a5a8f6e35d877c0cb72b109d21c34981504897ce9a605e599
  Running setup.py bdist_wheel for aiokafka: started
  Running setup.py bdist_wheel for aiokafka: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/bd/6c/17/c2bd7b0a1bd623894cee46ef0c5743387d5b357a40f3b04d97
  Running setup.py bdist_wheel for hiredis: started
  Running setup.py bdist_wheel for hiredis: finished with status 'error'
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-cmwyelqa/hiredis/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp6zfo6hgopip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/hiredis
  copying hiredis/version.py -> build/lib.linux-x86_64-3.6/hiredis
  copying hiredis/__init__.py -> build/lib.linux-x86_64-3.6/hiredis
  running build_clib
  building 'hiredis_for_hiredis_py' library
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/vendor
  creating build/temp.linux-x86_64-3.6/vendor/hiredis
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-EKG1lX/python3.6-3.6.5=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -c vendor/hiredis/read.c -o build/temp.linux-x86_64-3.6/vendor/hiredis/read.o
  unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

easy_install hiredis # not work without `python-dev`

[email protected]:~/hi4# easy_install hiredis
Searching for hiredis
Reading http://pypi.python.org/simple/hiredis/
Best match: hiredis 0.1.3
Downloading https://pypi.python.org/packages/source/h/hiredis/hiredis-0.1.3.tar.gz#md5=69a66903399d6a1e69f3a62e11d34d26
Processing hiredis-0.1.3.tar.gz
Running hiredis-0.1.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Nvvs5R/hiredis-0.1.3/egg-dist-tmp-uVfMb7
warning: no previously-included files found matching 'vendor/hiredis/example*'
warning: no previously-included files found matching 'vendor/hiredis/text*'
In file included from src/reader.h:4,
                 from src/reader.c:2:
src/hiredis.h:4:20: error: Python.h: No such file or directory
In file included from src/reader.h:4,
                 from src/reader.c:2:
src/hiredis.h:20: error: expected specifier-qualifier-list before 'PyObject'
src/hiredis.h:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
In file included from src/reader.c:2:
src/reader.h:7: error: expected specifier-qualifier-list before 'PyObject_HEAD'
src/reader.h:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hiredis_ReaderType'
src/reader.c:5: error: expected declaration specifiers or '...' before 'PyObject'
src/reader.c:5: error: expected declaration specifiers or '...' before 'PyObject'
src/reader.c:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/reader.c:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/reader.c:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/reader.c:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hiredis_ReaderMethods'
src/reader.c:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hiredis_ReaderType'
src/reader.c:57: error: expected declaration specifiers or '...' before 'PyObject'
src/reader.c: In function 'tryParentize':
src/reader.c:58: error: 'PyObject' undeclared (first use in this function)
src/reader.c:58: error: (Each undeclared identifier is reported only once
src/reader.c:58: error: for each function it appears in.)
src/reader.c:58: error: 'parent' undeclared (first use in this function)
src/reader.c:60: error: expected expression before ')' token
src/reader.c:62: warning: implicit declaration of function 'PyList_SET_ITEM'
src/reader.c:62: error: 'obj' undeclared (first use in this function)
src/reader.c: At top level:
src/reader.c:67: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/reader.c:100: error: expected ')' before '*' token
src/reader.c: In function 'createStringObject':
src/reader.c:113: error: 'PyObject' undeclared (first use in this function)
src/reader.c:113: error: 'obj' undeclared (first use in this function)
src/reader.c:116: warning: implicit declaration of function 'createError'
src/reader.c:116: error: 'hiredis_ReaderObject' has no member named 'replyErrorClass'
src/reader.c:118: warning: implicit declaration of function 'createDecodedString'
src/reader.c:121: error: too many arguments to function 'tryParentize'
src/reader.c: In function 'createArrayObject':
src/reader.c:125: error: 'PyObject' undeclared (first use in this function)
src/reader.c:125: error: 'obj' undeclared (first use in this function)
src/reader.c:126: warning: implicit declaration of function 'PyList_New'
src/reader.c:127: error: too many arguments to function 'tryParentize'
src/reader.c: In function 'createIntegerObject':
src/reader.c:131: error: 'PyObject' undeclared (first use in this function)
src/reader.c:131: error: 'obj' undeclared (first use in this function)
src/reader.c:132: warning: implicit declaration of function 'PyLong_FromLongLong'
src/reader.c:133: error: too many arguments to function 'tryParentize'
src/reader.c: In function 'createNilObject':
src/reader.c:137: error: 'PyObject' undeclared (first use in this function)
src/reader.c:137: error: 'obj' undeclared (first use in this function)
src/reader.c:137: error: 'Py_None' undeclared (first use in this function)
src/reader.c:138: warning: implicit declaration of function 'Py_INCREF'
src/reader.c:139: error: too many arguments to function 'tryParentize'
src/reader.c: In function 'freeObject':
src/reader.c:143: warning: implicit declaration of function 'Py_XDECREF'
src/reader.c: In function 'Reader_dealloc':
src/reader.c:155: error: 'hiredis_ReaderObject' has no member named 'reader'
src/reader.c:156: error: 'hiredis_ReaderObject' has no member named 'encoding'
src/reader.c:157: warning: implicit declaration of function 'free'
src/reader.c:157: warning: incompatible implicit declaration of built-in function 'free'
src/reader.c:157: error: 'hiredis_ReaderObject' has no member named 'encoding'
src/reader.c:159: error: 'PyObject' undeclared (first use in this function)
src/reader.c:159: error: expected expression before ')' token
src/reader.c:159: error: expected expression before ')' token
src/reader.c: At top level:
src/reader.c:162: error: expected ')' before '*' token
src/reader.c:177: error: expected declaration specifiers or '...' before 'PyObject'
src/reader.c:177: error: expected declaration specifiers or '...' before 'PyObject'
src/reader.c: In function 'Reader_init':
src/reader.c:179: error: 'PyObject' undeclared (first use in this function)
src/reader.c:179: error: 'protocolErrorClass' undeclared (first use in this function)
src/reader.c:180: error: 'replyErrorClass' undeclared (first use in this function)
src/reader.c:181: error: 'encodingObj' undeclared (first use in this function)
src/reader.c:183: warning: implicit declaration of function 'PyArg_ParseTupleAndKeywords'
src/reader.c:183: error: 'args' undeclared (first use in this function)
src/reader.c:183: error: 'kwds' undeclared (first use in this function)
src/reader.c:188: warning: implicit declaration of function '_Reader_set_exception'
src/reader.c:188: error: 'hiredis_ReaderObject' has no member named 'protocolErrorClass'
src/reader.c:192: error: 'hiredis_ReaderObject' has no member named 'replyErrorClass'
src/reader.c:196: error: 'encbytes' undeclared (first use in this function)
src/reader.c:200: warning: implicit declaration of function 'PyUnicode_Check'
src/reader.c:201: warning: implicit declaration of function 'PyUnicode_AsASCIIString'
src/reader.c:203: warning: implicit declaration of function 'PyObject_Bytes'
src/reader.c:208: warning: implicit declaration of function 'PyBytes_Size'
src/reader.c:209: warning: implicit declaration of function 'PyBytes_AsString'
src/reader.c:210: error: 'hiredis_ReaderObject' has no member named 'encoding'
src/reader.c:210: warning: implicit declaration of function 'malloc'
src/reader.c:210: warning: incompatible implicit declaration of built-in function 'malloc'
src/reader.c:211: warning: implicit declaration of function 'memcpy'
src/reader.c:211: warning: incompatible implicit declaration of built-in function 'memcpy'
src/reader.c:211: error: 'hiredis_ReaderObject' has no member named 'encoding'
src/reader.c:212: error: 'hiredis_ReaderObject' has no member named 'encoding'
src/reader.c:213: warning: implicit declaration of function 'Py_DECREF'
src/reader.c: At top level:
src/reader.c:219: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/reader.c:240: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/reader.c:251: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
error: Setup script exited with error: command 'gcc' failed with exit status 1

Please add to README.md this line:

apt-get install python-dev

Allow to use platform hiredis libs on build.

At the build stage, the internal hiredis lib are used.
But on Linux the hiredis C lib are available, so in many cases it will be better to use the system one.

Upgrade hiredis version to v1.0.0

Since hiredis was bumped to version 1.0.0 and became stable, I think this is a good time to upgrade.

Got «TypeError: must be convertible to a buffer, not bytearray» in PyPy

PyPy version: 4.0.1 with GCC 4.8.4 on linux2
System: Ubuntu 15.04 x86 64bit
Error line: ./site-packages/redis/connection.py line 359 self._reader.feed(self._buffer, 0, bufflen)

Find where define attribute _reader: line 313 self._reader = hiredis.Reader(**kwargs), so I think this might be a hiredis problem.
self._buffer’s type: line 292 self._buffer = bytearray(socket_read_size)

I tried to change self._reader‘s type, do like this: self._reader.feed(buffer(self._buffer), 0, bufflen), but if i do this, process would crash.

Now I just move hiredis out, redis clients works no problem.

I install it with pypy1.9

because PyObject_Bytes is PyObject_Str alias.
so i replace PyObject_Bytes With PyObject_Str in reader.c on line 200.
and update pypy1.9 distribution to pypy 2.0x distribution.
then it’s ok.

src/reader.c:18: error: initializer element is not constant

I’m running into this problem when I try to build hiredis-py:

(env)Debian-50-lenny-64-LAMP:/tmp# git clone git://github.com/pietern/hiredis-py.git hir
Initialized empty Git repository in /tmp/hir/.git/
remote: Counting objects: 259, done.
remote: Compressing objects: 100% (158/158), done.
remote: Total 259 (delta 122), reused 193 (delta 83)
Receiving objects: 100% (259/259), 34.07 KiB, done.
Resolving deltas: 100% (122/122), done.

(env)Debian-50-lenny-64-LAMP:/tmp# cd hir
(env)Debian-50-lenny-64-LAMP:/tmp/hir# git submodule init
Submodule 'vendor/hiredis' (git://github.com/antirez/hiredis.git) registered for path 'vendor/hiredis'
(env)Debian-50-lenny-64-LAMP:/tmp/hir# git submodule update
Initialized empty Git repository in /tmp/hir/vendor/hiredis/.git/
remote: Counting objects: 2025, done.
remote: Compressing objects: 100% (715/715), done.
remote: Total 2025 (delta 1346), reused 1928 (delta 1257)
Receiving objects: 100% (2025/2025), 370.63 KiB, done.
Resolving deltas: 100% (1346/1346), done.
Submodule path 'vendor/hiredis': checked out '857b2690afd8d9fbbb3472c948b74dd6cd6e8a95'

(env)Debian-50-lenny-64-LAMP:/tmp/hir# ll
total 60K
drwxr-xr-x  8 root root 4.0K 2012-05-27 20:41 .
drwxrwxrwt 13 root root 4.0K 2012-05-27 20:41 ..
drwxr-xr-x  2 root root 4.0K 2012-05-27 20:41 benchmark
-rw-r--r--  1 root root 1.5K 2012-05-27 20:41 COPYING
drwxr-xr-x  8 root root 4.0K 2012-05-27 20:42 .git
-rw-r--r--  1 root root   28 2012-05-27 20:41 .gitignore
-rw-r--r--  1 root root   96 2012-05-27 20:41 .gitmodules
drwxr-xr-x  2 root root 4.0K 2012-05-27 20:41 hiredis
-rw-r--r--  1 root root  157 2012-05-27 20:41 MANIFEST.in
-rw-r--r--  1 root root 4.0K 2012-05-27 20:41 README.md
-rwxr-xr-x  1 root root 1.4K 2012-05-27 20:41 setup.py
drwxr-xr-x  2 root root 4.0K 2012-05-27 20:41 src
drwxr-xr-x  2 root root 4.0K 2012-05-27 20:41 test
-rwxr-xr-x  1 root root  107 2012-05-27 20:41 test.py
drwxr-xr-x  3 root root 4.0K 2012-05-27 20:42 vendor

(env)Debian-50-lenny-64-LAMP:/tmp/hir# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.5
creating build/lib.linux-x86_64-2.5/hiredis
copying hiredis/version.py -> build/lib.linux-x86_64-2.5/hiredis
copying hiredis/__init__.py -> build/lib.linux-x86_64-2.5/hiredis
running build_clib
building 'hiredis' library
creating build/temp.linux-x86_64-2.5
creating build/temp.linux-x86_64-2.5/vendor
creating build/temp.linux-x86_64-2.5/vendor/hiredis
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/hiredis.c -o build/temp.linux-x86_64-2.5/vendor/hiredis/hiredis.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/net.c -o build/temp.linux-x86_64-2.5/vendor/hiredis/net.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivendor/hiredis -c vendor/hiredis/sds.c -o build/temp.linux-x86_64-2.5/vendor/hiredis/sds.o
ar -cr build/temp.linux-x86_64-2.5/libhiredis.a build/temp.linux-x86_64-2.5/vendor/hiredis/hiredis.o build/temp.linux-x86_64-2.5/vendor/hiredis/net.o build/temp.linux-x86_64-2.5/vendor/hiredis/sds.o
running build_ext
building 'hiredis.hiredis' extension
creating build/temp.linux-x86_64-2.5/src
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Isrc -Ivendor -I/usr/include/python2.5 -c src/reader.c -o build/temp.linux-x86_64-2.5/src/reader.o
src/reader.c:17: warning: implicit declaration of functionPyVarObject_HEAD_INITsrc/reader.c:18: error: initializer element is not constant
src/reader.c:18: error: (near initialization forhiredis_ReaderType.ob_refcnt’)
src/reader.c:18: error: expected ‘}’ before string constant
src/reader.c: In functioncreateDecodedString’:
src/reader.c:71: warning: implicit declaration of functionPyBytes_FromStringAndSizesrc/reader.c:71: warning: assignment makes pointer from integer without a cast
src/reader.c:77: warning: assignment makes pointer from integer without a cast
src/reader.c: In functionfreeObject’:
src/reader.c:136: warning: dereferencingvoid *pointer
src/reader.c:136: error: request for memberob_refcntin something not a structure or union
src/reader.c: In functionReader_init’:
src/reader.c:200: warning: implicit declaration of functionPyObject_Bytessrc/reader.c:200: warning: assignment makes pointer from integer without a cast
src/reader.c:205: warning: implicit declaration of functionPyBytes_Sizesrc/reader.c:206: warning: implicit declaration of functionPyBytes_AsStringsrc/reader.c:206: warning: assignment makes pointer from integer without a cast
error: command 'gcc' failed with exit status 1```

Need a Windows version

I need to work with https://rtfd.org/ code on Windows and hiredis is a single library that fails to install. Is it possible to review and merge redis/hiredis#52 (maybe even partially) so that a wheel for Windows become possible?

Binary hiredis-py 0.1.1 incompatibility with hiredis-0.11.0

I’ve built hiredis-py 0.1.1 on Fedora 19 and found the following code snippet would segfault:

import hiredis
reader = hiredis.Reader()
reader.feed('+PONGrn')
response = reader.gets()
print response

I noticed that it would only segfault when hiredis-py was dynamically linked against the system hiredis which would occur when the Fedora hiredis-devel package was installed:

$ ldd /lib64/python2.7/site-packages/hiredis/hiredis.so | grep hiredis
    libhiredis.so.0.10 => /lib64/libhiredis.so.0.10 (0x00007f7ee22ee000)

Note that Fedora 19 is shipping hiredis-0.11.0 and it appears the upstream hiredis package did not bump their SONAME which is part of the problem.

After debugging I’ve found the cause of the crash is that the following upstream upstream hiredis commits changed the size of struct redisReader:
redis/[email protected]51ab89d Max depth of multi-bulk reply moved from 2 to 7.
redis/[email protected]7f09505 Configurable reader max idle buffer size.

Changing the size of struct redisReader causes hiredis-py to fail to initialize the redisReplyObjectFunctions *fn since it is now in a different memory address and thus the default hiredis functions are called instead of the hiredis-py versions.

As I mentioned previously the real problem here is that hiredis broke their ABI between 0.10.0 and 0.11.0 and did not bump their SONAME. The secondary problem is that hiredis-py includes its own hiredis.h which means that simply rebuilding on Fedora 19 doesn’t solve the problem. The only work around that I have is to rebuild hiredis-py without the hiredis-devel package installed which causes hiredis-py to build its own included version of hiredis and statically link against that version.

Python 3.5.2 Build Fail

Using a virtualenv on Ubuntu.

python3-dev is currently installed on the system (all system-requirements are met, as far as the docs go).

Collecting hiredis (from aioredis)
  Using cached hiredis-0.2.0.tar.gz
Building wheels for collected packages: hiredis
  Running setup.py bdist_wheel for hiredis ... error
  Complete output from command /home/ubuntu/async/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5ypx42mc/hiredis/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpox55b2qlpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/hiredis
  copying hiredis/version.py -> build/lib.linux-x86_64-3.5/hiredis
  copying hiredis/__init__.py -> build/lib.linux-x86_64-3.5/hiredis
  running build_clib
  building 'hiredis_for_hiredis_py' library
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/vendor
  creating build/temp.linux-x86_64-3.5/vendor/hiredis
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -c vendor/hiredis/read.c -o build/temp.linux-x86_64-3.5/vendor/hiredis/read.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -c vendor/hiredis/sds.c -o build/temp.linux-x86_64-3.5/vendor/hiredis/sds.o
  x86_64-linux-gnu-gcc-ar rc build/temp.linux-x86_64-3.5/libhiredis_for_hiredis_py.a build/temp.linux-x86_64-3.5/vendor/hiredis/read.o build/temp.linux-x86_64-3.5/vendor/hiredis/sds.o
  running build_ext
  building 'hiredis.hiredis' extension
  creating build/temp.linux-x86_64-3.5/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Ivendor -I/usr/include/python3.5m -I/home/ubuntu/async/include/python3.5m -c src/reader.c -o build/temp.linux-x86_64-3.5/src/reader.o
  In file included from src/reader.h:4:0,
                   from src/reader.c:1:
  src/hiredis.h:4:20: fatal error: Python.h: No such file or directory
   #include <Python.h>
                      ^
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for hiredis

hiredis-py ignores string decoding errors

When an encoding is specified (for instance ‘utf8’), hiredis-py will attempt to decode string values using that encoding. If the decode raises a ValueError, hiredis-py will ignore the error and return the original bytes.

In my opinion hiredis-py should instead raise a UnicodeDecodeError (or another similar exception) to indicate that the decoding failed. Asking for a decoded string and getting back bytes seems wrong.

Perhaps to mitigate backwards incompatibility issues, a separate strict flag could be introduced with a default value of False. When encoding != None && strict==False, hiredis-py would continue to hide the error and return bytes on error. However when encoding != None && strict==True, hiredis-py would raise an error.

I’m happy to put together a PR for this.

v0.3.0 release missing vendor/ directory

The v0.3.0 release tarball is missing the vendor/ directory so this does not build, alas.

Installing hiredis fails after upgrading to Python 3.8

While installing hiredis after upgrading to Python 3.8, I am getting error saying error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe' failed with exit status 2.
I tried reinstalling Visual Studio Build tools again even after i had it installed (version 14.23) but it didn’t worked. Following is the full traceback:

C:Usersthecosmos>pip install hiredis
Collecting hiredis
  Using cached https://files.pythonhosted.org/packages/9e/e0/c160dbdff032ffe68e4b3c576cba3db22d8ceffc9513ae63368296d1bcc8/hiredis-1.0.0.tar.gz
Installing collected packages: hiredis
    Running setup.py install for hiredis ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:usersthecosmosappdatalocalprogramspythonpython38python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\thecosmos\AppData\Local\Temp\pip-install-uq9svr1x\hiredis\setup.py'"'"'; __file__='"'"'C:\Users\thecosmos\AppData\Local\Temp\pip-install-uq9svr1x\hiredis\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersthecosmosAppDataLocalTemppip-record-furdsc9jinstall-record.txt' --single-version-externally-managed --compile
         cwd: C:UsersthecosmosAppDataLocalTemppip-install-uq9svr1xhiredis
    Complete output (11 lines):
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.8
    creating buildlib.win-amd64-3.8hiredis
    copying hiredisversion.py -> buildlib.win-amd64-3.8hiredis
    copying hiredis__init__.py -> buildlib.win-amd64-3.8hiredis
    running build_ext
    building 'hiredis.hiredis' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersthecosmosappdatalocalprogramspythonpython38python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\thecosmos\AppData\Local\Temp\pip-install-uq9svr1x\hiredis\setup.py'"'"'; __file__='"'"'C:\Users\thecosmos\AppData\Local\Temp\pip-install-uq9svr1x\hiredis\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersthecosmosAppDataLocalTemppip-record-furdsc9jinstall-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

Permit errors=’surrogateescape’ and others

Relates to commit #82

This introduces the errors attribute, but it rejects all values apart from a hard-coded few. In particular, errors='surrogateescape' should be allowed (PEP 383, introduced in python 3.1) but is blocked.

However there are other defined error handlers, plus it’s possible to add more dynamically with register_error.

Therefore I think it’s better not to perform any validation here, but allow the provided value to be passed through to bytes.decode. Unknown values are rejected as soon as you try to use them.

>>> b'fooxff'.decode("utf-8", "surrogateescape")
'fooudcff'
>>> b'fooxff'.decode("utf-8", "flurble")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
LookupError: unknown error handler name 'flurble'
>>>

Or, if you must validate before use, then use codecs.lookup_error instead of a hard-coded list.

>>> codecs.lookup_error("surrogateescape")
<built-in function surrogateescape>
>>> codecs.lookup_error("flurble")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
LookupError: unknown error handler name 'flurble'

PyPy Compatability

I was researching an issue a user reported to redis/redis-py#708 about some issues with hiredis and PyPy version 4.0.1 (and likely other versions of PyPy).

hiredis-py’s feed method isn’t able to accept bytearray objects running on PyPy. This test (https://github.com/redis/hiredis-py/blob/master/test/reader.py#L168) in hiredis-py’s test suite fails running on PyPy testing this exact issue. It produces the following traceback:

Traceback (most recent call last):
  File "/Users/andy/hiredis-py/test/reader.py", line 170, in test_feed_bytearray
    self.reader.feed(bytearray(b"+okrn"))
TypeError: must be convertible to a buffer, not bytearray

While trying to get hiredis-py’s test suite to run on PyPy, I also found two other tests (https://github.com/redis/hiredis-py/blob/master/test/reader.py#L133-L139) that cause the test runner to segfault with the following output:

<[email protected]: ~hiredis-py (master)> python test.py
.................Fatal error in cpyext, CPython compatibility layer, calling PyList_CheckExact
Either report a bug or consider not using this particular extension
<OpErrFmt object at 0x1074432e0>
RPython traceback:
  File "pypy_module_cpyext_api_2.c", line 21254, in PyPyList_CheckExact
  File "pypy_module_cpyext_pyobject.c", line 2094, in BaseCpyTypedescr_realize
  File "pypy_objspace_std_objspace.c", line 4537, in allocate_instance__W_ObjectObject
  File "pypy_objspace_std_typeobject.c", line 4354, in W_TypeObject_check_user_subclass
Segmentation fault: 11

Can’t install on Python 2.5 (using FreeBSD)

The results of pip install hiredis:

Downloading/unpacking hiredis
Downloading hiredis-0.1.0.tar.gz
Running setup.py egg_info for package hiredis
Installing collected packages: hiredis
Running setup.py install for hiredis
    building 'hiredis' library
    cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Ivendor/hiredis -c vendor/hiredis/hiredis.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/hiredis.o
    cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Ivendor/hiredis -c vendor/hiredis/net.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/net.o
    cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Ivendor/hiredis -c vendor/hiredis/sds.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/sds.o
    ar -cr build/temp.freebsd-7.2-RELEASE-amd64-2.5/libhiredis.a build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/hiredis.o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/net.o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/sds.o
    building 'hiredis.hiredis' extension
    cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Isrc -Ivendor -I/usr/local/include/python2.5 -c src/hiredis.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/src/hiredis.o
    cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Isrc -Ivendor -I/usr/local/include/python2.5 -c src/reader.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/src/reader.o
    src/reader.c: In function 'freeObject':
    src/reader.c:137: warning: dereferencing 'void *' pointer
    src/reader.c:137: error: request for member 'ob_refcnt' in something not a structure or union
    error: command 'cc' failed with exit status 1
    Complete output from command /usr/local/bin/python2.5 -c "import setuptools;__file__='build/hiredis/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-02VZdu-record/install-record.txt:
    running install

running build

running build_py

creating build

creating build/lib.freebsd-7.2-RELEASE-amd64-2.5

creating build/lib.freebsd-7.2-RELEASE-amd64-2.5/hiredis

copying hiredis/__init__.py -> build/lib.freebsd-7.2-RELEASE-amd64-2.5/hiredis

copying hiredis/version.py -> build/lib.freebsd-7.2-RELEASE-amd64-2.5/hiredis

running build_clib

building 'hiredis' library

creating build/temp.freebsd-7.2-RELEASE-amd64-2.5

creating build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor

creating build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis

cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Ivendor/hiredis -c vendor/hiredis/hiredis.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/hiredis.o

cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Ivendor/hiredis -c vendor/hiredis/net.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/net.o

cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Ivendor/hiredis -c vendor/hiredis/sds.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/sds.o

ar -cr build/temp.freebsd-7.2-RELEASE-amd64-2.5/libhiredis.a build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/hiredis.o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/net.o build/temp.freebsd-7.2-RELEASE-amd64-2.5/vendor/hiredis/sds.o

running build_ext

building 'hiredis.hiredis' extension

creating build/temp.freebsd-7.2-RELEASE-amd64-2.5/src

cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Isrc -Ivendor -I/usr/local/include/python2.5 -c src/hiredis.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/src/hiredis.o

cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -Isrc -Ivendor -I/usr/local/include/python2.5 -c src/reader.c -o build/temp.freebsd-7.2-RELEASE-amd64-2.5/src/reader.o

src/reader.c: In function 'freeObject':

src/reader.c:137: warning: dereferencing 'void *' pointer

src/reader.c:137: error: request for member 'ob_refcnt' in something not a structure or union

error: command 'cc' failed with exit status 1

I’m not sure if it’s a FreeBSD specific issue since I don’t have any other machines with Python 2.5 available.

System info:
FreeBSD 7.2
GCC 4.2.1
Python 2.5.5

hiredis causes pip to segfault

pip 9.0.1, Python 3.5.2, Ubuntu 16.04.2

mkvirtualenv -p $(which python3.5) testenv
pip install -I hiredis  # Works fine, the first time on a fresh virtualenv.
pip install -I hiredis  # segfaults if run in a virtualenv that already has hiredis.

Adding type stubs

Can’t install hiredis with pip on CentOs 7

I already installed python34-devel,

[[email protected] vagrant]$ sudo pip install hiredis
Collecting hiredis
  Using cached hiredis-0.2.0.tar.gz
Installing collected packages: hiredis
  Running setup.py install for hiredis ... error
    Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-DJcC2F/hiredis/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-cYj42J-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/hiredis
    copying hiredis/version.py -> build/lib.linux-x86_64-2.7/hiredis
    copying hiredis/__init__.py -> build/lib.linux-x86_64-2.7/hiredis
    running build_clib
    building 'hiredis_for_hiredis_py' library
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/vendor
    creating build/temp.linux-x86_64-2.7/vendor/hiredis
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c vendor/hiredis/read.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/read.o
    unable to execute gcc: No such file or directory
    error: command 'gcc' failed with exit status 1

Python 3 bug: sometimes the response to DEL is ‘OK’

Hi !

I’m porting my code base to python 3, and just faced this issue:

  File "/my-env/lib/python3.5/site-packages/redis/client.py", line 842, in delete
    return self.execute_command('DEL', *names)
  File "/my-env/lib/python3.5/site-packages/redis/client.py", line 573, in execute_command
    return self.parse_response(connection, command_name, **options)
  File "/my-env/lib/python3.5/site-packages/redis/client.py", line 588, in parse_response
    return self.response_callbacks[command_name](response, **options)
ValueError: invalid literal for int() with base 10: b'OK'

This DEL command is run among multiple pipelines.
It happens for both PythonParser and HiredisParser.

If you need more details, I can try to isolate the succession of commands that fail.

Thanks!

Release latest version

Last version released was 2 years ago. Please release new version so we can use it in production environment.

Installation on Windows

Broken bdist_rpm

Hi,

I’m trying to build an RPM for hiredis 0.1.1 and it seems that this functionality is broken due to the .h files not being included in the MANIFEST. Adding these lines at the end of the file fixes the problem:

src/hiredis.h
src/reader.h
vendor/hiredis/hiredis.h
vendor/hiredis/fmacros.h
vendor/hiredis/net.h
vendor/hiredis/sds.h

Wrong submodules

Hiredis repo is moved to github.com/redis/hiredis. Please update submodules!

ImportError: No module named build_clib

I encountered this problem when I install it on centos6.5

pip2.7 install hiredis-0.2.0.tar.gz

any advice? thx

build hiredis failed with Python3.5.0

Build hiredis with Python3.5.0, it will be error: «AssertionError»

More details as below:

....
  gcc -pthread -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ivendor -I/usr/local/python3/include/python3.5m -c src/hiredis.c -o build/temp.linux-x86_64-3.5/src/hiredis.o
  gcc -pthread -shared build/temp.linux-x86_64-3.5/src/reader.o build/temp.linux-x86_64-3.5/src/hiredis.o -Lbuild/temp.linux-x86_64-3.5 -lhiredis_for_hiredis_py -o build/lib.linux-x86_64-3.5/hiredis/hiredis.cpython-35m-x86_64-linux-gnu.so
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/hiredis
  copying build/lib.linux-x86_64-3.5/hiredis/hiredis.cpython-35m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/hiredis
  copying build/lib.linux-x86_64-3.5/hiredis/__init__.py -> build/bdist.linux-x86_64/wheel/hiredis
  copying build/lib.linux-x86_64-3.5/hiredis/version.py -> build/bdist.linux-x86_64/wheel/hiredis
  running install_egg_info
  running egg_info
  writing dependency_links to hiredis.egg-info/dependency_links.txt
  writing hiredis.egg-info/PKG-INFO
  writing top-level names to hiredis.egg-info/top_level.txt
  warning: manifest_maker: standard file '-c' not found

  reading manifest file 'hiredis.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files found matching 'vendor/hiredis/example*'
  warning: no previously-included files found matching 'vendor/hiredis/text*'
  writing manifest file 'hiredis.egg-info/SOURCES.txt'
  Copying hiredis.egg-info to build/bdist.linux-x86_64/wheel/hiredis-0.2.0-py3.5.egg-info
  running install_scripts
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-z8jh6ss0/hiredis/setup.py", line 81, in <module>
      'Topic :: Software Development',
    File "/usr/local/python3/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/python3/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/local/python3/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/mnt/env3/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
      archive_basename = self.get_archive_basename()
    File "/mnt/env3/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
      impl_tag, abi_tag, plat_tag = self.get_tag()
    File "/mnt/env3/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
      assert tag == supported_tags[0]
  AssertionError

  ----------------------------------------
  Failed building wheel for hiredis
Failed to build hiredis

build hiredis failed with Python3.6.2 macOS

Hi,

can’t install hiredis which fails at building wheel. Please advise.

wheel 0.29.0 py36h3597b6d_1

pip install hiredis
Collecting hiredis
  Using cached hiredis-0.2.0.tar.gz
Building wheels for collected packages: hiredis
  Running setup.py bdist_wheel for hiredis ... error
  Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/yy/_lh_xrrx7r92m999snj4dt1nvs_f1b/T/pip-build-im8m7cxh/hiredis/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/yy/_lh_xrrx7r92m999snj4dt1nvs_f1b/T/tmplgz4f1q6pip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.6
  creating build/lib.macosx-10.9-x86_64-3.6/hiredis
  copying hiredis/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/hiredis
  copying hiredis/version.py -> build/lib.macosx-10.9-x86_64-3.6/hiredis
  running build_clib
  building 'hiredis_for_hiredis_py' library
  creating build/temp.macosx-10.9-x86_64-3.6
  creating build/temp.macosx-10.9-x86_64-3.6/vendor
  creating build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis
  /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -c vendor/hiredis/read.c -o build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis/read.o
  /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -c vendor/hiredis/sds.c -o build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis/sds.o
  x86_64-apple-darwin13.4.0-ar rc build/temp.macosx-10.9-x86_64-3.6/libhiredis_for_hiredis_py.a build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis/read.o build/temp.macosx-10.9-x86_64-3.6/vendor/hiredis/sds.o
  unable to execute 'x86_64-apple-darwin13.4.0-ar': No such file or directory
  error: command 'x86_64-apple-darwin13.4.0-ar' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for hiredis

py -3.9 -m pip install -U pillow

терпит неудачу, включает следующие сообщения:

  ERROR: Failed building wheel for pillow
  Running setup.py clean for pillow
Failed to build pillow
DEPRECATION: Could not build wheels for pillow which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: pillow
    Running setup.py install for pillow ... error
    ERROR: Command errored out with exit status 1:

с использованием:

> py -3.9 -m pip --version
pip 20.2 from C:UsersDougAppDataLocalProgramsPythonPython39libsite-packagespip (python 3.9)
> py -3.9
Python 3.9.0b5 (tags/v3.9.0b5:8ad7d50, Jul 20 2020, 18:35:09) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

В Windows 10 pro 1909, полное исправление от 30 июля 2020 г.

Об этом сообщается как https://github.com/python-pillow/Pillow/issues/4827 .

@djhenderson Ваша проблема не связана. Устаревший резервный вариант setup.py install просто показывает предупреждение и не влияет на отображаемую вами ошибку.

Спасибо за четкое предоставление всей соответствующей информации здесь @djhenderson. Я думаю, что трекер проблем для Pillow (где вы зарегистрировали проблему) — это правильное место, где можно получить помощь по вашей проблеме. :)

как вы делаете это в Mac?

Я получаю следующую ошибку.
Не удалось собрать pyaudio
УСТАРЕВШАЯ: Не удалось создать колеса для pyaudio, которые не используют PEP 517. Для них pip вернется к устаревшему «setup.py install». pip 21.0 удалит поддержку этой функции. Возможная замена заключается в устранении проблемы со сборкой колес, о которой говорилось выше. Вы можете найти обсуждение по этому поводу на https://github.com/pypa/pip/issues/8368.

Я был удивлен, увидев так много обратных ссылок на простое сообщение об устаревании и даже отрицательных отзывов. И затем я понял, что каждая из связанных проблем просто содержит сообщение об ошибке, в котором кто-то не может собрать произвольный пакет из исходного кода с pip install (который будет содержать ссылку на эту проблему), и люди не осознают устаревание сообщение не имеет к этому никакого отношения.

Возможно, нам следовало показывать сообщение только в случае успешного выполнения команды setup.py install , а не безоговорочно . Это спасло бы нас от многих сбитых с толку пользователей, обвиняющих эту проблему в своих проблемах.

@uranusjr Вчера я понял то же самое. С текущим сообщением об устаревании мы рискуем потерять полезные отчеты в шуме. См. № 8752 для возможного лучшего подхода.

@googleworm , если установка pyaudio прошла успешно после отображения предупреждения об устаревании, предоставьте здесь подробный журнал. Если он заканчивается на Running setup.py install for pyaudio ... error , за которым следует журнал ошибок компиляции, то ваша проблема не связана с этой проблемой, и вам следует обратиться за помощью к инструкциям по установке pyaudio.

@uranusjr @sbidoul Я не знаю, полезно ли это, но по какой-то причине я получил ссылку на эту проблему, когда моя машина не смогла построить колеса для установки пакета регулярных выражений. Я сомневаюсь, что эта проблема имеет какое-либо отношение к этому, не так ли?

Я новичок в git и github, поэтому извините, если мой комментарий не очень полезен. Спасибо.

Screenshot 2020-08-12 at 10 55 49 PM

Вот мой полный журнал ошибок, который я получил:

(base) Aditya's-MacBook-Pro: aditya$ pip install regex
Collecting regex
  Using cached regex-2020.7.14.tar.gz (690 kB)
Building wheels for collected packages: regex
  Building wheel for regex (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/apple/opt/anaconda3/envs/test1/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-install-3ss2v4zg/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-install-3ss2v4zg/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-wheel-n2v32c8x
       cwd: /private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-install-3ss2v4zg/regex/
  Complete output (17 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.8
  creating build/lib.macosx-10.9-x86_64-3.8/regex
  copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/regex
  copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.8/regex
  copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.8/regex
  copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.8/regex
  running build_ext
  building 'regex._regex' extension
  creating build/temp.macosx-10.9-x86_64-3.8
  creating build/temp.macosx-10.9-x86_64-3.8/regex_3
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/apple/opt/anaconda3/envs/test1/include -arch x86_64 -I/Users/apple/opt/anaconda3/envs/test1/include -arch x86_64 -I/Users/apple/opt/anaconda3/envs/test1/include/python3.8 -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.8/regex_3/_regex.o
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for regex
  Running setup.py clean for regex
Failed to build regex
DEPRECATION: Could not build wheels for regex which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: regex
    Running setup.py install for regex ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/apple/opt/anaconda3/envs/test1/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-install-3ss2v4zg/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-install-3ss2v4zg/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-record-fm1zm8k0/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apple/opt/anaconda3/envs/test1/include/python3.8/regex
         cwd: /private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-install-3ss2v4zg/regex/
    Complete output (17 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.8
    creating build/lib.macosx-10.9-x86_64-3.8/regex
    copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/regex
    copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.8/regex
    copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.8/regex
    copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.8/regex
    running build_ext
    building 'regex._regex' extension
    creating build/temp.macosx-10.9-x86_64-3.8
    creating build/temp.macosx-10.9-x86_64-3.8/regex_3
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/apple/opt/anaconda3/envs/test1/include -arch x86_64 -I/Users/apple/opt/anaconda3/envs/test1/include -arch x86_64 -I/Users/apple/opt/anaconda3/envs/test1/include/python3.8 -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.8/regex_3/_regex.o
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/apple/opt/anaconda3/envs/test1/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-install-3ss2v4zg/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-install-3ss2v4zg/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4c/_r8vg69s4bb61j6syx4sdj900000gn/T/pip-record-fm1zm8k0/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apple/opt/anaconda3/envs/test1/include/python3.8/regex Check the logs for full command output.

Кроме того, пожалуйста, дайте мне знать, если вы могли бы помочь мне с этой проблемой. Спасибо.

@adityagarg7 adityagarg7 , как вы можете видеть, ошибка компиляции одинакова для Building wheel for regex и Running setup.py install for regex , поэтому вам нужно изучить свои настройки для компиляции модулей Python с кодом C. Поэтому, если вы не возражаете, я отмечу ваши комментарии как не относящиеся к теме, чтобы сосредоточить внимание на этом вопросе. Тем не менее, ваше замешательство понятно, и мы работаем над уточнением предупреждения об устаревании.

Windows 10, та же ошибка с sqlcipher3

$ pip install pysqlcipher3
Collecting pysqlcipher3
  Using cached pysqlcipher3-1.0.3.tar.gz (100 kB)
Building wheels for collected packages: pysqlcipher3
  Building wheel for pysqlcipher3 (setup.py): started
  Building wheel for pysqlcipher3 (setup.py): finished with status 'done'
  WARNING: Legacy build of wheel for 'pysqlcipher3' created no files.
  Command arguments: 'c:sitessylwester.techapivenvscriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\Creato                    rTemp\pip-install-r8ub57sq\pysqlcipher3\setup.py'"'"'; __file__='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-r8ub57sq\pysqlcipher3\setup.py'"'"';f=geta                    ttr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersPubl                    icDocumentsWondershareCreatorTemppip-wheel-1m4gkydz'
  Command output: [use --verbose to show]
  Running setup.py clean for pysqlcipher3
Failed to build pysqlcipher3
DEPRECATION: Could not build wheels for pysqlcipher3 which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this function                    ality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: pysqlcipher3
    Running setup.py install for pysqlcipher3: started
    Running setup.py install for pysqlcipher3: finished with status 'done'
Successfully installed pysqlcipher3
(venv)

@sylwesterdigital Нам нужно понять, почему setup.py bdist_wheel для этого пакета не генерирует колесо. Не могли бы вы попробовать еще раз с --verbose , а также запустить pip list после команды установки?

$ pip install —verbose pysqlcipher3

Using pip 20.2.2 from c:usersflaboyappdatalocalprogramspythonpython38libsite-packagespip (python 3.8)
Non-user install because site-packages writeable
Created temporary directory: C:UsersPublicDocumentsWondershareCreatorTemppip-ephem-wheel-cache-ikdirft5
Created temporary directory: C:UsersPublicDocumentsWondershareCreatorTemppip-req-tracker-21e96s63
Initialized build tracking at C:UsersPublicDocumentsWondershareCreatorTemppip-req-tracker-21e96s63
Created build tracker: C:UsersPublicDocumentsWondershareCreatorTemppip-req-tracker-21e96s63
Entered build tracker: C:UsersPublicDocumentsWondershareCreatorTemppip-req-tracker-21e96s63
Created temporary directory: C:UsersPublicDocumentsWondershareCreatorTemppip-install-enu1m14b
1 location(s) to search for versions of pysqlcipher3:
* https://pypi.org/simple/pysqlcipher3/
Fetching project page and analyzing links: https://pypi.org/simple/pysqlcipher3/
Getting page https://pypi.org/simple/pysqlcipher3/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/pysqlcipher3/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/pysqlcipher3/ HTTP/1.1" 304 0
  Found link https://files.pythonhosted.org/packages/a4/06/1d56bdec3129eff6dd54323d249784ccd90ce03c8cae7870d45e434bae77/pysqlcipher3-1.0.3.tar.gz#sha256=694e5bbb6ece8a064bd55f261e54b9ffbb3af1784afdc4dce4948a0251a8a430 (from https://pypi.org/simple/pysqlcipher3/), version: 1.0.3
Given no hashes to check 1 links for project 'pysqlcipher3': discarding no candidates
Using version 1.0.3 (newest of versions: 1.0.3)
Collecting pysqlcipher3
  Created temporary directory: C:UsersPublicDocumentsWondershareCreatorTemppip-unpack-4ms5c69f
  Looking up "https://files.pythonhosted.org/packages/a4/06/1d56bdec3129eff6dd54323d249784ccd90ce03c8cae7870d45e434bae77/pysqlcipher3-1.0.3.tar.gz" in the cache
  Current age based on date: 20598953
  Ignoring unknown cache-control directive: immutable
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 20598953
  Using cached pysqlcipher3-1.0.3.tar.gz (100 kB)
  Added pysqlcipher3 from https://files.pythonhosted.org/packages/a4/06/1d56bdec3129eff6dd54323d249784ccd90ce03c8cae7870d45e434bae77/pysqlcipher3-1.0.3.tar.gz#sha256=694e5bbb6ece8a064bd55f261e54b9ffbb3af1784afdc4dce4948a0251a8a430 to build tracker 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-req-tracker-21e96s63'
    Running setup.py (path:C:UsersPublicDocumentsWondershareCreatorTemppip-install-enu1m14bpysqlcipher3setup.py) egg_info for package pysqlcipher3
    Created temporary directory: C:UsersPublicDocumentsWondershareCreatorTemppip-pip-egg-info-9ai39d2m
    Running command python setup.py egg_info
    running egg_info
    creating C:UsersPublicDocumentsWondershareCreatorTemppip-pip-egg-info-9ai39d2mpysqlcipher3.egg-info
    writing C:UsersPublicDocumentsWondershareCreatorTemppip-pip-egg-info-9ai39d2mpysqlcipher3.egg-infoPKG-INFO
    writing dependency_links to C:UsersPublicDocumentsWondershareCreatorTemppip-pip-egg-info-9ai39d2mpysqlcipher3.egg-infodependency_links.txt
    writing top-level names to C:UsersPublicDocumentsWondershareCreatorTemppip-pip-egg-info-9ai39d2mpysqlcipher3.egg-infotop_level.txt
    writing manifest file 'C:UsersPublicDocumentsWondershareCreatorTemppip-pip-egg-info-9ai39d2mpysqlcipher3.egg-infoSOURCES.txt'
    reading manifest file 'C:UsersPublicDocumentsWondershareCreatorTemppip-pip-egg-info-9ai39d2mpysqlcipher3.egg-infoSOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*~' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    writing manifest file 'C:UsersPublicDocumentsWondershareCreatorTemppip-pip-egg-info-9ai39d2mpysqlcipher3.egg-infoSOURCES.txt'
  Source in c:userspublicdocumentswondersharecreatortemppip-install-enu1m14bpysqlcipher3 has version 1.0.3, which satisfies requirement pysqlcipher3 from https://files.pythonhosted.org/packages/a4/06/1d56bdec3129eff6dd54323d249784ccd90ce03c8cae7870d45e434bae77/pysqlcipher3-1.0.3.tar.gz#sha256=694e5bbb6ece8a064bd55f261e54b9ffbb3af1784afdc4dce4948a0251a8a430
  Removed pysqlcipher3 from https://files.pythonhosted.org/packages/a4/06/1d56bdec3129eff6dd54323d249784ccd90ce03c8cae7870d45e434bae77/pysqlcipher3-1.0.3.tar.gz#sha256=694e5bbb6ece8a064bd55f261e54b9ffbb3af1784afdc4dce4948a0251a8a430 from build tracker 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-req-tracker-21e96s63'
Building wheels for collected packages: pysqlcipher3
  Created temporary directory: C:UsersPublicDocumentsWondershareCreatorTemppip-wheel-3r_61g6i
  Building wheel for pysqlcipher3 (setup.py): started
  Destination directory: C:UsersPublicDocumentsWondershareCreatorTemppip-wheel-3r_61g6i
  Running command 'c:usersflaboyappdatalocalprogramspythonpython38python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-enu1m14b\pysqlcipher3\setup.py'"'"'; __file__='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-enu1m14b\pysqlcipher3\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersPublicDocumentsWondershareCreatorTemppip-wheel-3r_61g6i'
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.8
  creating buildlib.win-amd64-3.8pysqlcipher3
  copying libdbapi2.py -> buildlib.win-amd64-3.8pysqlcipher3
  copying libdump.py -> buildlib.win-amd64-3.8pysqlcipher3
  copying lib__init__.py -> buildlib.win-amd64-3.8pysqlcipher3
  creating buildlib.win-amd64-3.8pysqlcipher3test
  copying libtest__init__.py -> buildlib.win-amd64-3.8pysqlcipher3test
  creating buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3dbapi.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3dump.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3factory.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3hooks.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3regression.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3sqlcipher.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3transactions.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3types.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3userfunctions.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3__init__.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  running build_ext
  Builds a C extension linking against libsqlcipher library
  building 'pysqlcipher3._sqlite3' extension
  creating buildtemp.win-amd64-3.8
  creating buildtemp.win-amd64-3.8Release
  creating buildtemp.win-amd64-3.8Releasesrc
  creating buildtemp.win-amd64-3.8Releasesrcpython3
  C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMODULE_NAME="pysqlcipher3.dbapi2" -Ic:usersflaboyappdatalocalprogramspythonpython38include -Ic:usersflaboyappdatalocalprogramspythonpython38include "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110include" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0um" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt" /Tcsrcpython3module.c /Fobuildtemp.win-amd64-3.8Releasesrcpython3module.obj
  module.c
  C:UsersPublicDocumentsWondershareCreatorTemppip-install-enu1m14bpysqlcipher3srcpython3connection.h(33): fatal error C1083: Cannot open include file: 'sqlcipher/sqlite3.h': No such file or directory
  error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe' failed with exit status 2
  WARNING: Legacy build of wheel for 'pysqlcipher3' created no files.
  Command arguments: 'c:usersflaboyappdatalocalprogramspythonpython38python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-enu1m14b\pysqlcipher3\setup.py'"'"'; __file__='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-enu1m14b\pysqlcipher3\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersPublicDocumentsWondershareCreatorTemppip-wheel-3r_61g6i'
  Command output:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.8
  creating buildlib.win-amd64-3.8pysqlcipher3
  copying libdbapi2.py -> buildlib.win-amd64-3.8pysqlcipher3
  copying libdump.py -> buildlib.win-amd64-3.8pysqlcipher3
  copying lib__init__.py -> buildlib.win-amd64-3.8pysqlcipher3
  creating buildlib.win-amd64-3.8pysqlcipher3test
  copying libtest__init__.py -> buildlib.win-amd64-3.8pysqlcipher3test
  creating buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3dbapi.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3dump.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3factory.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3hooks.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3regression.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3sqlcipher.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3transactions.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3types.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3userfunctions.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  copying libtestpython3__init__.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
  running build_ext
  Builds a C extension linking against libsqlcipher library
  building 'pysqlcipher3._sqlite3' extension
  creating buildtemp.win-amd64-3.8
  creating buildtemp.win-amd64-3.8Release
  creating buildtemp.win-amd64-3.8Releasesrc
  creating buildtemp.win-amd64-3.8Releasesrcpython3
  C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMODULE_NAME="pysqlcipher3.dbapi2" -Ic:usersflaboyappdatalocalprogramspythonpython38include -Ic:usersflaboyappdatalocalprogramspythonpython38include "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110include" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0um" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt" /Tcsrcpython3module.c /Fobuildtemp.win-amd64-3.8Releasesrcpython3module.obj
  module.c
  C:UsersPublicDocumentsWondershareCreatorTemppip-install-enu1m14bpysqlcipher3srcpython3connection.h(33): fatal error C1083: Cannot open include file: 'sqlcipher/sqlite3.h': No such file or directory
  error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe' failed with exit status 2
  ----------------------------------------
  Building wheel for pysqlcipher3 (setup.py): finished with status 'done'
  Running setup.py clean for pysqlcipher3
  Running command 'c:usersflaboyappdatalocalprogramspythonpython38python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-enu1m14b\pysqlcipher3\setup.py'"'"'; __file__='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-enu1m14b\pysqlcipher3\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
  running clean
  removing 'buildtemp.win-amd64-3.8' (and everything under it)
  removing 'buildlib.win-amd64-3.8' (and everything under it)
  'buildbdist.win-amd64' does not exist -- can't clean it
  'buildscripts-3.8' does not exist -- can't clean it
  removing 'build'
Failed to build pysqlcipher3
DEPRECATION: Could not build wheels for pysqlcipher3 which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: pysqlcipher3
  Created temporary directory: C:UsersPublicDocumentsWondershareCreatorTemppip-record-8pg_shup
    Running setup.py install for pysqlcipher3: started
    Running command 'c:usersflaboyappdatalocalprogramspythonpython38python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-enu1m14b\pysqlcipher3\setup.py'"'"'; __file__='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-enu1m14b\pysqlcipher3\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersPublicDocumentsWondershareCreatorTemppip-record-8pg_shupinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersflaboyappdatalocalprogramspythonpython38Includepysqlcipher3'
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.8
    creating buildlib.win-amd64-3.8pysqlcipher3
    copying libdbapi2.py -> buildlib.win-amd64-3.8pysqlcipher3
    copying libdump.py -> buildlib.win-amd64-3.8pysqlcipher3
    copying lib__init__.py -> buildlib.win-amd64-3.8pysqlcipher3
    creating buildlib.win-amd64-3.8pysqlcipher3test
    copying libtest__init__.py -> buildlib.win-amd64-3.8pysqlcipher3test
    creating buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3dbapi.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3dump.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3factory.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3hooks.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3regression.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3sqlcipher.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3transactions.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3types.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3userfunctions.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    copying libtestpython3__init__.py -> buildlib.win-amd64-3.8pysqlcipher3testpython3
    running build_ext
    Builds a C extension linking against libsqlcipher library
    building 'pysqlcipher3._sqlite3' extension
    creating buildtemp.win-amd64-3.8
    creating buildtemp.win-amd64-3.8Release
    creating buildtemp.win-amd64-3.8Releasesrc
    creating buildtemp.win-amd64-3.8Releasesrcpython3
    C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMODULE_NAME="pysqlcipher3.dbapi2" -Ic:usersflaboyappdatalocalprogramspythonpython38include -Ic:usersflaboyappdatalocalprogramspythonpython38include "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.27.29110include" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0um" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt" /Tcsrcpython3module.c /Fobuildtemp.win-amd64-3.8Releasesrcpython3module.obj
    module.c
    C:UsersPublicDocumentsWondershareCreatorTemppip-install-enu1m14bpysqlcipher3srcpython3connection.h(33): fatal error C1083: Cannot open include file: 'sqlcipher/sqlite3.h': No such file or directory
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe' failed with exit status 2
    Running setup.py install for pysqlcipher3: finished with status 'done'
  Record file C:UsersPublicDocumentsWondershareCreatorTemppip-record-8pg_shupinstall-record.txt not found
Successfully installed pysqlcipher3
Removed build tracker: 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-req-tracker-21e96s63'
(flask)

$ список пунктов

Package        Version
-------------- ---------
atomicwrites   1.4.0
attrs          19.3.0
colorama       0.4.3
iniconfig      1.0.1
more-itertools 8.4.0
packaging      20.4
pip            20.2.2
pluggy         0.13.1
py             1.9.0
pyparsing      2.4.7
pytest         6.0.1
setuptools     41.2.0
six            1.15.0
toml           0.10.1
wheel          0.35.0
youtube-dl     2020.3.24
(flask)

@sylwesterdigital спасибо. Соответствующая ошибка

    C:UsersPublicDocumentsWondershareCreatorTemppip-install-enu1m14bpysqlcipher3srcpython3connection.h(33): fatal error C1083: Cannot open include file: 'sqlcipher/sqlite3.h': No such file or directory
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe' failed with exit status 2

Таким образом, зависимость sqlcipher отсутствует.

Мы также видим, что pysqlcipher3 не установлен, несмотря на то, что setup.py install сообщает об успешном выполнении.

Поэтому я подозреваю, что в setup.py pysqlcipher3 есть ошибка, из-за которой он сообщает об успехе, хотя на самом деле он терпит неудачу.
Я бы предложил сообщить о проблеме с этим проектом, так как мы ничего не можем сделать на стороне пипса.

Пожалуйста, помогите мне.

Я скачал Build Tools 2015.
Я скачал setuptools.
Я скачал колеса.
Я обновляю пип.

Пип версии 20.2.2 Python версии 3.8.3

Пытаюсь установить библиотеку vkbottle.

Пастебин —> https://pastebin.com/bRDfpudV

# pip3 install vkbottle
Requirement already satisfied: vkbottle in c:usersadminappdatalocalprogramspythonpython38-32
libsite-packagesvkbottle-2.7.8-py3.8.egg (2.7.8)
Requirement already satisfied: aiohttp in c:usersadminappdatalocalprogramspythonpython38-32
libsite-packages (from vkbottle) (3.6.2)
Requirement already satisfied: contextvars in c:usersadminappdatalocalprogramspythonpython38
-32libsite-packagescontextvars-2.4-py3.8.egg (from vkbottle) (2.4)
Requirement already satisfied: pydantic in c:usersadminappdatalocalprogramspythonpython38-32
libsite-packages (from vkbottle) (1.6.1)
Requirement already satisfied: vbml in c:usersadminappdatalocalprogramspythonpython38-32lib
site-packages (from vkbottle) (0.3)
Requirement already satisfied: watchgod in c:usersadminappdatalocalprogramspythonpython38-32
libsite-packages (from vkbottle) (0.6)
Requirement already satisfied: async-timeout<4.0,>=3.0 in c:usersadminappdatalocalprogramspyt
honpython38-32libsite-packages (from aiohttp->vkbottle) (3.0.1)
Requirement already satisfied: yarl<2.0,>=1.0 in c:usersadminappdatalocalprogramspythonpytho
n38-32libsite-packages (from aiohttp->vkbottle) (1.5.1)
Requirement already satisfied: attrs>=17.3.0 in c:usersadminappdatalocalprogramspythonpython
38-32libsite-packages (from aiohttp->vkbottle) (19.3.0)
Requirement already satisfied: chardet<4.0,>=2.0 in c:usersadminappdatalocalprogramspythonpy
thon38-32libsite-packages (from aiohttp->vkbottle) (3.0.4)
Requirement already satisfied: multidict<5.0,>=4.5 in c:usersadminappdatalocalprogramspython
python38-32libsite-packages (from aiohttp->vkbottle) (4.7.6)
Collecting immutables>=0.9
  Using cached immutables-0.14.tar.gz (42 kB)
Requirement already satisfied: poetry in c:usersadminappdatalocalprogramspythonpython38-32l
ibsite-packages (from vbml->vkbottle) (1.0.10)
Requirement already satisfied: idna>=2.0 in c:usersadminappdatalocalprogramspythonpython38-3
2libsite-packages (from yarl<2.0,>=1.0->aiohttp->vkbottle) (2.10)
Requirement already satisfied: keyring<21.0.0,>=20.0.1; python_version >= "3.5" and python_version
< "4.0" in c:usersadminappdatalocalprogramspythonpython38-32libsite-packages (from poetry-
>vbml->vkbottle) (20.0.1)
Requirement already satisfied: pexpect<5.0.0,>=4.7.0 in c:usersadminappdatalocalprogramspytho
npython38-32libsite-packages (from poetry->vbml->vkbottle) (4.8.0)
Requirement already satisfied: pyparsing<3.0,>=2.2 in c:usersadminappdatalocalprogramspython
python38-32libsite-packages (from poetry->vbml->vkbottle) (2.4.7)
Requirement already satisfied: pkginfo<2.0,>=1.4 in c:usersadminappdatalocalprogramspythonpy
thon38-32libsite-packages (from poetry->vbml->vkbottle) (1.5.0.1)
Requirement already satisfied: pyrsistent<0.15.0,>=0.14.2 in c:usersadminappdatalocalprograms
pythonpython38-32libsite-packages (from poetry->vbml->vkbottle) (0.14.11)
Requirement already satisfied: html5lib<2.0,>=1.0 in c:usersadminappdatalocalprogramspythonp
ython38-32libsite-packages (from poetry->vbml->vkbottle) (1.1)
Requirement already satisfied: tomlkit<0.6.0,>=0.5.11 in c:usersadminappdatalocalprogramspyth
onpython38-32libsite-packages (from poetry->vbml->vkbottle) (0.5.11)
Requirement already satisfied: shellingham<2.0,>=1.1 in c:usersadminappdatalocalprogramspytho
npython38-32libsite-packages (from poetry->vbml->vkbottle) (1.3.2)
Requirement already satisfied: cleo<0.8.0,>=0.7.6 in c:usersadminappdatalocalprogramspythonp
ython38-32libsite-packages (from poetry->vbml->vkbottle) (0.7.6)
Requirement already satisfied: clikit<0.5.0,>=0.4.2 in c:usersadminappdatalocalprogramspython
python38-32libsite-packages (from poetry->vbml->vkbottle) (0.4.3)
Requirement already satisfied: jsonschema<4.0,>=3.1 in c:usersadminappdatalocalprogramspython
python38-32libsite-packages (from poetry->vbml->vkbottle) (3.2.0)
Requirement already satisfied: requests<3.0,>=2.18 in c:usersadminappdatalocalprogramspython
python38-32libsite-packages (from poetry->vbml->vkbottle) (2.24.0)
Requirement already satisfied: requests-toolbelt<0.9.0,>=0.8.0 in c:usersadminappdatalocalprog
ramspythonpython38-32libsite-packages (from poetry->vbml->vkbottle) (0.8.0)
Requirement already satisfied: cachecontrol[filecache]<0.13.0,>=0.12.4 in c:usersadminappdatalo
calprogramspythonpython38-32libsite-packages (from poetry->vbml->vkbottle) (0.12.6)
Requirement already satisfied: cachy<0.4.0,>=0.3.0 in c:usersadminappdatalocalprogramspython
python38-32libsite-packages (from poetry->vbml->vkbottle) (0.3.0)
Requirement already satisfied: pywin32-ctypes!=0.1.0,!=0.1.1; sys_platform == "win32" in c:usersa
dminappdatalocalprogramspythonpython38-32libsite-packages (from keyring<21.0.0,>=20.0.1; pyt
hon_version >= "3.5" and python_version < "4.0"->poetry->vbml->vkbottle) (0.2.0)
Requirement already satisfied: ptyprocess>=0.5 in c:usersadminappdatalocalprogramspythonpyth
on38-32libsite-packages (from pexpect<5.0.0,>=4.7.0->poetry->vbml->vkbottle) (0.6.0)
Requirement already satisfied: six in c:usersadminappdatalocalprogramspythonpython38-32lib
site-packages (from pyrsistent<0.15.0,>=0.14.2->poetry->vbml->vkbottle) (1.15.0)
Requirement already satisfied: webencodings in c:usersadminappdatalocalprogramspythonpython3
8-32libsite-packages (from html5lib<2.0,>=1.0->poetry->vbml->vkbottle) (0.5.1)
Requirement already satisfied: pastel<0.3.0,>=0.2.0 in c:usersadminappdatalocalprogramspython
python38-32libsite-packages (from clikit<0.5.0,>=0.4.2->poetry->vbml->vkbottle) (0.2.0)
Requirement already satisfied: pylev<2.0,>=1.3 in c:usersadminappdatalocalprogramspythonpyth
on38-32libsite-packages (from clikit<0.5.0,>=0.4.2->poetry->vbml->vkbottle) (1.3.0)
Requirement already satisfied: setuptools in c:usersadminappdatalocalprogramspythonpython38-
32libsite-packages (from jsonschema<4.0,>=3.1->poetry->vbml->vkbottle) (49.6.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:usersadminappdatalo
calprogramspythonpython38-32libsite-packages (from requests<3.0,>=2.18->poetry->vbml->vkbottle
) (1.25.9)
Requirement already satisfied: certifi>=2017.4.17 in c:usersadminappdatalocalprogramspythonp
ython38-32libsite-packages (from requests<3.0,>=2.18->poetry->vbml->vkbottle) (2020.6.20)
Requirement already satisfied: msgpack>=0.5.2 in c:usersadminappdatalocalprogramspythonpytho
n38-32libsite-packages (from cachecontrol[filecache]<0.13.0,>=0.12.4->poetry->vbml->vkbottle) (1.
0.0)
Requirement already satisfied: lockfile>=0.9; extra == "filecache" in c:usersadminappdatalocal
programspythonpython38-32libsite-packages (from cachecontrol[filecache]<0.13.0,>=0.12.4->poetry
->vbml->vkbottle) (0.12.2)
Building wheels for collected packages: immutables
  Building wheel for immutables (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:usersadminappdatalocalprogramspythonpython38-32python.exe' -u -c 'import sys
, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\admin\AppData\Local\Temp\pip-install-069v
r9ot\immutables\setup.py'"'"'; __file__='"'"'C:\Users\admin\AppData\Local\Temp\pip-install-
069vr9ot\immutables\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read
().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' b
dist_wheel -d 'C:UsersadminAppDataLocalTemppip-wheel-bk5jpx95'
       cwd: C:UsersadminAppDataLocalTemppip-install-069vr9otimmutables
  Complete output (30 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win32-3.8
  creating buildlib.win32-3.8immutables
  copying immutablesmap.py -> buildlib.win32-3.8immutables
  copying immutables_testutils.py -> buildlib.win32-3.8immutables
  copying immutables_version.py -> buildlib.win32-3.8immutables
  copying immutables__init__.py -> buildlib.win32-3.8immutables
  running egg_info
  writing immutables.egg-infoPKG-INFO
  writing dependency_links to immutables.egg-infodependency_links.txt
  writing top-level names to immutables.egg-infotop_level.txt
  reading manifest file 'immutables.egg-infoSOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'immutables.egg-infoSOURCES.txt'
  copying immutables_map.c -> buildlib.win32-3.8immutables
  copying immutables_map.h -> buildlib.win32-3.8immutables
  copying immutables_map.pyi -> buildlib.win32-3.8immutables
  copying immutablespy.typed -> buildlib.win32-3.8immutables
  running build_ext
  building 'immutables._map' extension
  creating buildtemp.win32-3.8
  creating buildtemp.win32-3.8Release
  creating buildtemp.win32-3.8Releaseimmutables
  C:Program Files (x86)Microsoft Visual Studio 14.0VCBINcl.exe /c /nologo /Ox /W3 /GL /DNDEBUG
 /MD -DNDEBUG=1 -Ic:usersadminappdatalocalprogramspythonpython38-32include -Ic:usersadmin
appdatalocalprogramspythonpython38-32include "-IC:Program Files (x86)Microsoft Visual Studi
o 14.0VCINCLUDE" "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE" "-IC:
Program Files (x86)Windows Kits10include10.0.10240.0ucrt" /Tcimmutables/_map.c /Fobuildtemp.w
in32-3.8Releaseimmutables/_map.obj -O2
  _map.c
  c:usersadminappdatalocalprogramspythonpython38-32includepyconfig.h(206): fatal error C10
83: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о祭ЁҐ: basetsd.h: No such file or directory,
  error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed wi
th exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for immutables
  Running setup.py clean for immutables
Failed to build immutables
DEPRECATION: Could not build wheels for immutables which do not use PEP 517. pip will fall back to
legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possibl
e replacement is to fix the wheel build issue reported above. You can find discussion regarding thi
s at https://github.com/pypa/pip/issues/8368.
Installing collected packages: immutables
    Running setup.py install for immutables ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:usersadminappdatalocalprogramspythonpython38-32python.exe' -u -c 'import s
ys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\admin\AppData\Local\Temp\pip-install-06
9vr9ot\immutables\setup.py'"'"'; __file__='"'"'C:\Users\admin\AppData\Local\Temp\pip-instal
l-069vr9ot\immutables\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.re
ad().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
 install --record 'C:UsersadminAppDataLocalTemppip-record-_f7_duclinstall-record.txt' --sing
le-version-externally-managed --compile --install-headers 'c:usersadminappdatalocalprogramspy
thonpython38-32Includeimmutables'
         cwd: C:UsersadminAppDataLocalTemppip-install-069vr9otimmutables
    Complete output (30 lines):
    running install
    running build
    running build_py
    creating build
    creating buildlib.win32-3.8
    creating buildlib.win32-3.8immutables
    copying immutablesmap.py -> buildlib.win32-3.8immutables
    copying immutables_testutils.py -> buildlib.win32-3.8immutables
    copying immutables_version.py -> buildlib.win32-3.8immutables
    copying immutables__init__.py -> buildlib.win32-3.8immutables
    running egg_info
    writing immutables.egg-infoPKG-INFO
    writing dependency_links to immutables.egg-infodependency_links.txt
    writing top-level names to immutables.egg-infotop_level.txt
    reading manifest file 'immutables.egg-infoSOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'immutables.egg-infoSOURCES.txt'
    copying immutables_map.c -> buildlib.win32-3.8immutables
    copying immutables_map.h -> buildlib.win32-3.8immutables
    copying immutables_map.pyi -> buildlib.win32-3.8immutables
    copying immutablespy.typed -> buildlib.win32-3.8immutables
    running build_ext
    building 'immutables._map' extension
    creating buildtemp.win32-3.8
    creating buildtemp.win32-3.8Release
    creating buildtemp.win32-3.8Releaseimmutables
    C:Program Files (x86)Microsoft Visual Studio 14.0VCBINcl.exe /c /nologo /Ox /W3 /GL /DNDEB
UG /MD -DNDEBUG=1 -Ic:usersadminappdatalocalprogramspythonpython38-32include -Ic:usersadm
inappdatalocalprogramspythonpython38-32include "-IC:Program Files (x86)Microsoft Visual Stu
dio 14.0VCINCLUDE" "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE" "-IC
:Program Files (x86)Windows Kits10include10.0.10240.0ucrt" /Tcimmutables/_map.c /Fobuildtemp
.win32-3.8Releaseimmutables/_map.obj -O2
    _map.c
    c:usersadminappdatalocalprogramspythonpython38-32includepyconfig.h(206): fatal error C
1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о祭ЁҐ: basetsd.h: No such file or directory,
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed
with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:usersadminappdatalocalprogramspythonpython
38-32python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\admin\App
Data\Local\Temp\pip-install-069vr9ot\immutables\setup.py'"'"'; __file__='"'"'C:\Users\admin
AppData\Local\Temp\pip-install-069vr9ot\immutables\setup.py'"'"';f=getattr(tokenize, '"'"'ope
n'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(
code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersadminAppDataLocalTemppip-record-_f
7_duclinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:user
sadminappdatalocalprogramspythonpython38-32Includeimmutables' Check the logs for full comma
nd output.

@Andrexxelles ошибка, с которой вы столкнулись, не связана ни с этой проблемой, ни с пунктом. Соответствующая часть basetsd.h: No such file or directory . Так что я не возражаю, я отмечу эти два комментария как не относящиеся к теме, чтобы дискуссию по этому вопросу было легче читать.

я получаю ту же ошибку при установке mysqlclient

УСТАРЕВАНИЕ: Не удалось создать колеса для mysqlclient, которые не используют PEP 517. Для них pip вернется к устаревшей установке «setup.py install». pip 21.0 удалит поддержку этой функции. Возможная замена заключается в устранении проблемы со сборкой колес, о которой говорилось выше.

проблема с колесом-
Сборка колеса для mysql (setup.py)… сделано
Создал колесо для mysql: имя файла=mysql-0.0.2-py3-none-any.whl size=1252 sha256=ca801d4e9888754369abcdfb5791654e3a43361475a58726257b7954c7c4d735
Хранится в каталоге: c:usersadminappdatalocalpipcachewheels3e4ad0506edab38d1bdf574b02c24805fcf7348a327297fcc285431d
Сборка колеса для клиента (setup.py)… сделано
Создано колесо для клиента: filename=client-0.0.1-py3-none-any.whl size=1441 sha256=cf97824f8b63db528014243e69082705c78c4397ca5891bfb2b7217a107e943c
Хранится в каталоге: c:usersadminappdatalocalpipcachewheels1ed6d32084ee3b4ac9adaab2bf853307b140575c5fe9160821ab8e07
Построение колеса для mysqlclient (setup.py)… ошибка
ОШИБКА: Команда завершилась ошибкой со статусом выхода 1:

Блокировка темы, чтобы больше людей не задавали здесь вопросы, не относящиеся к теме.

В версии 21.0 pip не будет пытаться установить setup.py в этом случае и сразу же завершит установку.

Меня немного смущает эта часть плана, и я не могу найти, где это обсуждалось.

Прямо сейчас целый класс пакетов использует setup.py install для решения проблем синхронизации установки и сборки, которые у нас есть. Я думаю, что пока мы не решим проблемы качества реализации PEP 517 в pip ( config_settings , синхронизированная сборка + установка зависимостей в изолированных средах, шаги после установки для колес и т. д.), мы не должны удалять setup.py install Ветвь очень значительным регрессом для этих пакетов, так как они были бы недоступны для установки.

Это похоже на удаление функции без четкой альтернативы, что не может закончиться хорошо. :)

  1. Крайний срок 21.0 обсуждался в #8102. Мы не пришли к консенсусу по нему, но мы также не договорились об альтернативе. Это соответствует нашей обычной политике устаревания.
  2. Есть ли у нас фактические отчеты об ошибках (желательно связанные с этой проблемой), которые отмечают проблемы, мешающие людям решить проблему устаревания? Это риторический ответ: «Нет, не делаем». Итак, как мы узнаем, сделали ли мы все, что необходимо для прекращения поддержки?
  3. Проблемы с изолированными средами не должны быть связаны с этой проблемой. У нас есть --no-build-isolation для обработки случаев, когда изоляция сборки не работает для проекта. Прежде чем принять отчет об ошибке как блокирующий для этого устаревания, я хотел бы знать, почему --no-build-isolation не является обходным путем («это неудобно» недостаточно, IMO — устаревание всегда неудобно для кого-то).

Я полностью согласен с исправлением различных проблем с качеством реализации PEP 517 и изоляции сборки. Но проблемы с качеством реализации — это не то же самое, что «непригодный для использования», и нам нужно подтолкнуть людей к ясности, когда они имеют в виду «я вообще не умею делать колеса» и когда они имеют в виду «мне неуклюже или неудобно делать это». сделай так, чтобы я мог строить колеса».

Сказав все вышесказанное, я лично не собираюсь настаивать на удалении маршрута setup.py install . Так что если это останется мне, мы все равно не будем удалять в 21.0. Это @sbidoul руководил этим, так что, вероятно, он тот человек, которому действительно нужно прокомментировать. (Однако я поддержал бы его, если бы он стремился к агрессивным временным рамкам).

Кстати, один неприятный результат включения ссылки на проблему в сообщение заключается в том, что огромное количество пингбэков здесь включает случаи, когда люди просто вставляют вывод pip, а github превращает его в ссылку, когда на самом деле это не связанная проблема или что-то, что проект обрабатывает сам . Давайте не делать этого в будущем 🙂

План действительно был изложен в # 8102 и, в частности, https://github.com/pypa/pip/issues/8102#issuecomment -632718595. Тогда отзывы о нем казались положительными.

Я не особенно настаиваю на этом, хотя я убежден, что установка setup.py должна уйти рано или поздно. Черт возьми, даже сопровождающие setuptools говорят, что люди должны использовать pip вместо setup.py install , но если pip выполняет установку setup.py, какой в ​​этом смысл? И нам нужны данные, чтобы пролить свет на этот вопрос, иначе мы можем только догадываться. Механизм устаревания считался достойным способом получения таких данных.

Эта конкретная проблема предназначена для очень конкретного случая: откат к установке setup.py при сбое bdist_wheel. Даже если мы отключим это поведение, установка setup.py останется и может быть активирована путем передачи —install-options или —global-options.

К сожалению, у нас было так много обратных ссылок из сообщения об ошибке, что было непреднамеренно, и теперь это исправлено в 20.2.3, где устаревание происходит гораздо более целенаправленно.

Итак, как мы можем получить отзывы об этом конкретном устаревании (кроме чтения всех обратных ссылок, большинство из которых не имеют отношения к делу). Не следует ли разблокировать проблему, чтобы люди могли сообщать о случаях, когда откат считается полезным?

У меня есть случай, когда запасной вариант все еще необходим, но главным образом потому, что это обходной путь, когда pyproject.toml недостаточно: я не могу иметь маркер среды, который подбирает версию PyPy (то есть не версию Python, которую он реализует, например, 3.6, но версию PyPy, например, 7.3.0). Вероятно, это также проблема для Jython.

Не имея возможности выбирать версии пакетов для конкретного выпуска PyPy в файле pyproject.toml для использования в среде сборки, я возвращаюсь к этому выбору в файле setup.py, где я не могу контролировать порядок сборки/установки колес. и, таким образом, полагаться на запасной вариант. (После чего пока все хорошо.)

Есть ли известное решение для этого, или если должен быть другой маркер, есть ли процесс/место для добавления или запроса?

Вы по-прежнему можете использовать setup.py с pyproject.toml, эти два файла полностью ортогональны. Условные требования времени сборки можно рассчитать и указать с помощью аргумента setup_requires .

Извините, не следил. Причина, по которой я здесь, заключается в том, что поведение setup_requires сломается в будущем, как и заданные вопросы и обсуждения в других темах. У меня сложилось впечатление, что поведение сборки _и_ немедленной установки для использования следующим пакетом в порядке зависимости можно восстановить с помощью pyproject.toml. Дело в том, что среда сборки вращается, строится и устанавливается в правильном порядке. Затем они повторно используются из кеша в setup.py, поэтому не имеет значения, что порядок зависимостей setup_requires больше не соблюдается, поскольку повторно используемые колеса были правильно построены. Это немного хак, но да, его действительно можно заставить работать на CPython.

Но это не может для PyPy. Разница в том, что для CPython версия python и версия интерпретатора совпадают, поэтому можно правильно выбрать версии зависимостей. Ничего подобного для PyPy, где версия Python и версия интерпретатора различаются, и только первая может быть указана с помощью маркера.

Я только что попробовал, и если я рассматриваю pyproject.toml ортогонально (я думаю) из setup.py, не указывая точные версии в файле pyproject.toml и оставляя его в setup_requires , я просто получаю последние версии в среды сборки, за которой следует еще одна сборка версий setup_requires с помощью setup.py в неправильном порядке и в неправильной среде сборки. Итак, что мне не хватает? Спасибо!

(Оставляет отдельную проблему, заключающуюся в том, что pyproject.toml менее функционален для интерпретаторов, отличных от CPython.)

Честно говоря, я тоже не слежу за вашим недоумением, так как ваше описание настолько отклонилось от моего понимания ситуации. Что заставляет вас думать, что setup_requires сломается в будущем? Насколько я знаю, он не исчезнет; PEP 517 (альтернатива setup.py install ) предоставляет серверной части сборки (в данном случае setuptools) хук для указания динамических зависимостей времени сборки ( get_requires_for_build_wheel ), а setuptools использует setup(setup_requires=...) чтобы показать это пользователю. Система сборки PEP 517 будет:

  1. Заполните среду спецификациями от pyproject.toml
  2. Запустите setup.py в этой среде, чтобы установить динамические требования (например, setup_requires )
  3. Построить колесо

Таким образом, вам не нужно указывать зависимость сборки в pyproject.toml , если вы указали ее в setup_requires . И не должно быть «другой сборки», а должна быть только одна сборка, выполняющая два шага настройки. Головоломки совершенно не стыкуются между вашим пониманием и моим.

Я, наверное, должен был спросить об этом в самом начале: что именно вы пытаетесь сделать? Я представляю что-то вроде:

import setuptools

if on_pypy_version_x():
    build_deps = ["build-dep<5"]
else:
    build_deps = ["build-dep>=5"]

setuptools.setup(
    ...,
    setup_requires=build_deps,
)

И это определенно должно работать, как прямо сейчас, так и после удаления setup.py install (если это не так, это ошибка в setuptools). И если это не то, что вы имеете в виду, дайте более конкретное описание.

Стоит отметить, что setup_requires является устаревшей опцией в setuptools. Документация setuptools включает оператор

Примечание. Раньше это выполнялось с помощью ключевого слова setup_requires, но теперь считается устаревшим в пользу стиля PEP 517, описанного выше. Чтобы узнать, как используется это устаревшее ключевое слово, обратитесь к нашему руководству по устаревшей практике (WIP).

Если описанного выше подхода @uranusjr недостаточно, то я надеюсь, что документация setuptools предоставит @wlav достаточно информации, чтобы позволить им изменить процесс сборки, чтобы он работал по мере необходимости. Если это не так, то, вероятно, это то, что они должны поднять в системе отслеживания проблем setuptools.

Кроме того, я не знаю, предупреждает ли setuptools, когда используется setup_requires . Если нет, то, возможно, это было бы целесообразно, но это действительно зависит от того, считают ли пользователи setuptools, такие как @wlav , что устаревание уже недостаточно хорошо рекламируется — и если это так, то снова я предлагаю отметить это в setuptools трекер.

О, я не знал, что setuptools активно осуждает setup_requires ; Я думал, что они используют его только для PEP 517. Спасибо.

Если нужно полностью избежать setup_requires , вероятно, лучше всего будет использовать встроенный в дерево бэкэнд PEP 517 . Проект может определить свои собственные get_requires_for_build_wheel для динамического указания требований времени сборки (и передать все остальное в setuptools).

Было бы полезно, если бы кто-то собрал примеры «современных» замен старых подходов, которые в настоящее время устарели или «вышли из моды» и потенциально могут устареть в какой-то момент.

Однако я не знаю, где будет размещен такой документ, и он будет очень зависеть от людей, использующих такие старые методы, которые изучают, как их обновлять, а затем делятся этими знаниями с сообществом. На практике, однако, я не знаю, насколько вероятно, что это произойдет. Переполнение стека — очевидная возможность, но курирование этого, чтобы гарантировать, что устаревшие советы будут лишены приоритета в пользу актуальных ответов, вероятно, потребует больше времени, чем многие из тех, кто занимается поддержкой пакетов Python, поэтому снова необходимо участие сообщества.

@wlav — что вам понадобилось, чтобы узнать, что setup_requires устарело, и что внутренние бэкэнды PEP 517 были тем, что вы могли бы рассмотреть для обновления процесса сборки? Я уверен, что мы недостаточно широко освещали бэкенды внутри дерева, но я не знаю, что мы могли бы сделать, чтобы улучшить ситуацию.

[Лично я знал, что setup_requires устарел, но я не знал, что setuptools раскрывает эти данные через хук PEP 517, и я не сделал ссылку на внутренние бэкенды в качестве подхода к замене функциональность. Так что этот материал не так легко доступен даже таким так называемым экспертам по упаковке, как я 🙂]

Немного запоздал с ответом, но это была насыщенная и беспокойная неделя… Да, примеры были бы действительно хороши! Но как есть, предоставление собственного построителя в дереве, который просто импортирует все из setuptools.build_meta , а затем добавляет конкретные требования для PyPy путем замены get_requires_for_build_wheel , работает достаточно хорошо.

@pfmoore — забыл ответить на ваш вопрос, но в основном: я получаю отчеты об ошибках. Я думаю, что не так просто следить за изменениями в системах сборки, но достаточно людей не отстают и сообщают мне о важных изменениях через мой трекер проблем. Точно так же многие системы сборки в некоторой степени совместимы с setuptools , но только при соблюдении задокументированных правил. Так что, если мое использование не будет следовать этим буквальным указаниям, это сломает одну из множества других систем сборки, и кто-нибудь меня достанет.

Что касается изучения внутренних бэкендов, я получил эту информацию прямо здесь. :)

В настоящее время Wheels не поддерживает символические ссылки, потому что не все платформы поддерживают символические ссылки. В рамках процесса установки мы добавляем в setup.py логику для создания символических ссылок и не хотим дублировать объекты, потому что они большие. Принудительное создание колеса потребует еще одного набора хаков для решения проблемы.

См. (другое) обсуждение символических ссылок + колеса на https://github.com/pypa/pip/issues/5919 .

Была ли эта страница полезной?

0 / 5 — 0 рейтинги

Понравилась статья? Поделить с друзьями:
  • Building wheel for cryptography pep 517 error
  • Building wheel for cffi setup py finished with status error
  • Build info client auth error
  • Build failed with error failed to solve failed to read dockerfile
  • Build error multiple tools write to the same file