move-coop / parsons

A python library of connectors for the progressive community.
https://www.parsonsproject.org/
Other
261 stars 132 forks source link

mention build prereqs for psycopg2 #739

Closed schlich closed 2 years ago

schlich commented 2 years ago

During a fresh dev setup on WSL (Ubuntu) i received an error while trying to install dependencies due to psycopg2's build prerequisites. I added some clarifying documentation, but there may be other/better ways around this error than this PR which is a little bit clutter-y. Feedback from the core team welcome.

Also not sure if this is an error other OSes might run into -- IIRC OSX comes with a lot of these libraries preinstalled.

schlich commented 2 years ago

Hm... weirdly enough i just checked requirements.txt and realize we're not using psycopg2 but using psycopg2-binary as suggested... I wonder why that wasn't recognized? Maybe psycopg2 is a secondary dependency? Here is the error log:

Collecting requests==2.25.1
  Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Collecting petl==1.6.8
  Using cached petl-1.6.8.tar.gz (236 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting boto3==1.17.98
  Using cached boto3-1.17.98-py2.py3-none-any.whl (131 kB)
Collecting boxsdk==2.10.0
  Using cached boxsdk-2.10.0-py2.py3-none-any.whl (128 kB)
Collecting civis==1.14.2
  Using cached civis-1.14.2-py3-none-any.whl (895 kB)
Collecting slackclient==1.3.0
  Using cached slackclient-1.3.0-py2.py3-none-any.whl (18 kB)
Collecting psycopg2-binary==2.8.5
  Using cached psycopg2-binary-2.8.5.tar.gz (381 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      /home/schlich/parsons/.venv/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running egg_info
      creating /tmp/pip-pip-egg-info-_89lvq6w/psycopg2_binary.egg-info
      writing /tmp/pip-pip-egg-info-_89lvq6w/psycopg2_binary.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-pip-egg-info-_89lvq6w/psycopg2_binary.egg-info/dependency_links.txt
      writing top-level names to /tmp/pip-pip-egg-info-_89lvq6w/psycopg2_binary.egg-info/top_level.txt
      writing manifest file '/tmp/pip-pip-egg-info-_89lvq6w/psycopg2_binary.egg-info/SOURCES.txt'

      Error: pg_config executable not found.

      pg_config is required to build psycopg2 from source.  Please add the directory
      containing pg_config to the $PATH or specify the full executable path with the
      option:

          python setup.py build_ext --pg-config /path/to/pg_config build ...

      or with the pg_config option in 'setup.cfg'.

      If you prefer to avoid building psycopg2 from source, please install the PyPI
      'psycopg2-binary' package instead.

      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).

      [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.
shaunagm commented 2 years ago

We're in the middle of a docs transition, and right now this installation guide has the most up to date information. So this page really needs a pointer to the installation guide.

Part of why we're switching to a separate website is to make it easier to update the docs. If you want to be added to the website so you can update things, I'm happy to do that.

schlich commented 2 years ago

Happy to contribute! How are you building/serving the docs? Just sent a slack request, btw. Will close this PR and keep it in mind.

shaunagm commented 2 years ago

Do you mean a request to join the Slack? I thought you were already in there?

The read-the-docs docs get built every time a PR gets merged, but they only go live when a new release is pushed to PyPI. You can get a sneak peak at upcoming docs by looking at the latest option in version control but most people don't know to look.

The new docs website is on pubpub. To join, just create an account on https://www.pubpub.org/ and let me know your username so I can add you to our org.