Collecting psycopg-c==3.1.18 ..... Preparing metadata (pyproject.toml) did not run successfully. #9600

Closed
opened 2025-12-29 21:19:31 +01:00 by adam · 10 comments
Owner

Originally created by @litebito on GitHub (May 7, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.7

Python Version

3.10

Steps to Reproduce

Trying to upgrade from v3.7.7 to v3.7.8:
cd /opt/netbox
sudo git checkout master
sudo git -c http.sslVerify=false pull origin master
sudo ./upgrade.sh

Expected Behavior

Upgrade script completes without errors

Observed Behavior

Collecting psycopg-c==3.1.18 (from psycopg[c,pool]==3.1.18->-r requirements.txt (line 28))
  Using cached psycopg-c-3.1.18.tar.gz (561 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      running dist_info
      creating /tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info
      writing /tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info/dependency_links.txt
      writing top-level names to /tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info/top_level.txt
      writing manifest file '/tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info/SOURCES.txt'
      couldn't run 'pg_config' --includedir: [Errno 2] No such file or directory: 'pg_config'
      error: [Errno 2] No such file or directory: 'pg_config'
      [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.

Originally created by @litebito on GitHub (May 7, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.7 ### Python Version 3.10 ### Steps to Reproduce Trying to upgrade from v3.7.7 to v3.7.8: cd /opt/netbox sudo git checkout master sudo git -c http.sslVerify=false pull origin master sudo ./upgrade.sh ### Expected Behavior Upgrade script completes without errors ### Observed Behavior ``` Collecting psycopg-c==3.1.18 (from psycopg[c,pool]==3.1.18->-r requirements.txt (line 28)) Using cached psycopg-c-3.1.18.tar.gz (561 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [8 lines of output] running dist_info creating /tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info writing /tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info/PKG-INFO writing dependency_links to /tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info/dependency_links.txt writing top-level names to /tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info/top_level.txt writing manifest file '/tmp/pip-modern-metadata-vzgodwwm/psycopg_c.egg-info/SOURCES.txt' couldn't run 'pg_config' --includedir: [Errno 2] No such file or directory: 'pg_config' error: [Errno 2] No such file or directory: 'pg_config' [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. ```
adam closed this issue 2025-12-29 21:19:31 +01:00
Author
Owner

@litebito commented on GitHub (May 7, 2024):

Content of requirements.txt:

# cat requirements.txt
Django==5.0.5
django-cors-headers==4.3.1
django-debug-toolbar==4.3.0
django-filter==24.2
django-htmx==1.17.3
django-graphiql-debug-toolbar==0.2.0
django-mptt==0.16.0
django-pglocks==1.0.4
django-prometheus==2.3.1
django-redis==5.4.0
django-rich==1.8.0
django-rq==2.10.2
django-taggit==5.0.1
django-tables2==2.7.0
django-timezone-field==6.1.0
djangorestframework==3.15.1
drf-spectacular==0.27.2
drf-spectacular-sidecar==2024.5.1
feedparser==6.0.11
gunicorn==22.0.0
Jinja2==3.1.4
Markdown==3.6
mkdocs-material==9.5.21
mkdocstrings[python-legacy]==0.25.1
netaddr==1.2.1
nh3==0.2.17
Pillow==10.3.0
psycopg[c,pool]==3.1.18
PyYAML==6.0.1
requests==2.31.0
social-auth-app-django==5.4.1
social-auth-core==4.5.4
strawberry-graphql==0.227.3
strawberry-graphql-django==0.39.2
svgwrite==1.4.3
tablib==3.6.1
tzdata==2024.1
@litebito commented on GitHub (May 7, 2024): Content of requirements.txt: ``` # cat requirements.txt Django==5.0.5 django-cors-headers==4.3.1 django-debug-toolbar==4.3.0 django-filter==24.2 django-htmx==1.17.3 django-graphiql-debug-toolbar==0.2.0 django-mptt==0.16.0 django-pglocks==1.0.4 django-prometheus==2.3.1 django-redis==5.4.0 django-rich==1.8.0 django-rq==2.10.2 django-taggit==5.0.1 django-tables2==2.7.0 django-timezone-field==6.1.0 djangorestframework==3.15.1 drf-spectacular==0.27.2 drf-spectacular-sidecar==2024.5.1 feedparser==6.0.11 gunicorn==22.0.0 Jinja2==3.1.4 Markdown==3.6 mkdocs-material==9.5.21 mkdocstrings[python-legacy]==0.25.1 netaddr==1.2.1 nh3==0.2.17 Pillow==10.3.0 psycopg[c,pool]==3.1.18 PyYAML==6.0.1 requests==2.31.0 social-auth-app-django==5.4.1 social-auth-core==4.5.4 strawberry-graphql==0.227.3 strawberry-graphql-django==0.39.2 svgwrite==1.4.3 tablib==3.6.1 tzdata==2024.1 ```
Author
Owner

@a084ed22 commented on GitHub (May 7, 2024):

Do you have libpq-dev or whatever is the package corresponding to it for your distribution installed?

Note also that you're upgrading to master, not to v3.7.8

@a084ed22 commented on GitHub (May 7, 2024): Do you have libpq-dev or whatever is the package corresponding to it for your distribution installed? Note also that you're upgrading to master, not to v3.7.8
Author
Owner

@litebito commented on GitHub (May 7, 2024):

That explains all the other errors I got after updating requirements.txt.
I wanted to upgrade to v3.7.8, not yet v4 (plugins we use are not v4 ready)
how can I go (back) to v3.7.8 with git?
the instructions in the Netbox documentation to checkout and install an older version to not work

@litebito commented on GitHub (May 7, 2024): That explains all the other errors I got after updating requirements.txt. I wanted to upgrade to v3.7.8, not yet v4 (plugins we use are not v4 ready) how can I go (back) to v3.7.8 with git? the instructions in the Netbox documentation to checkout and install an older version to not work
Author
Owner

@a084ed22 commented on GitHub (May 7, 2024):

git checkout v3.7.8?

@a084ed22 commented on GitHub (May 7, 2024): `git checkout v3.7.8`?
Author
Owner

@litebito commented on GitHub (May 7, 2024):

Exactly what I thought it should be, but ...

git checkout v3.7.8
error: pathspec 'v3.7.8' did not match any file(s) known to git

I'm sure I'm missing an obvious step, but which one...

@litebito commented on GitHub (May 7, 2024): Exactly what I thought it should be, but ... ``` git checkout v3.7.8 error: pathspec 'v3.7.8' did not match any file(s) known to git ``` I'm sure I'm missing an obvious step, but which one...
Author
Owner

@a084ed22 commented on GitHub (May 7, 2024):

You may need to issue git fetch --tags first

@a084ed22 commented on GitHub (May 7, 2024): You may need to issue `git fetch --tags` first
Author
Owner

@litebito commented on GitHub (May 7, 2024):

Super, that indeed was the missing link for me....

After that I could do

git checkout v3.7.8
Note: switching to 'v3.7.8'.

and then the upgrade script ran without any issues

Thanks

@litebito commented on GitHub (May 7, 2024): Super, that indeed was the missing link for me.... After that I could do ``` git checkout v3.7.8 Note: switching to 'v3.7.8'. ``` and then the upgrade script ran without any issues Thanks
Author
Owner

@litebito commented on GitHub (May 7, 2024):

Maybe the line "git fetch --tags" can be added to the official documentation?
https://docs.netbox.dev/en/stable/installation/upgrading/
in the block "Checking out an older release"

@litebito commented on GitHub (May 7, 2024): Maybe the line "git fetch --tags" can be added to the official documentation? https://docs.netbox.dev/en/stable/installation/upgrading/ in the block "Checking out an older release"
Author
Owner

@ekrichbaum commented on GitHub (May 7, 2024):

See the previous comment. May or may not be in libpq-dev. On Fedora it is is libpq-devel, etc. so depends on your base distro.

@ekrichbaum commented on GitHub (May 7, 2024): See the previous comment. May or may not be in libpq-dev. On Fedora it is is libpq-devel, etc. so depends on your base distro.
Author
Owner

@litebito commented on GitHub (May 7, 2024):

Base distro is Centos Stream 8, so it would be libpq5-devel

# dnf list  libpq*-devel
Last metadata expiration check: 3:57:06 ago on Mon 06 May 2024 08:28:05 AM CEST.
Available Packages
libpq-devel.i686 13.5-1.el8                                                 appstream
libpq-devel.x86_64 13.5-1.el8                                                 appstream
libpq5-devel.x86_64                                           16.2-42PGDG.rhel8                                          pgdg-common
libpqxx-devel.x86_64                                          1:7.7.5-10.rhel8                                           pgdg-common

For now we'll stay on NetBox v3.7.8 until most of the plugins we use have been adopted for NetBox v4

@litebito commented on GitHub (May 7, 2024): Base distro is Centos Stream 8, so it would be libpq5-devel ``` # dnf list libpq*-devel Last metadata expiration check: 3:57:06 ago on Mon 06 May 2024 08:28:05 AM CEST. Available Packages libpq-devel.i686 13.5-1.el8 appstream libpq-devel.x86_64 13.5-1.el8 appstream libpq5-devel.x86_64 16.2-42PGDG.rhel8 pgdg-common libpqxx-devel.x86_64 1:7.7.5-10.rhel8 pgdg-common ``` For now we'll stay on NetBox v3.7.8 until most of the plugins we use have been adopted for NetBox v4
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9600