Автор Тема: Обновить libssl. Python-3.7.1 и Python-3.6.7 не собираются из-за старого libssl  (Прочитано 10408 раз)

Оффлайн comoestasyan

  • Начинающий
  • *
  • Сообщений: 6
Доброго времени! Подскажите подробно, что делать на ALtLinux 7.0.5-SPT? Нужно написать python3-скрипт авторизации с  cookies, но в родном python3.3 нет модулей cookies, http, pickle.

Поставили Python3.7, но без поддержки ssl pip3.7 не скачивает модули.

При сборке python3.7.1 с pip3.7 и поддержкой ssl жалуется на версию libssl

Python3.7.1/Modules/Setup:

Цитировать
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
SSL=/usr/include/openssl
_ssl _ssl.c \
   -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
   -L$(SSL)/lib -lssl -lcrypto

# .configure
# make
...
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration   -I. -I./Include     -DUSE_SSL -I/usr/include/openssl/include -I/usr/include/openssl/include/openssl -c ./Modules/_ssl.c -o Modules/_ssl.o
./Modules/_ssl.c:74:6: error: #error "libssl is too old and does not support X509_VERIFY_PARAM_set1_host()"
./Modules/_ssl.c: In function ‘_ssl_configure_hostname’:
./Modules/_ssl.c:861:9: error: implicit declaration of function ‘SSL_get0_param’ [-Werror=implicit-function-declaration]
./Modules/_ssl.c:861:36: warning: initialization makes pointer from integer without a cast [enabled by default]
./Modules/_ssl.c:863:13: error: implicit declaration of function ‘X509_VERIFY_PARAM_set1_host’ [-Werror=implicit-function-declaration]
./Modules/_ssl.c:869:13: error: implicit declaration of function ‘X509_VERIFY_PARAM_set1_ip’ [-Werror=implicit-function-declaration]
./Modules/_ssl.c: In function ‘_ssl__SSLContext_impl’:
./Modules/_ssl.c:2988:23: error: ‘X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS’ undeclared (first use in this function)
./Modules/_ssl.c:2988:23: note: each undeclared identifier is reported only once for each function it appears in
./Modules/_ssl.c:3093:5: error: implicit declaration of function ‘SSL_CTX_get0_param’ [-Werror=implicit-function-declaration]
./Modules/_ssl.c:3093:12: warning: assignment makes pointer from integer without a cast [enabled by default]
./Modules/_ssl.c:3099:5: error: implicit declaration of function ‘X509_VERIFY_PARAM_set_hostflags’ [-Werror=implicit-function-declaration]
./Modules/_ssl.c: In function ‘get_verify_flags’:
./Modules/_ssl.c:3397:11: warning: assignment makes pointer from integer without a cast [enabled by default]
./Modules/_ssl.c: In function ‘set_verify_flags’:
./Modules/_ssl.c:3410:11: warning: assignment makes pointer from integer without a cast [enabled by default]
./Modules/_ssl.c: In function ‘set_host_flags’:
./Modules/_ssl.c:3573:11: warning: assignment makes pointer from integer without a cast [enabled by default]
cc1: some warnings being treated as errors
make: *** [Modules/_ssl.o] Ошибка 1



# apt-cache show libssl
Виртуальный пакет libssl предоставляется следующими пакетами:
  libssl10 1.0.1u-alt0.M70C.1
  libssl7 0.9.8zh-alt0.M70C.1
You should explicitly select one to show.
E: Package libssl is a virtual package with multiple providers.


В Python3.6 все нормально скачивается, но точно так же pip3.6 не находит pickle, cookielib, и не может собрать http


# pip3.6 install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 1.7MB/s
Installing collected packages: pip
  Found existing installation: pip 10.0.1
    Uninstalling pip-10.0.1:
      Successfully uninstalled pip-10.0.1
Successfully installed pip-18.1


# pip3.6 install request
Collecting request
  Using cached https://files.pythonhosted.org/packages/b8/13/b88a65f14470f3e17d72a1a930f173b36717c211685dbbadfc2e5ba21303/request-1.0.2.tar.gz
Collecting get (from request)
  Downloading https://files.pythonhosted.org/packages/dc/bd/264e65844b66e2b5fa829f3f6c526056ee14a0508fb6b454e0af4105a21c/get-1.0.3.tar.gz
Collecting post (from request)
  Downloading https://files.pythonhosted.org/packages/7f/ea/ddf22395dcee7a45b7ab7564a087725cafc778f421268814cd8a5ec9ffdf/post-1.0.2.tar.gz
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (from request) (39.0.1)
Collecting query_string (from get->request)
  Downloading https://files.pythonhosted.org/packages/be/2d/719132c49c715743afff3781e04489cd21189914a563b56837f891fd02ac/query_string-1.0.2.tar.gz
Collecting public (from query_string->get->request)
  Downloading https://files.pythonhosted.org/packages/0e/45/1a8ab7780a60b8dbfd030b3b8d8515f80f4ff5c6a1b39f4fcb956575f421/public-2.0.1-py2.py3-none-any.whl
Installing collected packages: public, query-string, get, post, request
  Running setup.py install for query-string ... done
  Running setup.py install for get ... done
  Running setup.py install for post ... done
  Running setup.py install for request ... done
Successfully installed get-1.0.3 post-1.0.2 public-2.0.1 query-string-1.0.2 request-1.0.2

# pip3.6 install requests
Collecting requests
  Downloading https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8/requests-2.20.0-py2.py3-none-any.whl (60kB)
    100% |████████████████████████████████| 61kB 361kB/s
Collecting idna<2.8,>=2.5 (from requests)
  Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 1.8MB/s
Collecting urllib3<1.25,>=1.21.1 (from requests)
  Downloading https://files.pythonhosted.org/packages/8c/4b/5cbc4cb46095f369117dcb751821e1bef9dd86a07c968d8757e9204c324c/urllib3-1.24-py2.py3-none-any.whl (117kB)
    100% |████████████████████████████████| 122kB 1.3MB/s
Collecting certifi>=2017.4.17 (from requests)
  Using cached https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Installing collected packages: idna, urllib3, certifi, chardet, requests
Successfully installed certifi-2018.10.15 chardet-3.0.4 idna-2.7 requests-2.20.0 urllib3-1.24

# pip3.6 install http
Collecting http
  Using cached https://files.pythonhosted.org/packages/e3/91/a9260805e532e33df273b8f7dffad5c51693f8f9ba5f86bedcf42a7f22eb/http-0.02.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/.private/root/pip-install-iuib9kvw/http/setup.py", line 3, in <module>
        import http
      File "/tmp/.private/root/pip-install-iuib9kvw/http/http/__init__.py", line 17, in <module>
        from request import Request
    ImportError: cannot import name 'Request'
   
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/.private/root/pip-install-iuib9kvw/http/

# pip3.6 install cookielib
Collecting cookielib
  Could not find a version that satisfies the requirement cookielib (from versions: )
No matching distribution found for cookielib

# pip3.6 install pickle
Collecting pickle
  Could not find a version that satisfies the requirement pickle (from versions: )
No matching distribution found for pickle

# pip3.6 install stdlib
Collecting stdlib
  Could not find a version that satisfies the requirement stdlib (from versions: )
No matching distribution found for stdlib

# pip3.6 install http
Collecting http
  Using cached https://files.pythonhosted.org/packages/e3/91/a9260805e532e33df273b8f7dffad5c51693f8f9ba5f86bedcf42a7f22eb/http-0.02.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/.private/root/pip-install-itm48umf/http/setup.py", line 3, in <module>
        import http
      File "/tmp/.private/root/pip-install-itm48umf/http/http/__init__.py", line 17, in <module>
        from request import Request
    ImportError: cannot import name 'Request'
   
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/.private/root/pip-install-itm48umf/http/


#
# pip3.6 install http
Collecting http
  Using cached https://files.pythonhosted.org/packages/e3/91/a9260805e532e33df273b8f7dffad5c51693f8f9ba5f86bedcf42a7f22eb/http-0.02.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/.private/root/pip-install-19e1t0f2/http/setup.py", line 3, in <module>
        import http
      File "/tmp/.private/root/pip-install-19e1t0f2/http/http/__init__.py", line 17, in <module>
        from request import Request
    ImportError: cannot import name 'Request'
   
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/.private/root/pip-install-19e1t0f2/http/
#

Точно так же pi3.6 не может установить другие модули для работы с сетью, хотя находит модули не для сети:

# pip3.6 install cgi
Collecting cgi
  Could not find a version that satisfies the requirement cgi (from versions: )
No matching distribution found for cgi
# pip3.6 install urllib
Collecting urllib
  Could not find a version that satisfies the requirement urllib (from versions: )
No matching distribution found for urllib
# pip3.6 install ftplib
Collecting ftplib
  Could not find a version that satisfies the requirement ftplib (from versions: )
No matching distribution found for ftplib
# pip3.6 install pathlib
Collecting pathlib
  Downloading https://files.pythonhosted.org/packages/ac/aa/9b065a76b9af472437a0059f77e8f962fe350438b927cb80184c32f075eb/pathlib-1.0.1.tar.gz (49kB)
    100% |████████████████████████████████| 51kB 311kB/s
Installing collected packages: pathlib
  Running setup.py install for pathlib ... done
Successfully installed pathlib-1.0.1

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 908
    • Домашняя страница
    • Email
Переходить на Альт 8 СП или переписать свой код (хоть на Python2). Обновление версий не для закрытия уязвимостей для Альт Линукс СПТ 7.0.5 не планируется.
Андрей Черепанов (cas@)

Оффлайн yaleks

  • Мастер
  • ***
  • Сообщений: 6 222
А почему бы эти модули не собрать под Python 3.3, зачем версию поднимать до последней?
Тогда и не надо будет и все остальные модули Python по зависимостям пересобирать.