Обнаружена ошибка при попытке установить пакет, pycrypto

Я пытаюсь установить библиотеки Python на основе репозитория GitHub, https://github.com/Dvorhack/MiBand3 например

  • синий
  • Пикрипто
  • меню проклятий
  • crc16

Я использую ОС Parrot, подключаюсь к своему ноутбуку с Windows через USB и устанавливаю библиотеки Python в эту ОС.

Я получил сообщение об ошибке, сообщающее, что невозможно установить пакет pycrypto. Я использую ОС Parrot и подключаюсь к ноутбуку через USB.

Подскажите, пожалуйста, как исправить ошибку Python. Мне действительно нужно установить pycrypto.

Я выполнил команды ниже.

  1. git clone https://github.com/Dvorhack/MiBand3
  2. компакт-диск MiBand3
  3. pip install -r требования.txt

Я получил сообщение об ошибке, сообщающее, что невозможно установить пакет pycrypto.

Я ожидаю, что проблемы будут решены без необходимости установки pycryptodome.

Ошибка показана ниже.

 └──╼ $.venv/project_name/bin/pip install -r requirements.txt Collecting bluepy Using cached bluepy-1.3.0.tar.gz (217 kB) Preparing metadata (setup.py) ... done Collecting pycrypto Using cached pycrypto-2.6.1.tar.gz (446 kB) Preparing metadata (setup.py) ... done Collecting curses-menu Using cached curses_menu-0.8.1-py3-none-any.whl (39 kB) Collecting crc16 Using cached crc16-0.1.1.zip (20 kB) Preparing metadata (setup.py) ... done Collecting Deprecated<2.0.0,>=1.2.13 Using cached Deprecated-1.2.14-py2.py3-none-any.whl (9.6 kB) Collecting wrapt<2,>=1.10 Using cached wrapt-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (80 kB) Installing collected packages: pycrypto, crc16, bluepy, wrapt, Deprecated, curses-menu DEPRECATION: pycrypto is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for pycrypto ... error error: subprocess-exited-with-error

× Running setup.py install for pycrypto did not run successfully. │ exit code: 1 ╰─> [73 lines of output] /home/user/MiBand3/.venv/project_name/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for __gmpz_init in -lgmp... yes checking for __gmpz_init in -lmpir... no checking whether mpz_powm is declared... yes checking whether mpz_powm_sec is declared... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for inttypes.h... (cached) yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for int8_t... yes checking for size_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memmove... yes checking for memset... yes configure: creating ./config.status config.status: creating src/config.h In file included from /usr/include/python3.11/Python.h:86, from src/_fastmath.c:31: /usr/include/python3.11/cpython/pytime.h:208:60: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 208 | PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts); | ^~~~~~~~ /usr/include/python3.11/cpython/pytime.h:213:56: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 213 | PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts); | ^~~~~~~~ /usr/include/python3.11/cpython/pytime.h:217:63: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration 217 | PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec ts); | ^~~~~~~~ src/_fastmath.c:33:10: fatal error: longintrepr.h: No such file or directory 33 | #include <longintrepr.h> / for conversions */ | ^~~~~~~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> pycrypto

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure. 

Вы видели предлагаемый обходной путь в сообщении об ошибке?

Tim Roberts 14.06.2024 23:08
Почему в Python есть оператор "pass"?
Почему в Python есть оператор "pass"?
Оператор pass в Python - это простая концепция, которую могут быстро освоить даже новички без опыта программирования.
Некоторые методы, о которых вы не знали, что они существуют в Python
Некоторые методы, о которых вы не знали, что они существуют в Python
Python - самый известный и самый простой в изучении язык в наши дни. Имея широкий спектр применения в области машинного обучения, Data Science,...
Основы Python Часть I
Основы Python Часть I
Вы когда-нибудь задумывались, почему в программах на Python вы видите приведенный ниже код?
LeetCode - 1579. Удаление максимального числа ребер для сохранения полной проходимости графа
LeetCode - 1579. Удаление максимального числа ребер для сохранения полной проходимости графа
Алиса и Боб имеют неориентированный граф из n узлов и трех типов ребер:
Оптимизация кода с помощью тернарного оператора Python
Оптимизация кода с помощью тернарного оператора Python
И последнее, что мы хотели бы показать вам, прежде чем двигаться дальше, это
Советы по эффективной веб-разработке с помощью Python
Советы по эффективной веб-разработке с помощью Python
Как веб-разработчик, Python может стать мощным инструментом для создания эффективных и масштабируемых веб-приложений.
0
1
68
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

PyCrypto 2.x не поддерживается, устарел и содержит уязвимости безопасности.

Проект pycripto устарел и больше не поддерживается, как и репозиторий GitHub. Я вижу, что у вас есть Python 3.11, что, как ожидается, произойдет, у меня был Python 3.8, и у меня была та же проблема. Установка Cryptography 3.0 решила для меня проблему.

Попробуйте PyCryptodome или Cryptography в качестве альтернативы, как предложено на официальном сайте Pycripto.

мне нужно перейти на Python до 3.8? Как установить криптографию 3.0?

abdul 14.06.2024 23:30

Просто установите альтернативные пакеты. Так что да, криптография или другая альтернатива, предложенная на их сайте. Попробуйте установить последнюю версию криптографии с помощью pip install cryptography 42.0.8. Обновить ваш pip также можно с помощью python3 -m pip install --upgrade pip.

tymerius 14.06.2024 23:56

Другие вопросы по теме