Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11.0 ModuleNotFoundError: No module named 'psycopg2._psycopg' 🐛 #1767

Closed
JV-conseil opened this issue Dec 22, 2022 · 18 comments
Closed
Assignees

Comments

@JV-conseil
Copy link

JV-conseil commented Dec 22, 2022

Bug Report

  • At what date and time did you most recently experience the problem?
    2022-12-22T15:52:45.994388013Z

  • Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.
    Azure Web Apps

  • If your repo is publicly available please share its URL:
    Private 🚫

  • What happened?
    ModuleNotFoundError: No module named 'psycopg2._psycopg'

  • What did you expect or want to happen?
    Successful loading of the Web App

  • How can we reproduce it?
    🤷‍♂️

  • Do you have log output? Please include between the backticks:

   _____
  /  _  \ __________ _________   ____
 /  /_\  \\___   /  |  \_  __ \_/ __ \
/    |    \/    /|  |  /|  | \/\  ___/
\____|__  /_____ \____/ |__|    \___  >
        \/      \/                  \/
A P P   S E R V I C E   O N   L I N U X

Documentation: http://aka.ms/webapp-linux
Python 3.11.0
Note: Any data outside '/home' is not persisted
Starting OpenBSD Secure Shell server: sshd.
App Command Line not configured, will attempt auto-detect
Starting periodic command scheduler: cron.
Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite
Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
Build Operation ID: |yXcV3nEsHeE=.fbb67f3_
Oryx Version: 0.2.20221031.3, Commit: 2b19efca9729673fc259e6a817be3cc0bb73b9d5, ReleaseTagName: 20221031.3
Output is compressed. Extracting it...
Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8dae428d1852d04'...
App path is set to '/tmp/8dae428d1852d04'
Detected an app based on Django
Generating `gunicorn` command for 'core.wsgi'
Writing output script to '/opt/startup/startup.sh'
Using packages from virtual environment antenv located at /tmp/8dae428d1852d04/antenv.
Updated PYTHONPATH to '/opt/startup/app_logs:/tmp/8dae428d1852d04/antenv/lib/python3.11/site-packages'
[80] [INFO] Starting gunicorn 20.1.0
[80] [INFO] Listening at: http://0.0.0.0:8000 (80)
[80] [INFO] Using worker: sync
[83] [INFO] Booting worker with pid: 83
[80] [CRITICAL] WORKER TIMEOUT (pid:83)
[80] [WARNING] Worker with pid 83 was terminated due to signal 9
[95] [INFO] Booting worker with pid: 95
[95] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.9/dist-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.9/dist-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.9/dist-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.9/dist-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.9/dist-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.9/dist-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/tmp/8dae428d1852d04/core/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
  File "/tmp/8dae428d1852d04/antenv/lib/python3.11/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/tmp/8dae428d1852d04/antenv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/tmp/8dae428d1852d04/antenv/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/tmp/8dae428d1852d04/antenv/lib/python3.11/site-packages/django/apps/config.py", line 123, in create
    mod = import_module(mod_path)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/tmp/8dae428d1852d04/antenv/lib/python3.11/site-packages/django/contrib/postgres/apps.py", line 1, in <module>
    from psycopg2.extras import DateRange, DateTimeRange, DateTimeTZRange, NumericRange
  File "/tmp/8dae428d1852d04/antenv/lib/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module>
    from psycopg2._psycopg import (                     # noqa
ModuleNotFoundError: No module named 'psycopg2._psycopg'
[95] [INFO] Worker exiting (pid: 95)
[80] [INFO] Shutting down: Master
[80] [INFO] Reason: Worker failed to boot.

Please complete the following information

  • OS: Oryx 0.2.20220825.1, gunicorn 20.1.0
  • Psycopg version: 2.9.5 psycopg2_binary-2.9.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Python version: 3.11.0
  • PostgreSQL version: 13.8
  • pip version: 22.3

See also

@JV-conseil
Copy link
Author

Failed attempt with the non binary package of psycopg2

The non binary package psycopg2-2.9.5.tar.gz

Command: oryx build /home/site/repository -o /home/site/wwwroot --platform python --platform-version 3.11 -p virtualenv_name=antenv --log-file /tmp/build-debug.log  -i /tmp/8dae467aa043c1b --compress-destination-dir | tee /tmp/oryx-build.log
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20220825.1, Commit: 24032445dbf7bf6ef068688f1b123a7144453b7f, ReleaseTagName: 20220825.1

Build Operation ID: |2BRduEAxRw4=.a850ab2c_
Repository Commit : 692962500d79e9839bf6b17dabbc6c2f97d2c2f9

Detecting platforms...
Detected following platforms:
  nodejs: 14.20.1
  python: 3.11.0
Version '14.20.1' of platform 'nodejs' is not installed. Generating script to install it...
Version '3.11.0' of platform 'python' is not installed. Generating script to install it...

Using intermediate directory '/tmp/8dae467aa043c1b'.

Copying files to the intermediate directory...
Done in 5 sec(s).

Source directory     : /tmp/8dae467aa043c1b
Destination directory: /home/site/wwwroot


Downloading and extracting 'nodejs' version '14.20.1' to '/tmp/oryx/platforms/nodejs/14.20.1'...
Detected image debian flavor: bullseye.
Downloaded in 3 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: nodejs...
Done in 17 sec(s).


Downloading and extracting 'python' version '3.11.0' to '/tmp/oryx/platforms/python/3.11.0'...
Detected image debian flavor: bullseye.
Downloaded in 7 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: python...
Done in 38 sec(s).

image detector file exists, platform is python..
OS detector file exists, OS is bullseye..
Executing pre-build command...
Finished executing pre-build command.
Python Version: /tmp/oryx/platforms/python/3.11.0/bin/python3.11
Creating directory for command manifest file if it does not exist
Removing existing manifest file
Python Virtual Environment: antenv
Creating virtual environment...
Activating virtual environment...
Running pip install...
[22:00:58+0000] Collecting azure-identity==1.12.0
[22:00:58+0000]   Downloading azure_identity-1.12.0-py3-none-any.whl (135 kB)
[22:00:58+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 135.5/135.5 kB 3.3 MB/s eta 0:00:00
[22:00:58+0000] Collecting azure-keyvault-secrets==4.6.0
[22:00:58+0000]   Downloading azure_keyvault_secrets-4.6.0-py3-none-any.whl (291 kB)
[22:00:58+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 291.6/291.6 kB 5.7 MB/s eta 0:00:00
[22:00:59+0000] Collecting bibtexparser==1.4.0
[22:00:59+0000]   Downloading bibtexparser-1.4.0.tar.gz (51 kB)
[22:00:59+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.9/51.9 kB 1.4 MB/s eta 0:00:00
[22:00:59+0000]   Preparing metadata (setup.py): started
[22:01:04+0000]   Preparing metadata (setup.py): finished with status 'done'
[22:01:06+0000] Collecting django<5.0,==4.*
[22:01:06+0000]   Downloading Django-4.1.4-py3-none-any.whl (8.1 MB)
[22:01:10+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.1/8.1 MB 2.0 MB/s eta 0:00:00
[22:01:12+0000] Collecting django-braces==1.15.0
[22:01:12+0000]   Downloading django_braces-1.15.0-py2.py3-none-any.whl (14 kB)
[22:01:12+0000] Collecting django-crispy-forms==1.14.0
[22:01:12+0000]   Downloading django_crispy_forms-1.14.0-py3-none-any.whl (133 kB)
[22:01:12+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.3/133.3 kB 6.6 MB/s eta 0:00:00
[22:01:13+0000] Collecting django-import-export==3.0.2
[22:01:14+0000]   Downloading django_import_export-3.0.2-py3-none-any.whl (104 kB)
[22:01:14+0000]      ━━━━━━━━━━━━━━━━━━━��━━━━━━━━━━━━━━━━━━━ 104.0/104.0 kB 2.5 MB/s eta 0:00:00
[22:01:14+0000] Collecting django-money==3.0.0
[22:01:14+0000]   Downloading django_money-3.0.0-py3-none-any.whl (34 kB)
[22:01:15+0000] Collecting django-pandas==0.6.6
[22:01:15+0000]   Downloading django_pandas-0.6.6-py3-none-any.whl (21 kB)
[22:01:15+0000] Collecting nltk==3.8
[22:01:15+0000]   Downloading nltk-3.8-py3-none-any.whl (1.5 MB)
[22:01:15+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 12.8 MB/s eta 0:00:00
[22:01:17+0000] Collecting psycopg2==2.9.5
[22:01:17+0000]   Downloading psycopg2-2.9.5.tar.gz (384 kB)
[22:01:17+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 384.3/384.3 kB 6.5 MB/s eta 0:00:00
[22:01:18+0000]   Preparing metadata (setup.py): started
[22:01:24+0000]   Preparing metadata (setup.py): finished with status 'done'
[22:01:25+0000] Collecting scikit-learn==1.2.0
[22:01:25+0000]   Downloading scikit_learn-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.5 MB)
[22:01:27+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 7.0 MB/s eta 0:00:00
[22:01:27+0000] Collecting social-auth-core==4.3.0
[22:01:27+0000]   Downloading social_auth_core-4.3.0-py3-none-any.whl (343 kB)
[22:01:27+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 343.0/343.0 kB 5.7 MB/s eta 0:00:00
[22:01:28+0000] Collecting social-auth-app-django==5.0.0
[22:01:28+0000]   Downloading social_auth_app_django-5.0.0-py3-none-any.whl (24 kB)
[22:01:28+0000] Collecting whitenoise==6.2.0
[22:01:28+0000]   Downloading whitenoise-6.2.0-py3-none-any.whl (19 kB)
[22:01:28+0000] Collecting azure-core<2.0.0,>=1.11.0
[22:01:28+0000]   Downloading azure_core-1.26.1-py3-none-any.whl (172 kB)
[22:01:29+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.6/172.6 kB 1.9 MB/s eta 0:00:00
[22:01:32+0000] Collecting cryptography>=2.5
[22:01:32+0000]   Downloading cryptography-38.0.4-cp36-abi3-manylinux_2_28_x86_64.whl (4.2 MB)
[22:01:33+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.2/4.2 MB 4.0 MB/s eta 0:00:00
[22:01:33+0000] Collecting msal<2.0.0,>=1.12.0
[22:01:33+0000]   Downloading msal-1.20.0-py2.py3-none-any.whl (90 kB)
[22:01:34+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.0/90.0 kB 1.7 MB/s eta 0:00:00
[22:01:34+0000] Collecting msal-extensions<2.0.0,>=0.3.0
[22:01:34+0000]   Downloading msal_extensions-1.0.0-py2.py3-none-any.whl (19 kB)
[22:01:34+0000] Collecting six>=1.12.0
[22:01:34+0000]   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
[22:01:35+0000] Collecting msrest>=0.6.21
[22:01:35+0000]   Downloading msrest-0.7.1-py3-none-any.whl (85 kB)
[22:01:35+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.4/85.4 kB 2.7 MB/s eta 0:00:00
[22:01:36+0000] Collecting azure-common~=1.1
[22:01:36+0000]   Downloading azure_common-1.1.28-py2.py3-none-any.whl (14 kB)
[22:01:36+0000] Collecting pyparsing>=2.0.3
[22:01:36+0000]   Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
[22:01:36+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 kB 830.4 kB/s eta 0:00:00
[22:01:37+0000] Collecting asgiref<4,>=3.5.2
[22:01:37+0000]   Downloading asgiref-3.6.0-py3-none-any.whl (23 kB)
[22:01:37+0000] Collecting sqlparse>=0.2.2
[22:01:37+0000]   Downloading sqlparse-0.4.3-py3-none-any.whl (42 kB)
[22:01:37+0000]      ━━━━━━━━━━━━━━━━━━━━���━━━━━━━━━━━━━━━━━━ 42.8/42.8 kB 868.7 kB/s eta 0:00:00
[22:01:38+0000] Collecting diff-match-patch
[22:01:38+0000]   Downloading diff_match_patch-20200713-py3-none-any.whl (61 kB)
[22:01:38+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 kB 262.7 kB/s eta 0:00:00
[22:01:39+0000] Collecting tablib[html,ods,xls,xlsx,yaml]>=3.2.1
[22:01:39+0000]   Downloading tablib-3.3.0-py3-none-any.whl (48 kB)
[22:01:39+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.6/48.6 kB 3.4 MB/s eta 0:00:00
[22:01:39+0000] Requirement already satisfied: setuptools in ./antenv/lib/python3.11/site-packages (from django-money==3.0.0->-r requirements.txt (line 8)) (65.5.0)
[22:01:39+0000] Collecting py-moneyed<3.0,>=2.0
[22:01:39+0000]   Downloading py_moneyed-2.0-py3-none-any.whl (11 kB)
[22:01:42+0000] Collecting pandas>=0.14.1
[22:01:42+0000]   Downloading pandas-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB)
[22:01:44+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.0/12.0 MB 7.3 MB/s eta 0:00:00
[22:01:45+0000] Collecting click
[22:01:45+0000]   Downloading click-8.1.3-py3-none-any.whl (96 kB)
[22:01:45+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 8.5 MB/s eta 0:00:00
[22:01:46+0000] Collecting joblib
[22:01:46+0000]   Downloading joblib-1.2.0-py3-none-any.whl (297 kB)
[22:01:46+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 298.0/298.0 kB 9.9 MB/s eta 0:00:00
[22:01:55+0000] Collecting regex>=2021.8.3
[22:01:55+0000]   Downloading regex-2022.10.31-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (781 kB)
[22:01:56+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 781.1/781.1 kB 8.8 MB/s eta 0:00:00
[22:01:56+0000] Collecting tqdm
[22:01:56+0000]   Downloading tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
[22:01:57+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 1.5 MB/s eta 0:00:00
[22:02:01+0000] Collecting numpy>=1.17.3
[22:02:01+0000]   Downloading numpy-1.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
[22:02:05+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 3.7 MB/s eta 0:00:00
[22:02:11+0000] Collecting scipy>=1.3.2
[22:02:11+0000]   Downloading scipy-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (33.4 MB)
[22:02:20+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.4/33.4 MB 2.2 MB/s eta 0:00:00
[22:02:25+0000] Collecting threadpoolctl>=2.0.0
[22:02:26+0000]   Downloading threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
[22:02:33+0000] Collecting requests>=2.9.1
[22:02:34+0000]   Downloading requests-2.28.1-py3-none-any.whl (62 kB)
[22:02:34+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 1.1 MB/s eta 0:00:00
[22:02:36+0000] Collecting oauthlib>=1.0.3
[22:02:36+0000]   Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
[22:02:37+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.7/151.7 kB 283.2 kB/s eta 0:00:00
[22:02:38+0000] Collecting requests-oauthlib>=0.6.1
[22:02:39+0000]   Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
[22:02:40+0000] Collecting PyJWT>=2.0.0
[22:02:41+0000]   Downloading PyJWT-2.6.0-py3-none-any.whl (20 kB)
[22:02:42+0000] Collecting defusedxml>=0.5.0rc1
[22:02:42+0000]   Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
[22:02:43+0000] Collecting python3-openid>=3.0.10
[22:02:43+0000]   Downloading python3_openid-3.2.0-py3-none-any.whl (133 kB)
[22:02:43+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.7/133.7 kB 4.3 MB/s eta 0:00:00
[22:02:45+0000] Collecting typing-extensions>=4.0.1
[22:02:45+0000]   Downloading typing_extensions-4.4.0-py3-none-any.whl (26 kB)
[22:02:47+0000] Collecting cffi>=1.12
[22:02:47+0000]   Downloading cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (462 kB)
[22:02:47+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 462.6/462.6 kB 11.3 MB/s eta 0:00:00
[22:02:48+0000] Collecting portalocker<3,>=1.0
[22:02:48+0000]   Downloading portalocker-2.6.0-py2.py3-none-any.whl (15 kB)
[22:02:49+0000] Collecting certifi>=2017.4.17
[22:02:49+0000]   Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
[22:02:49+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 7.6 MB/s eta 0:00:00
[22:02:49+0000] Collecting isodate>=0.6.0
[22:02:49+0000]   Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)
[22:02:49+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.7/41.7 kB 3.4 MB/s eta 0:00:00
[22:02:49+0000] Collecting python-dateutil>=2.8.1
[22:02:49+0000]   Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
[22:02:49+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 6.4 MB/s eta 0:00:00
[22:02:51+0000] Collecting pytz>=2020.1
[22:02:51+0000]   Downloading pytz-2022.7-py2.py3-none-any.whl (499 kB)
[22:02:51+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 kB 8.3 MB/s eta 0:00:00
[22:02:51+0000] Collecting babel>=2.8.0
[22:02:51+0000]   Downloading Babel-2.11.0-py3-none-any.whl (9.5 MB)
[22:02:53+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 6.0 MB/s eta 0:00:00
[22:02:55+0000] Collecting charset-normalizer<3,>=2
[22:02:55+0000]   Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
[22:02:55+0000] Collecting idna<4,>=2.5
[22:02:55+0000]   Downloading idna-3.4-py3-none-any.whl (61 kB)
[22:02:55+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 5.5 MB/s eta 0:00:00
[22:02:55+0000] Collecting urllib3<1.27,>=1.21.1
[22:02:55+0000]   Downloading urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
[22:02:55+0000]      ━━━━━━━━━━━━━━━━━━━━━━��━━━━━━━━━━━━━━━━ 140.6/140.6 kB 6.5 MB/s eta 0:00:00
[22:02:56+0000] Collecting markuppy
[22:02:56+0000]   Downloading MarkupPy-1.14.tar.gz (6.8 kB)
[22:02:56+0000]   Preparing metadata (setup.py): started
[22:03:00+0000]   Preparing metadata (setup.py): finished with status 'done'
[22:03:00+0000] Collecting odfpy
[22:03:00+0000]   Downloading odfpy-1.4.1.tar.gz (717 kB)
[22:03:00+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 717.0/717.0 kB 9.1 MB/s eta 0:00:00
[22:03:01+0000]   Preparing metadata (setup.py): started
[22:03:04+0000]   Preparing metadata (setup.py): finished with status 'done'
[22:03:05+0000] Collecting xlrd
[22:03:05+0000]   Downloading xlrd-2.0.1-py2.py3-none-any.whl (96 kB)
[22:03:05+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.5/96.5 kB 2.3 MB/s eta 0:00:00
[22:03:05+0000] Collecting xlwt
[22:03:05+0000]   Downloading xlwt-1.3.0-py2.py3-none-any.whl (99 kB)
[22:03:05+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0/100.0 kB 4.6 MB/s eta 0:00:00
[22:03:05+0000] Collecting openpyxl>=2.6.0
[22:03:05+0000]   Downloading openpyxl-3.0.10-py2.py3-none-any.whl (242 kB)
[22:03:05+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 242.1/242.1 kB 3.5 MB/s eta 0:00:00
[22:03:06+0000] Collecting pyyaml
[22:03:06+0000]   Downloading PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
[22:03:06+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.9/757.9 kB 6.4 MB/s eta 0:00:00
[22:03:07+0000] Collecting pycparser
[22:03:07+0000]   Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
[22:03:07+0000]      ━━━━━━━━━━��━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 6.4 MB/s eta 0:00:00
[22:03:07+0000] Collecting et-xmlfile
[22:03:07+0000]   Downloading et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB)
[22:03:10+0000] Building wheels for collected packages: bibtexparser, psycopg2, markuppy, odfpy
[22:03:10+0000]   Building wheel for bibtexparser (setup.py): started
[22:03:14+0000]   Building wheel for bibtexparser (setup.py): finished with status 'done'
[22:03:14+0000]   Created wheel for bibtexparser: filename=bibtexparser-1.4.0-py3-none-any.whl size=42430 sha256=6450322fe126d45b0c65cb8ad086e51d3efad3336104acf952ef3deca82de75f
[22:03:14+0000]   Stored in directory: /usr/local/share/pip-cache/wheels/6f/0b/a5/e137b1e915340be991a88f0120b60465018f6964c752674f0b
[22:03:14+0000]   Building wheel for psycopg2 (setup.py): started
[22:03:18+0000]   Building wheel for psycopg2 (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      /tmp/8dae467aa043c1b/antenv/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/psycopg
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130007 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/8dae467aa043c1b/antenv/include -I/opt/python/3.11.0/include/python3.11 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-311/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
         35 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/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: Failed building wheel for psycopg2
[22:03:18+0000]   Running setup.py clean for psycopg2
[22:03:20+0000]   Building wheel for markuppy (setup.py): started
[22:03:24+0000]   Building wheel for markuppy (setup.py): finished with status 'done'
[22:03:24+0000]   Created wheel for markuppy: filename=MarkupPy-1.14-py3-none-any.whl size=7397 sha256=68a251e550ca5ad567e8caef07737c5e720e700ebf397c7d12797270fd6a5c16
[22:03:24+0000]   Stored in directory: /usr/local/share/pip-cache/wheels/0a/df/54/e52cf059f887522a087527251d6976982bcf98c89afc58ce2d
[22:03:24+0000]   Building wheel for odfpy (setup.py): started
[22:03:28+0000]   Building wheel for odfpy (setup.py): finished with status 'done'
[22:03:28+0000]   Created wheel for odfpy: filename=odfpy-1.4.1-py2.py3-none-any.whl size=160672 sha256=2904b2894ddfdb9d848e60edaa847c495da18f114eafd6a7eb704b9fc30011d7
[22:03:28+0000]   Stored in directory: /usr/local/share/pip-cache/wheels/4b/4d/6e/b75855c625d2ce60227a99e571c0bf47ec93ac56a09b5a065c
[22:03:28+0000] Successfully built bibtexparser markuppy odfpy
[22:03:28+0000] Failed to build psycopg2
[22:03:33+0000] Installing collected packages: xlwt, pytz, markuppy, azure-common, xlrd, whitenoise, urllib3, typing-extensions, tqdm, threadpoolctl, tablib, sqlparse, six, regex, pyyaml, pyparsing, PyJWT, pycparser, psycopg2, portalocker, oauthlib, numpy, joblib, idna, et-xmlfile, django-crispy-forms, diff-match-patch, defusedxml, click, charset-normalizer, certifi, babel, asgiref, scipy, requests, python3-openid, python-dateutil, py-moneyed, openpyxl, odfpy, nltk, isodate, django, cffi, bibtexparser, scikit-learn, requests-oauthlib, pandas, django-money, django-braces, cryptography, azure-core, social-auth-core, msrest, django-pandas, django-import-export, social-auth-app-django, msal, azure-keyvault-secrets, msal-extensions, azure-identity
[22:03:43+0000]   Running setup.py install for psycopg2: started
[22:03:47+0000]   Running setup.py install for psycopg2: finished with status 'error'
  error: subprocess-exited-with-error
  
  × Running setup.py install for psycopg2 did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      /tmp/8dae467aa043c1b/antenv/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running install
      /tmp/8dae467aa043c1b/antenv/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(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/psycopg
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130007 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/8dae467aa043c1b/antenv/include -I/opt/python/3.11.0/include/python3.11 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-311/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
         35 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/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.
╰─> psycopg2

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

[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: pip install --upgrade pip
"2022-12-22 22:03:51"|ERROR|[22:00:58+0000] Collecting azure-identity==1.12.0
[22:00:58+0000]   Downloading azure_identity-1.12.0-py3-none-any.whl (135 kB)
[22:00:58+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 135.5/135.5 kB 3.3 MB/s eta 0:00:00
[22:00:58+0000] Collecting azure-keyvault-secrets==4.6.0
[22:00:58+0000]   Downloading azure_keyvault_secrets-4.6.0-py3-none-any.whl (291 kB)
[22:00:58+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 291.6/291.6 kB 5.7 MB/s eta 0:00:00
[22:00:59+0000] Collecting bibtexparser==1.4.0
[22:00:59+0000]   Downloading bibtexparser-1.4.0.tar.gz (51 kB)
[22:00:59+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━���━━━━━━━━━━━━━━━ 51.9/51.9 kB 1.4 MB/s eta 0:00:00
[22:00:59+0000]   Preparing metadata (setup.py): started
[22:01:04+0000]   Preparing metadata (setup.py): finished with status 'done'
[22:01:06+0000] Collecting django<5.0,==4.*
[22:01:06+0000]   Downloading Django-4.1.4-py3-none-any.whl (8.1 MB)
[22:01:10+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.1/8.1 MB 2.0 MB/s eta 0:00:00
[22:01:12+0000] Collecting django-braces==1.15.0
[22:01:12+0000]   Downloading django_braces-1.15.0-py2.py3-none-any.whl (14 kB)
[22:01:12+0000] Collecting django-crispy-forms==1.14.0
[22:01:12+0000]   Downloading django_crispy_forms-1.14.0-py3-none-any.whl (133 kB)
[22:01:12+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.3/133.3 kB 6.6 MB/s eta 0:00:00
[22:01:13+0000] Collecting django-import-export==3.0.2
[22:01:14+0000]   Downloading django_import_export-3.0.2-py3-none-any.whl (104 kB)
[22:01:14+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.0/104.0 kB 2.5 MB/s eta 0:00:00
[22:01:14+0000] Collecting django-money==3.0.0
[22:01:14+0000]   Downloading django_money-3.0.0-py3-none-any.whl (34 kB)
[22:01:15+0000] Collecting django-pandas==0.6.6
[22:01:15+0000]   Downloading django_pandas-0.6.6-py3-none-any.whl (21 kB)
[22:01:15+0000] Collecting nltk==3.8
[22:01:15+0000]   Downloading nltk-3.8-py3-none-any.whl (1.5 MB)
[22:01:15+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 12.8 MB/s eta 0:00:00
[22:01:17+0000] Collecting psycopg2==2.9.5
[22:01:17+0000]   Downloading psycopg2-2.9.5.tar.gz (384 kB)
[22:01:17+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 384.3/384.3 kB 6.5 MB/s eta 0:00:00
[22:01:18+0000]   Preparing metadata (setup.py): started
[22:01:24+0000]   Preparing metadata (setup.py): finished with status 'done'
[22:01:25+0000] Collecting scikit-learn==1.2.0
[22:01:25+0000]   Downloading scikit_learn-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.5 MB)
[22:01:27+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 7.0 MB/s eta 0:00:00
[22:01:27+0000] Collecting social-auth-core==4.3.0
[22:01:27+0000]   Downloading social_auth_core-4.3.0-py3-none-any.whl (343 kB)
[22:01:27+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 343.0/343.0 kB 5.7 MB/s eta 0:00:00
[22:01:28+0000] Collecting social-auth-app-django==5.0.0
[22:01:28+0000]   Downloading social_auth_app_django-5.0.0-py3-none-any.whl (24 kB)
[22:01:28+0000] Collecting whitenoise==6.2.0
[22:01:28+0000]   Downloading whitenoise-6.2.0-py3-none-any.whl (19 kB)
[22:01:28+0000] Collecting azure-core<2.0.0,>=1.11.0
[22:01:28+0000]   Downloading azure_core-1.26.1-py3-none-any.whl (172 kB)
[22:01:29+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.6/172.6 kB 1.9 MB/s eta 0:00:00
[22:01:32+0000] Collecting cryptography>=2.5
[22:01:32+0000]   Downloading cryptography-38.0.4-cp36-abi3-manylinux_2_28_x86_64.whl (4.2 MB)
[22:01:33+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.2/4.2 MB 4.0 MB/s eta 0:00:00
[22:01:33+0000] Collecting msal<2.0.0,>=1.12.0
[22:01:33+0000]   Downloading msal-1.20.0-py2.py3-none-any.whl (90 kB)
[22:01:34+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.0/90.0 kB 1.7 MB/s eta 0:00:00
[22:01:34+0000] Collecting msal-extensions<2.0.0,>=0.3.0
[22:01:34+0000]   Downloading msal_extensions-1.0.0-py2.py3-none-any.whl (19 kB)
[22:01:34+0000] Collecting six>=1.12.0
[22:01:34+0000]   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
[22:01:35+0000] Collecting msrest>=0.6.21
[22:01:35+0000]   Downloading msrest-0.7.1-py3-none-any.whl (85 kB)
[22:01:35+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.4/85.4 kB 2.7 MB/s eta 0:00:00
[22:01:36+0000] Collecting azure-common~=1.1
[22:01:36+0000]   Downloading azure_common-1.1.28-py2.py3-none-any.whl (14 kB)
[22:01:36+0000] Collecting pyparsing>=2.0.3
[22:01:36+0000]   Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
[22:01:36+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 kB 830.4 kB/s eta 0:00:00
[22:01:37+0000] Collecting asgiref<4,>=3.5.2
[22:01:37+0000]   Downloading asgiref-3.6.0-py3-none-any.whl (23 kB)
[22:01:37+0000] Collecting sqlparse>=0.2.2
[22:01:37+0000]   Downloading sqlparse-0.4.3-py3-none-any.whl (42 kB)
[22:01:37+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 kB 868.7 kB/s eta 0:00:00
[22:01:38+0000] Collecting diff-match-patch
[22:01:38+0000]   Downloading diff_match_patch-20200713-py3-none-any.whl (61 kB)
[22:01:38+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 kB 262.7 kB/s eta 0:00:00
[22:01:39+0000] Collecting tablib[html,ods,xls,xlsx,yaml]>=3.2.1
[22:01:39+0000]   Downloading tablib-3.3.0-py3-none-any.whl (48 kB)
[22:01:39+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.6/48.6 kB 3.4 MB/s eta 0:00:00
[22:01:39+0000] Requirement already satisfied: setuptools in ./antenv/lib/python3.11/site-packages (from django-money==3.0.0->-r requirements.txt (line 8)) (65.5.0)
[22:01:39+0000] Collecting py-moneyed<3.0,>=2.0
[22:01:39+0000]   Downloading py_moneyed-2.0-py3-none-any.whl (11 kB)
[22:01:42+0000] Collecting pandas>=0.14.1
[22:01:42+0000]   Downloading pandas-1.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB)
[22:01:44+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.0/12.0 MB 7.3 MB/s eta 0:00:00
[22:01:45+0000] Collecting click
[22:01:45+0000]   Downloading click-8.1.3-py3-none-any.whl (96 kB)
[22:01:45+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 8.5 MB/s eta 0:00:00
[22:01:46+0000] Collecting joblib
[22:01:46+0000]   Downloading joblib-1.2.0-py3-none-any.whl (297 kB)
[22:01:46+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 298.0/298.0 kB 9.9 MB/s eta 0:00:00
[22:01:55+0000] Collecting regex>=2021.8.3
[22:01:55+0000]   Downloading regex-2022.10.31-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (781 kB)
[22:01:56+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 781.1/781.1 kB 8.8 MB/s eta 0:00:00
[22:01:56+0000] Collecting tqdm
[22:01:56+0000]   Downloading tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
[22:01:57+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 1.5 MB/s eta 0:00:00
[22:02:01+0000] Collecting numpy>=1.17.3
[22:02:01+0000]   Downloading numpy-1.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
[22:02:05+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 3.7 MB/s eta 0:00:00
[22:02:11+0000] Collecting scipy>=1.3.2
[22:02:11+0000]   Downloading scipy-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (33.4 MB)
[22:02:20+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.4/33.4 MB 2.2 MB/s eta 0:00:00
[22:02:25+0000] Collecting threadpoolctl>=2.0.0
[22:02:26+0000]   Downloading threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
[22:02:33+0000] Collecting requests>=2.9.1
[22:02:34+0000]   Downloading requests-2.28.1-py3-none-any.whl (62 kB)
[22:02:34+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 1.1 MB/s eta 0:00:00
[22:02:36+0000] Collecting oauthlib>=1.0.3
[22:02:36+0000]   Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
[22:02:37+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.7/151.7 kB 283.2 kB/s eta 0:00:00
[22:02:38+0000] Collecting requests-oauthlib>=0.6.1
[22:02:39+0000]   Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
[22:02:40+0000] Collecting PyJWT>=2.0.0
[22:02:41+0000]   Downloading PyJWT-2.6.0-py3-none-any.whl (20 kB)
[22:02:42+0000] Collecting defusedxml>=0.5.0rc1
[22:02:42+0000]   Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
[22:02:43+0000] Collecting python3-openid>=3.0.10
[22:02:43+0000]   Downloading python3_openid-3.2.0-py3-none-any.whl (133 kB)
[22:02:43+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.7/133.7 kB 4.3 MB/s eta 0:00:00
[22:02:45+0000] Collecting typing-extensions>=4.0.1
[22:02:45+0000]   Downloading typing_extensions-4.4.0-py3-none-any.whl (26 kB)
[22:02:47+0000] Collecting cffi>=1.12
[22:02:47+0000]   Downloading cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (462 kB)
[22:02:47+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 462.6/462.6 kB 11.3 MB/s eta 0:00:00
[22:02:48+0000] Collecting portalocker<3,>=1.0
[22:02:48+0000]   Downloading portalocker-2.6.0-py2.py3-none-any.whl (15 kB)
[22:02:49+0000] Collecting certifi>=2017.4.17
[22:02:49+0000]   Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
[22:02:49+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 7.6 MB/s eta 0:00:00
[22:02:49+0000] Collecting isodate>=0.6.0
[22:02:49+0000]   Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)
[22:02:49+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.7/41.7 kB 3.4 MB/s eta 0:00:00
[22:02:49+0000] Collecting python-dateutil>=2.8.1
[22:02:49+0000]   Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
[22:02:49+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 6.4 MB/s eta 0:00:00
[22:02:51+0000] Collecting pytz>=2020.1
[22:02:51+0000]   Downloading pytz-2022.7-py2.py3-none-any.whl (499 kB)
[22:02:51+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 kB 8.3 MB/s eta 0:00:00
[22:02:51+0000] Collecting babel>=2.8.0
[22:02:51+0000]   Downloading Babel-2.11.0-py3-none-any.whl (9.5 MB)
[22:02:53+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 6.0 MB/s eta 0:00:00
[22:02:55+0000] Collecting charset-normalizer<3,>=2
[22:02:55+0000]   Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
[22:02:55+0000] Collecting idna<4,>=2.5
[22:02:55+0000]   Downloading idna-3.4-py3-none-any.whl (61 kB)
[22:02:55+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 5.5 MB/s eta 0:00:00
[22:02:55+0000] Collecting urllib3<1.27,>=1.21.1
[22:02:55+0000]   Downloading urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
[22:02:55+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 6.5 MB/s eta 0:00:00
[22:02:56+0000] Collecting markuppy
[22:02:56+0000]   Downloading MarkupPy-1.14.tar.gz (6.8 kB)
[22:02:56+0000]   Preparing metadata (setup.py): started
[22:03:00+0000]   Preparing metadata (setup.py): finished with status 'done'
[22:03:00+0000] Collecting odfpy
[22:03:00+0000]   Downloading odfpy-1.4.1.tar.gz (717 kB)
[22:03:00+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 717.0/717.0 kB 9.1 MB/s eta 0:00:00
[22:03:01+0000]   Preparing metadata (setup.py): started
[22:03:04+0000]   Preparing metadata (setup.py): finished with status 'done'
[22:03:05+0000] Collecting xlrd
[22:03:05+0000]   Downloading xlrd-2.0.1-py2.py3-none-any.whl (96 kB)
[22:03:05+0000]      ━━━━━━━━━━━━━━━���━━━━━━━━━━━━━━━━━━━━━━━━ 96.5/96.5 kB 2.3 MB/s eta 0:00:00
[22:03:05+0000] Collecting xlwt
[22:03:05+0000]   Downloading xlwt-1.3.0-py2.py3-none-any.whl (99 kB)
[22:03:05+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0/100.0 kB 4.6 MB/s eta 0:00:00
[22:03:05+0000] Collecting openpyxl>=2.6.0
[22:03:05+0000]   Downloading openpyxl-3.0.10-py2.py3-none-any.whl (242 kB)
[22:03:05+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 242.1/242.1 kB 3.5 MB/s eta 0:00:00
[22:03:06+0000] Collecting pyyaml
[22:03:06+0000]   Downloading PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
[22:03:06+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.9/757.9 kB 6.4 MB/s eta 0:00:00
[22:03:07+0000] Collecting pycparser
[22:03:07+0000]   Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
[22:03:07+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 6.4 MB/s eta 0:00:00
[22:03:07+0000] Collecting et-xmlfile
[22:03:07+0000]   Downloading et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB)
[22:03:10+0000] Building wheels for collected packages: bibtexparser, psycopg2, markuppy, odfpy
[22:03:10+0000]   Building wheel for bibtexparser (setup.py): started
[22:03:14+0000]   Building wheel for bibtexparser (setup.py): finished with status 'done'
[22:03:14+0000]   Created wheel for bibtexparser: filename=bibtexparser-1.4.0-py3-none-any.whl size=42430 sha256=6450322fe126d45b0c65cb8ad086e51d3efad3336104acf952ef3deca82de75f
[22:03:14+0000]   Stored in directory: /usr/local/share/pip-cache/wheels/6f/0b/a5/e137b1e915340be991a88f0120b60465018f6964c752674f0b
[22:03:14+0000]   Building wheel for psycopg2 (setup.py): started
[22:03:18+0000]   Building wheel for psycopg2 (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      /tmp/8dae467aa043c1b/antenv/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/psycopg
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130007 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/8dae467aa043c1b/antenv/include -I/opt/python/3.11.0/include/python3.11 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-311/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
         35 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/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: Failed building wheel for psycopg2
[22:03:18+0000]   Running setup.py clean for psycopg2
[22:03:20+0000]   Building wheel for markuppy (setup.py): started
[22:03:24+0000]   Building wheel for markuppy (setup.py): finished with status 'done'
[22:03:24+0000]   Created wheel for markuppy: filename=MarkupPy-1.14-py3-none-any.whl size=7397 sha256=68a251e550ca5ad567e8caef07737c5e720e700ebf397c7d12797270fd6a5c16
[22:03:24+0000]   Stored in directory: /usr/local/share/pip-cache/wheels/0a/df/54/e52cf059f887522a087527251d6976982bcf98c89afc58ce2d
[22:03:24+0000]   Building wheel for odfpy (setup.py): started
[22:03:28+0000]   Building wheel for odfpy (setup.py): finished with status 'done'
[22:03:28+0000]   Created wheel for odfpy: filename=odfpy-1.4.1-py2.py3-none-any.whl size=160672 sha256=2904b2894ddfdb9d848e60edaa847c495da18f114eafd6a7eb704b9fc30011d7
[22:03:28+0000]   Stored in directory: /usr/local/share/pip-cache/wheels/4b/4d/6e/b75855c625d2ce60227a99e571c0bf47ec93ac56a09b5a065c
[22:03:28+0000] Successfully built bibtexparser markuppy odfpy
[22:03:28+0000] Failed to build psycopg2
[22:03:33+0000] Installing collected packages: xlwt, pytz, markuppy, azure-common, xlrd, whitenoise, urllib3, typing-extensions, tqdm, threadpoolctl, tablib, sqlparse, six, regex, pyyaml, pyparsing, PyJWT, pycparser, psycopg2, portalocker, oauthlib, numpy, joblib, idna, et-xmlfile, django-crispy-forms, diff-match-patch, defusedxml, click, charset-normalizer, certifi, babel, asgiref, scipy, requests, python3-openid, python-dateutil, py-moneyed, openpyxl, odfpy, nltk, isodate, django, cffi, bibtexparser, scikit-learn, requests-oauthlib, pandas, django-money, django-braces, cryptography, azure-core, social-auth-core, msrest, django-pandas, django-import-export, social-auth-app-django, msal, azure-keyvault-secrets, msal-extensions, azure-identity
[22:03:43+0000]   Running setup.py install for psycopg2: started
[22:03:47+0000]   Running setup.py install for psycopg2: finished with status 'error'
  error: subprocess-exited-with-error
  
  × Running setup.py install for psycopg2 did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      /tmp/8dae467aa043c1b/antenv/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running install
      /tmp/8dae467aa043c1b/antenv/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(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-311/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/psycopg
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130007 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/8dae467aa043c1b/antenv/include -I/opt/python/3.11.0/include/python3.11 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-311/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
         35 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/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.
╰─> psycopg2

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

[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: pip install --upgrade pip | Exit code: 1 | Please review your requirements.txt | More information: https://aka.ms/troubleshoot-python
\n/bin/bash -c "oryx build /home/site/repository -o /home/site/wwwroot --platform python --platform-version 3.11 -p virtualenv_name=antenv --log-file /tmp/build-debug.log  -i /tmp/8dae467aa043c1b --compress-destination-dir | tee /tmp/oryx-build.log ; exit $PIPESTATUS "

@daniv-msft
Copy link
Contributor

(Adding @cormacpayne)
Thanks @JV-conseil for opening this issue. At first sight it might be related to the type of package installed vs. how it's installed in Oryx in Azure Web Apps (something similar to https://stackoverflow.com/questions/36103034/importerror-no-module-named-psycopg2-psycopg).
I know that your repo is private, but is there a way for you to validate outside of Azure Web Apps that the scenario only reproduces there? Did you try using an older version of psycopg2 to determine if it reproduces?

Also, is this a new issue, or did it appear after you upgraded to a new version of Python on Azure Web Apps?

We have a couple of samples that rely on psycopg2 in our repo, but they are not targeting the same version as you do. @cormacpayne If the extra questions above don't help, maybe it would be easy to just upgrade the samples and run tests to understand where the issue might be?

@pamelafox
Copy link
Member

pamelafox commented Jan 3, 2023

I also got this error today:

./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory

I got it when deploying https://github.com/pamelafox/cookiecutter-django-output/tree/44240a985bce6eeb92c46b0c6cf07eae66316752

It was strange as it started happening suddenly (when I hadn't made any psycopg related changes) and then stopped happening. Deployment Center logs is no longer showing me the failed deploys, so I can't paste the full logs, but it was basically the error above.

I don't know what would cause intermittent failure to build psycopg, I'll report with more details if it happens again.

@pamelafox
Copy link
Member

Replicated! Deployment logs:

Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.10 -p virtualenv_name=antenv --log-file /tmp/build-debug.log  -i /tmp/8daedc8d95426fd --compress-destination-dir | tee /tmp/oryx-build.log
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20220825.1, Commit: 24032445dbf7bf6ef068688f1b123a7144453b7f, ReleaseTagName: 20220825.1

Build Operation ID: |J2031eg8rxQ=.9251b5c1_
Repository Commit : 5ecfcd95-a2c3-47a6-976f-fcc6611409ee

Detecting platforms...
Detected following platforms:
  nodejs: 16.18.0
  python: 3.10.9
Version '16.18.0' of platform 'nodejs' is not installed. Generating script to install it...
Version '3.10.9' of platform 'python' is not installed. Generating script to install it...

Using intermediate directory '/tmp/8daedc8d95426fd'.

Copying files to the intermediate directory...
Done in 0 sec(s).

Source directory     : /tmp/8daedc8d95426fd
Destination directory: /home/site/wwwroot


Downloading and extracting 'nodejs' version '16.18.0' to '/tmp/oryx/platforms/nodejs/16.18.0'...
Detected image debian flavor: bullseye.
Downloaded in 1 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: nodejs...
Done in 8 sec(s).


Downloading and extracting 'python' version '3.10.9' to '/tmp/oryx/platforms/python/3.10.9'...
Detected image debian flavor: bullseye.
Downloaded in 2 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: python...
Done in 15 sec(s).

image detector file exists, platform is python..
OS detector file exists, OS is bullseye..
Python Version: /tmp/oryx/platforms/python/3.10.9/bin/python3.10
Creating directory for command manifest file if it does not exist
Removing existing manifest file
Python Virtual Environment: antenv
Creating virtual environment...
Activating virtual environment...
Running pip install...
[20:27:42+0000] Collecting pytz==2022.7
[20:27:42+0000]   Downloading pytz-2022.7-py2.py3-none-any.whl (499 kB)
[20:27:42+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 kB 4.4 MB/s eta 0:00:00
[20:27:42+0000] Collecting python-slugify==7.0.0
[20:27:42+0000]   Downloading python_slugify-7.0.0-py2.py3-none-any.whl (9.4 kB)
[20:27:44+0000] Collecting Pillow==9.3.0
[20:27:44+0000]   Downloading Pillow-9.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.3 MB)
[20:27:44+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 13.6 MB/s eta 0:00:00
[20:27:44+0000] Collecting argon2-cffi==21.3.0
[20:27:44+0000]   Downloading argon2_cffi-21.3.0-py3-none-any.whl (14 kB)
[20:27:44+0000] Collecting whitenoise==6.2.0
[20:27:44+0000]   Downloading whitenoise-6.2.0-py3-none-any.whl (19 kB)
[20:27:45+0000] Collecting redis==4.4.0
[20:27:45+0000]   Downloading redis-4.4.0-py3-none-any.whl (236 kB)
[20:27:45+0000]      ━━━━━━━━━━━━━━━���━━━━━━━━━━━━━━━━━━━━━━━ 236.4/236.4 kB 3.6 MB/s eta 0:00:00
[20:27:45+0000] Collecting hiredis==2.1.0
[20:27:45+0000]   Downloading hiredis-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (83 kB)
[20:27:45+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.5/83.5 kB 1.4 MB/s eta 0:00:00
[20:27:46+0000] Collecting django==4.0.8
[20:27:46+0000]   Downloading Django-4.0.8-py3-none-any.whl (8.0 MB)
[20:27:46+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.0/8.0 MB 17.5 MB/s eta 0:00:00
[20:27:47+0000] Collecting django-environ==0.9.0
[20:27:47+0000]   Downloading django_environ-0.9.0-py2.py3-none-any.whl (17 kB)
[20:27:47+0000] Collecting django-model-utils==4.3.1
[20:27:47+0000]   Downloading django_model_utils-4.3.1-py3-none-any.whl (36 kB)
[20:27:47+0000] Collecting django-allauth==0.51.0
[20:27:47+0000]   Downloading django-allauth-0.51.0.tar.gz (709 kB)
[20:27:47+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 709.6/709.6 kB 9.6 MB/s eta 0:00:00
[20:27:48+0000]   Preparing metadata (setup.py): started
[20:27:50+0000]   Preparing metadata (setup.py): finished with status 'done'
[20:27:50+0000] Collecting django-crispy-forms==1.14.0
[20:27:50+0000]   Downloading django_crispy_forms-1.14.0-py3-none-any.whl (133 kB)
[20:27:50+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.3/133.3 kB 2.1 MB/s eta 0:00:00
[20:27:50+0000] Collecting crispy-bootstrap5==0.7
[20:27:50+0000]   Downloading crispy_bootstrap5-0.7-py3-none-any.whl (22 kB)
[20:27:50+0000] Collecting django-redis==5.2.0
[20:27:50+0000]   Downloading django_redis-5.2.0-py3-none-any.whl (30 kB)
[20:27:51+0000] Collecting gunicorn==20.1.0
[20:27:51+0000]   Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
[20:27:51+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.5/79.5 kB 1.4 MB/s eta 0:00:00
[20:27:51+0000] Collecting psycopg2==2.9.5
[20:27:51+0000]   Downloading psycopg2-2.9.5.tar.gz (384 kB)
[20:27:51+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 384.3/384.3 kB 5.9 MB/s eta 0:00:00
[20:27:51+0000]   Preparing metadata (setup.py): started
[20:27:53+0000]   Preparing metadata (setup.py): finished with status 'done'
[20:27:53+0000] Collecting django-storages[azure]==1.13.1
[20:27:53+0000]   Downloading django_storages-1.13.1-py3-none-any.whl (46 kB)
[20:27:53+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.2/46.2 kB 464.3 kB/s eta 0:00:00
[20:27:53+0000] Collecting django-anymail==9.0
[20:27:53+0000]   Downloading django_anymail-9.0-py3-none-any.whl (101 kB)
[20:27:53+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.2/101.2 kB 2.1 MB/s eta 0:00:00
[20:27:54+0000] Collecting text-unidecode>=1.3
[20:27:54+0000]   Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
[20:27:54+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.2/78.2 kB 1.0 MB/s eta 0:00:00
[20:27:54+0000] Collecting argon2-cffi-bindings
[20:27:54+0000]   Downloading argon2_cffi_bindings-21.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (86 kB)
[20:27:54+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.2/86.2 kB 1.5 MB/s eta 0:00:00
[20:27:54+0000] Collecting async-timeout>=4.0.2
[20:27:54+0000]   Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
[20:27:55+0000] Collecting asgiref<4,>=3.4.1
[20:27:55+0000]   Downloading asgiref-3.6.0-py3-none-any.whl (23 kB)
[20:27:55+0000] Collecting sqlparse>=0.2.2
[20:27:55+0000]   Downloading sqlparse-0.4.3-py3-none-any.whl (42 kB)
[20:27:55+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 kB 617.1 kB/s eta 0:00:00
[20:27:55+0000] Collecting python3-openid>=3.0.8
[20:27:55+0000]   Downloading python3_openid-3.2.0-py3-none-any.whl (133 kB)
[20:27:55+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.7/133.7 kB 2.6 MB/s eta 0:00:00
[20:27:55+0000] Collecting requests-oauthlib>=0.3.0
[20:27:55+0000]   Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
[20:27:56+0000] Collecting requests
[20:27:56+0000]   Downloading requests-2.28.1-py3-none-any.whl (62 kB)
[20:27:56+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━��━━━━━━━ 62.8/62.8 kB 1.1 MB/s eta 0:00:00
[20:27:56+0000] Collecting pyjwt[crypto]>=1.7
[20:27:56+0000]   Downloading PyJWT-2.6.0-py3-none-any.whl (20 kB)
[20:27:56+0000] Requirement already satisfied: setuptools>=3.0 in ./antenv/lib/python3.10/site-packages (from gunicorn==20.1.0->-r requirements/production.txt (line 5)) (65.5.0)
[20:27:56+0000] Collecting azure-storage-blob>=12.0.0
[20:27:56+0000]   Downloading azure_storage_blob-12.14.1-py3-none-any.whl (383 kB)
[20:27:56+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 383.2/383.2 kB 3.2 MB/s eta 0:00:00
[20:27:57+0000] Collecting azure-core<2.0.0,>=1.24.2
[20:27:57+0000]   Downloading azure_core-1.26.1-py3-none-any.whl (172 kB)
[20:27:57+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.6/172.6 kB 2.8 MB/s eta 0:00:00
[20:27:58+0000] Collecting cryptography>=2.1.4
[20:27:58+0000]   Downloading cryptography-39.0.0-cp36-abi3-manylinux_2_28_x86_64.whl (4.2 MB)
[20:27:58+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.2/4.2 MB 11.6 MB/s eta 0:00:00
[20:27:59+0000] Collecting msrest>=0.7.1
[20:27:59+0000]   Downloading msrest-0.7.1-py3-none-any.whl (85 kB)
[20:27:59+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.4/85.4 kB 423.2 kB/s eta 0:00:00
[20:27:59+0000] Collecting defusedxml
[20:27:59+0000]   Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
[20:27:59+0000] Collecting charset-normalizer<3,>=2
[20:27:59+0000]   Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
[20:28:00+0000] Collecting certifi>=2017.4.17
[20:28:00+0000]   Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
[20:28:00+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━��━━━━━━ 155.3/155.3 kB 1.8 MB/s eta 0:00:00
[20:28:00+0000] Collecting idna<4,>=2.5
[20:28:00+0000]   Downloading idna-3.4-py3-none-any.whl (61 kB)
[20:28:00+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 770.9 kB/s eta 0:00:00
[20:28:00+0000] Collecting urllib3<1.27,>=1.21.1
[20:28:00+0000]   Downloading urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
[20:28:00+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 2.4 MB/s eta 0:00:00
[20:28:00+0000] Collecting oauthlib>=3.0.0
[20:28:00+0000]   Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
[20:28:01+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.7/151.7 kB 2.8 MB/s eta 0:00:00
[20:28:02+0000] Collecting cffi>=1.0.1
[20:28:02+0000]   Downloading cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
[20:28:02+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 441.8/441.8 kB 3.5 MB/s eta 0:00:00
[20:28:02+0000] Collecting typing-extensions>=4.0.1
[20:28:02+0000]   Downloading typing_extensions-4.4.0-py3-none-any.whl (26 kB)
[20:28:02+0000] Collecting six>=1.11.0
[20:28:02+0000]   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
[20:28:03+0000] Collecting pycparser
[20:28:03+0000]   Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
[20:28:03+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 1.9 MB/s eta 0:00:00
[20:28:04+0000] Collecting isodate>=0.6.0
[20:28:04+0000]   Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)
[20:28:04+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.7/41.7 kB 481.8 kB/s eta 0:00:00
[20:28:05+0000] Building wheels for collected packages: django-allauth, psycopg2
[20:28:05+0000]   Building wheel for django-allauth (setup.py): started
[20:28:13+0000]   Building wheel for django-allauth (setup.py): finished with status 'done'
[20:28:13+0000]   Created wheel for django-allauth: filename=django_allauth-0.51.0-py3-none-any.whl size=1036033 sha256=de2d8572ae498ddb6bb7aa6a3e6845b1dab6415be9e9ffc5dac524cdb3397b73
[20:28:13+0000]   Stored in directory: /usr/local/share/pip-cache/wheels/6f/17/ae/0ed43373dc265af588fbf1b2d9bdcb8745e947124849921b0f
[20:28:13+0000]   Building wheel for psycopg2 (setup.py): started
[20:28:15+0000]   Building wheel for psycopg2 (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      /tmp/8daedc8d95426fd/antenv/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/psycopg
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130007 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/8daedc8d95426fd/antenv/include -I/opt/python/3.10.9/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-310/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
         35 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/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: Failed building wheel for psycopg2
[20:28:15+0000]   Running setup.py clean for psycopg2
[20:28:16+0000] Successfully built django-allauth
[20:28:16+0000] Failed to build psycopg2
[20:28:17+0000] Installing collected packages: text-unidecode, pytz, whitenoise, urllib3, typing-extensions, sqlparse, six, python-slugify, pyjwt, pycparser, psycopg2, Pillow, oauthlib, idna, hiredis, gunicorn, django-environ, django-crispy-forms, defusedxml, charset-normalizer, certifi, async-timeout, asgiref, requests, redis, python3-openid, isodate, django, cffi, requests-oauthlib, django-storages, django-redis, django-model-utils, django-anymail, cryptography, crispy-bootstrap5, azure-core, argon2-cffi-bindings, msrest, argon2-cffi, django-allauth, azure-storage-blob
[20:28:20+0000]   Running setup.py install for psycopg2: started
[20:28:21+0000]   Running setup.py install for psycopg2: finished with status 'error'
  error: subprocess-exited-with-error
  
  × Running setup.py install for psycopg2 did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      /tmp/8daedc8d95426fd/antenv/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running install
      /tmp/8daedc8d95426fd/antenv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/psycopg
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130007 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/8daedc8d95426fd/antenv/include -I/opt/python/3.10.9/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-310/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
         35 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/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.
╰─> psycopg2

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
"2023-01-03 20:28:23"|ERROR|[20:27:42+0000] Collecting pytz==2022.7
[20:27:42+0000]   Downloading pytz-2022.7-py2.py3-none-any.whl (499 kB)
[20:27:42+0000]      ━━━━━━━��━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 kB 4.4 MB/s eta 0:00:00
[20:27:42+0000] Collecting python-slugify==7.0.0
[20:27:42+0000]   Downloading python_slugify-7.0.0-py2.py3-none-any.whl (9.4 kB)
[20:27:44+0000] Collecting Pillow==9.3.0
[20:27:44+0000]   Downloading Pillow-9.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.3 MB)
[20:27:44+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 13.6 MB/s eta 0:00:00
[20:27:44+0000] Collecting argon2-cffi==21.3.0
[20:27:44+0000]   Downloading argon2_cffi-21.3.0-py3-none-any.whl (14 kB)
[20:27:44+0000] Collecting whitenoise==6.2.0
[20:27:44+0000]   Downloading whitenoise-6.2.0-py3-none-any.whl (19 kB)
[20:27:45+0000] Collecting redis==4.4.0
[20:27:45+0000]   Downloading redis-4.4.0-py3-none-any.whl (236 kB)
[20:27:45+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 236.4/236.4 kB 3.6 MB/s eta 0:00:00
[20:27:45+0000] Collecting hiredis==2.1.0
[20:27:45+0000]   Downloading hiredis-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (83 kB)
[20:27:45+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.5/83.5 kB 1.4 MB/s eta 0:00:00
[20:27:46+0000] Collecting django==4.0.8
[20:27:46+0000]   Downloading Django-4.0.8-py3-none-any.whl (8.0 MB)
[20:27:46+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.0/8.0 MB 17.5 MB/s eta 0:00:00
[20:27:47+0000] Collecting django-environ==0.9.0
[20:27:47+0000]   Downloading django_environ-0.9.0-py2.py3-none-any.whl (17 kB)
[20:27:47+0000] Collecting django-model-utils==4.3.1
[20:27:47+0000]   Downloading django_model_utils-4.3.1-py3-none-any.whl (36 kB)
[20:27:47+0000] Collecting django-allauth==0.51.0
[20:27:47+0000]   Downloading django-allauth-0.51.0.tar.gz (709 kB)
[20:27:47+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 709.6/709.6 kB 9.6 MB/s eta 0:00:00
[20:27:48+0000]   Preparing metadata (setup.py): started
[20:27:50+0000]   Preparing metadata (setup.py): finished with status 'done'
[20:27:50+0000] Collecting django-crispy-forms==1.14.0
[20:27:50+0000]   Downloading django_crispy_forms-1.14.0-py3-none-any.whl (133 kB)
[20:27:50+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.3/133.3 kB 2.1 MB/s eta 0:00:00
[20:27:50+0000] Collecting crispy-bootstrap5==0.7
[20:27:50+0000]   Downloading crispy_bootstrap5-0.7-py3-none-any.whl (22 kB)
[20:27:50+0000] Collecting django-redis==5.2.0
[20:27:50+0000]   Downloading django_redis-5.2.0-py3-none-any.whl (30 kB)
[20:27:51+0000] Collecting gunicorn==20.1.0
[20:27:51+0000]   Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
[20:27:51+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.5/79.5 kB 1.4 MB/s eta 0:00:00
[20:27:51+0000] Collecting psycopg2==2.9.5
[20:27:51+0000]   Downloading psycopg2-2.9.5.tar.gz (384 kB)
[20:27:51+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 384.3/384.3 kB 5.9 MB/s eta 0:00:00
[20:27:51+0000]   Preparing metadata (setup.py): started
[20:27:53+0000]   Preparing metadata (setup.py): finished with status 'done'
[20:27:53+0000] Collecting django-storages[azure]==1.13.1
[20:27:53+0000]   Downloading django_storages-1.13.1-py3-none-any.whl (46 kB)
[20:27:53+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.2/46.2 kB 464.3 kB/s eta 0:00:00
[20:27:53+0000] Collecting django-anymail==9.0
[20:27:53+0000]   Downloading django_anymail-9.0-py3-none-any.whl (101 kB)
[20:27:53+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.2/101.2 kB 2.1 MB/s eta 0:00:00
[20:27:54+0000] Collecting text-unidecode>=1.3
[20:27:54+0000]   Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
[20:27:54+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.2/78.2 kB 1.0 MB/s eta 0:00:00
[20:27:54+0000] Collecting argon2-cffi-bindings
[20:27:54+0000]   Downloading argon2_cffi_bindings-21.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (86 kB)
[20:27:54+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.2/86.2 kB 1.5 MB/s eta 0:00:00
[20:27:54+0000] Collecting async-timeout>=4.0.2
[20:27:54+0000]   Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
[20:27:55+0000] Collecting asgiref<4,>=3.4.1
[20:27:55+0000]   Downloading asgiref-3.6.0-py3-none-any.whl (23 kB)
[20:27:55+0000] Collecting sqlparse>=0.2.2
[20:27:55+0000]   Downloading sqlparse-0.4.3-py3-none-any.whl (42 kB)
[20:27:55+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 kB 617.1 kB/s eta 0:00:00
[20:27:55+0000] Collecting python3-openid>=3.0.8
[20:27:55+0000]   Downloading python3_openid-3.2.0-py3-none-any.whl (133 kB)
[20:27:55+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.7/133.7 kB 2.6 MB/s eta 0:00:00
[20:27:55+0000] Collecting requests-oauthlib>=0.3.0
[20:27:55+0000]   Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
[20:27:56+0000] Collecting requests
[20:27:56+0000]   Downloading requests-2.28.1-py3-none-any.whl (62 kB)
[20:27:56+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 1.1 MB/s eta 0:00:00
[20:27:56+0000] Collecting pyjwt[crypto]>=1.7
[20:27:56+0000]   Downloading PyJWT-2.6.0-py3-none-any.whl (20 kB)
[20:27:56+0000] Requirement already satisfied: setuptools>=3.0 in ./antenv/lib/python3.10/site-packages (from gunicorn==20.1.0->-r requirements/production.txt (line 5)) (65.5.0)
[20:27:56+0000] Collecting azure-storage-blob>=12.0.0
[20:27:56+0000]   Downloading azure_storage_blob-12.14.1-py3-none-any.whl (383 kB)
[20:27:56+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 383.2/383.2 kB 3.2 MB/s eta 0:00:00
[20:27:57+0000] Collecting azure-core<2.0.0,>=1.24.2
[20:27:57+0000]   Downloading azure_core-1.26.1-py3-none-any.whl (172 kB)
[20:27:57+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.6/172.6 kB 2.8 MB/s eta 0:00:00
[20:27:58+0000] Collecting cryptography>=2.1.4
[20:27:58+0000]   Downloading cryptography-39.0.0-cp36-abi3-manylinux_2_28_x86_64.whl (4.2 MB)
[20:27:58+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.2/4.2 MB 11.6 MB/s eta 0:00:00
[20:27:59+0000] Collecting msrest>=0.7.1
[20:27:59+0000]   Downloading msrest-0.7.1-py3-none-any.whl (85 kB)
[20:27:59+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.4/85.4 kB 423.2 kB/s eta 0:00:00
[20:27:59+0000] Collecting defusedxml
[20:27:59+0000]   Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
[20:27:59+0000] Collecting charset-normalizer<3,>=2
[20:27:59+0000]   Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
[20:28:00+0000] Collecting certifi>=2017.4.17
[20:28:00+0000]   Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
[20:28:00+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 1.8 MB/s eta 0:00:00
[20:28:00+0000] Collecting idna<4,>=2.5
[20:28:00+0000]   Downloading idna-3.4-py3-none-any.whl (61 kB)
[20:28:00+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 770.9 kB/s eta 0:00:00
[20:28:00+0000] Collecting urllib3<1.27,>=1.21.1
[20:28:00+0000]   Downloading urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
[20:28:00+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 2.4 MB/s eta 0:00:00
[20:28:00+0000] Collecting oauthlib>=3.0.0
[20:28:00+0000]   Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
[20:28:01+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.7/151.7 kB 2.8 MB/s eta 0:00:00
[20:28:02+0000] Collecting cffi>=1.0.1
[20:28:02+0000]   Downloading cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
[20:28:02+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 441.8/441.8 kB 3.5 MB/s eta 0:00:00
[20:28:02+0000] Collecting typing-extensions>=4.0.1
[20:28:02+0000]   Downloading typing_extensions-4.4.0-py3-none-any.whl (26 kB)
[20:28:02+0000] Collecting six>=1.11.0
[20:28:02+0000]   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
[20:28:03+0000] Collecting pycparser
[20:28:03+0000]   Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
[20:28:03+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 1.9 MB/s eta 0:00:00
[20:28:04+0000] Collecting isodate>=0.6.0
[20:28:04+0000]   Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)
[20:28:04+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.7/41.7 kB 481.8 kB/s eta 0:00:00
[20:28:05+0000] Building wheels for collected packages: django-allauth, psycopg2
[20:28:05+0000]   Building wheel for django-allauth (setup.py): started
[20:28:13+0000]   Building wheel for django-allauth (setup.py): finished with status 'done'
[20:28:13+0000]   Created wheel for django-allauth: filename=django_allauth-0.51.0-py3-none-any.whl size=1036033 sha256=de2d8572ae498ddb6bb7aa6a3e6845b1dab6415be9e9ffc5dac524cdb3397b73
[20:28:13+0000]   Stored in directory: /usr/local/share/pip-cache/wheels/6f/17/ae/0ed43373dc265af588fbf1b2d9bdcb8745e947124849921b0f
[20:28:13+0000]   Building wheel for psycopg2 (setup.py): started
[20:28:15+0000]   Building wheel for psycopg2 (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      /tmp/8daedc8d95426fd/antenv/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/psycopg
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130007 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/8daedc8d95426fd/antenv/include -I/opt/python/3.10.9/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-310/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
         35 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/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: Failed building wheel for psycopg2
[20:28:15+0000]   Running setup.py clean for psycopg2
[20:28:16+0000] Successfully built django-allauth
[20:28:16+0000] Failed to build psycopg2
[20:28:17+0000] Installing collected packages: text-unidecode, pytz, whitenoise, urllib3, typing-extensions, sqlparse, six, python-slugify, pyjwt, pycparser, psycopg2, Pillow, oauthlib, idna, hiredis, gunicorn, django-environ, django-crispy-forms, defusedxml, charset-normalizer, certifi, async-timeout, asgiref, requests, redis, python3-openid, isodate, django, cffi, requests-oauthlib, django-storages, django-redis, django-model-utils, django-anymail, cryptography, crispy-bootstrap5, azure-core, argon2-cffi-bindings, msrest, argon2-cffi, django-allauth, azure-storage-blob
[20:28:20+0000]   Running setup.py install for psycopg2: started
[20:28:21+0000]   Running setup.py install for psycopg2: finished with status 'error'
  error: subprocess-exited-with-error
  
  × Running setup.py install for psycopg2 did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      /tmp/8daedc8d95426fd/antenv/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running install
      /tmp/8daedc8d95426fd/antenv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-310/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/psycopg
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC "-DPSYCOPG_VERSION=2.9.5 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130007 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/8daedc8d95426fd/antenv/include -I/opt/python/3.10.9/include/python3.10 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-310/psycopg/adapter_asis.o -Wdeclaration-after-statement
      In file included from psycopg/adapter_asis.c:28:
      ./psycopg/psycopg.h:35:10: fatal error: Python.h: No such file or directory
         35 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      
      It appears you are missing some prerequisite to build the package from source.
      
      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      error: command '/usr/bin/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.
╰─> psycopg2

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure. | Exit code: 1 | Please review your requirements.txt | More information: https://aka.ms/troubleshoot-python
\n/bin/bash -c "oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.10 -p virtualenv_name=antenv --log-file /tmp/build-debug.log  -i /tmp/8daedc8d95426fd --compress-destination-dir | tee /tmp/oryx-build.log ; exit $PIPESTATUS "

That's with the repo at this state:

https://github.com/pamelafox/cookiecutter-django-output/tree/6f41d160cf51f628986967d9994531fad758cffd

And running 'azd up' and check deployment center logs after.

@shurd
Copy link

shurd commented Jan 4, 2023

I am seeing this same 'Python.h' error as well. It looks like my last successful build used python 3.10.8, and builds with version 3.10.9 are failing. I had this problem with the "hiredis" package until I upgraded it from version 2.0.0 to 2.1.0 (which caused it to use a wheel), and I was seeing this with psycopg2. I downgraded my app to python 3.9 for the time being and it works.

It looks like my last few successful builds in 3.10.8 were using a cached wheel for this package. Now, it is trying to use the source distribution.

@pamelafox
Copy link
Member

As a workaround for now, I am using psycopg2-binary, which so far seems to work in terms of getting past requirements installation, but I haven't tested DB functionality yet.

@ibejoeb
Copy link

ibejoeb commented Jan 6, 2023

builds with version 3.10.9 are failing

I am seeing the same with 3.10.9 as of yesterday, and I have not changed the version python, psycopg2, or anything else.

@gabriel-abn
Copy link

Well, I'm having this exactly error but using Python 3.11.1 Azure App Service and using psycopg2-binary 2.9.5.

ModuleNotFoundError: No module named 'psycopg2._psycopg'

I've been struggling to make my app run without any problems 'cause I have other apps running normally, but in Python3.9, so I found some issues that I may be interesting:

  • My App Service is using Debian 11 BullsEye as OS, and I'm using Ubuntu 22.04, so my only possible solution was using a Docker Image to "recreate" my environment.
  • Locally, using a Python 3.11.1 Virtual Environment, I was running my app with no issues.
  • In Azure DevOps, I'm using a Self-Hosted Agent, which is another computer of mine with Ubuntu 20.04, and building my app in Python 3.11.1 version.
  • In the same hand, I'm able to deploy directly to my app service using Azure Tools extension in VS Code. With that, I had set SCM_DO_BUILD_DURING_DEPLOYMENT=true in a .deployment config file.

So with all this in hands, I have two options:

  • Use Azure DevOps Pipelines to build and deploy my app
  • Deploy directly using Azure Tools extension

Taking both ways, I was still getting the same error above, so I had tried to downgrade my psycopg2-binary. And after downgrading my libpq5 and installing python-dev to my OS, I was still getting no errors using a local virtual environment.

So, my only way was to Dockerize my application and try to mirror all App Service softwares version. And using the same configs in my container I found out that using Debian 11, Python 3.11.1 and psycopg2-binary 2.9.5 you still having this same error.

I had done an image with the same Debian and psycopg2-binary versions, but with Python 3.9, and it worked just fine.

So just to be clear: I have almost no knowledge on module files and configuration stuff so I'm not sure about nothing, but in my experience the problem was the Python version. I downgraded to 3.9 and had no issues.

@ibejoeb
Copy link

ibejoeb commented Jan 8, 2023

In my case, I'm deploying to debian bullseye with python 3.10.4. The invocation of gcc seems to include the wrong path for the python headers when building psycopg2: -I/opt/python/3.10.9/include/python3.10. That doesn't exist. But I have this:

# ls -l /opt/python/
total 4
lrwxrwxrwx  1 root root    4 Aug 25 18:08 3 -> 3.10
lrwxrwxrwx  1 root root    6 Aug 25 18:08 3.10 -> 3.10.4
drwxr-xr-x 13 root root 4096 Aug  1 20:44 3.10.4

So am I expected to adjust ccflags somehow? I'm not even entirely sure how the includes are being set. I gather from #1330 that Oryx uses fixed internal versions of python, but what I am I supposed to do to get it to jibe with my deployment target? I suppose I could manually symlink a fake 3.10.9 path, but that's awful.

It seems like if I can just set the right path, everything will be fine.

@william-msft
Copy link
Contributor

Hi Team,

May we try setting the following environment variable:
export DYNAMIC_INSTALL_ROOT_DIR=/opt

Oryx currently downloads SDKs into a /tmp directory when dynamically installing new SDKs. However, since gcc is expecting python to be installed under /opt/python/3.10.9/ and since we install under /tmp the failure occurs. We are working on getting a solution for this, so no additional configuration is needed. But for now please try the export command above. Thank you for your patience.

@JDubAscend
Copy link

JDubAscend commented Jan 18, 2023

I tried setting DYNAMIC_INSTALL_ROOT_DIR=/opt per the workaround, but it appears that Oryx can't write to that directory.

Command: oryx build /home/site/repository -o /home/site/wwwroot --platform python --platform-version 3.10 -p virtualenv_name=antenv --log-file /tmp/build-debug.log -i /tmp/8daf98c5b42b2e1 --compress-destination-dir | tee /tmp/oryx-build.log

Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx

You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20220825.1, Commit: 2403244, ReleaseTagName: 20220825.1

Build Operation ID: |E98U9ciosf0=.8d64ca47_

Repository Commit : 9118a7f00b443b168d0ba10a7becfa2c777b8947

Detecting platforms...

Detected following platforms:

python: 3.10.9

Version '3.10.9' of platform 'python' is not installed. Generating script to install it...

Using intermediate directory '/tmp/8daf98c5b42b2e1'.

Copying files to the intermediate directory...

Done in 2 sec(s).

Source directory : /tmp/8daf98c5b42b2e1

Destination directory: /home/site/wwwroot

Downloading and extracting 'python' version '3.10.9' to '/opt/python/3.10.9'...

mkdir: cannot create directory ‘/opt/python’: Permission denied

mkdir: cannot create directory ‘/opt/python’: Permission denied\n/bin/bash -c "oryx build /home/site/repository -o /home/site/wwwroot --platform python --platform-version 3.10 -p virtualenv_name=antenv --log-file /tmp/build-debug.log -i /tmp/8daf98c5b42b2e1 --compress-destination-dir | tee /tmp/oryx-build.log ; exit $PIPESTATUS "

@tonybaloney
Copy link
Contributor

There are 2 separate issues here.

  1. pyschopg2 is not loading because Gunicorn is being launched under Python 3.9 and it can't find the shared library that was installed under Python 3.11
  2. Source extension modules are not compiling (Python.h is not found) because pip/setuptools doesn't know where the headers are

For 1, there is a more permanent fix, but to unblock anyone here is a workaround:

  1. Add gunicorn to your requirements.txt
  2. Set a custom startup command that launches gunicorn by running Python 3.11 (or Python 3.10 if that's the version you're using.). You can do this in the portal under configuration->general settings->stack settings
    Here is an example, you'll need to replace project.wsgi with the name of your Django or flask WSGI entry point
python3.11 -m gunicorn --workers 2 --threads 4 --timeout 60 --access-logfile \
    '-' --error-logfile '-' --bind=0.0.0.0:8000 \
     --chdir=/home/site/wwwroot project.wsgi -c gunicorn.conf.py

For 2, you need to use a wheel distribution where available for now

@william-msft
Copy link
Contributor

Hi Team, the Python.h , issue 2, has been fixed and released in the new version of Oryx.

Issue 1 will be rolled out by @waliMSFT.

Thank you for your patience.

@rolandsoh96
Copy link

Well, I'm having this exactly error but using Python 3.11.1 Azure App Service and using psycopg2-binary 2.9.5.

ModuleNotFoundError: No module named 'psycopg2._psycopg'

I've been struggling to make my app run without any problems 'cause I have other apps running normally, but in Python3.9, so I found some issues that I may be interesting:

  • My App Service is using Debian 11 BullsEye as OS, and I'm using Ubuntu 22.04, so my only possible solution was using a Docker Image to "recreate" my environment.
  • Locally, using a Python 3.11.1 Virtual Environment, I was running my app with no issues.
  • In Azure DevOps, I'm using a Self-Hosted Agent, which is another computer of mine with Ubuntu 20.04, and building my app in Python 3.11.1 version.
  • In the same hand, I'm able to deploy directly to my app service using Azure Tools extension in VS Code. With that, I had set SCM_DO_BUILD_DURING_DEPLOYMENT=true in a .deployment config file.

So with all this in hands, I have two options:

  • Use Azure DevOps Pipelines to build and deploy my app
  • Deploy directly using Azure Tools extension

Taking both ways, I was still getting the same error above, so I had tried to downgrade my psycopg2-binary. And after downgrading my libpq5 and installing python-dev to my OS, I was still getting no errors using a local virtual environment.

So, my only way was to Dockerize my application and try to mirror all App Service softwares version. And using the same configs in my container I found out that using Debian 11, Python 3.11.1 and psycopg2-binary 2.9.5 you still having this same error.

I had done an image with the same Debian and psycopg2-binary versions, but with Python 3.9, and it worked just fine.

So just to be clear: I have almost no knowledge on module files and configuration stuff so I'm not sure about nothing, but in my experience the problem was the Python version. I downgraded to 3.9 and had no issues.

I usually don't read comments without any "good emojis". But I was so desperated that I have to read this. Your comment saved my life.

I was also trying to deploy to Azure Web App, and same problem occured.
I downgraded from Python 3.10 to Python 3.9, and it worked!

Thanks a lot!

@tute123456
Copy link

➜ pip install ping
Collecting ping
Using cached ping-0.2.tar.gz (10 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\morozco.DIGITAL\AppData\Local\Temp\pip-install-3mvcmznh\ping_a3d9d30cb3c1478da19fbd3b1eadcebe\setup.py", line 23, in
from ping import version
File "C:\Users\morozco.DIGITAL\AppData\Local\Temp\pip-install-3mvcmznh\ping_a3d9d30cb3c1478da19fbd3b1eadcebe\ping.py", line 196
except socket.error, (errno, msg):
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

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

@ahsanMuh
Copy link

You can use the binary version. Simpy install it using the following command:
pip install psycopg2

@aamir0011
Copy link

You can use the binary version. Simpy install it using the following command: pip install psycopg2

Thankyou so much for saving my life. My boss was torturing me everday for this issue. They also want me to give back my salary of all those 2 years and also want to hold my property and cars. Can i have your patreon i want to support you work. Thankyou i will also request my boss to make you the teamlead in our california branch.

@simonjj
Copy link

simonjj commented Jan 12, 2024

This issue seems resolved. Will be closing this issue. If this is still relevant and impacting you please open a new issue and link back to this issue for reference.

@simonjj simonjj closed this as completed Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests