TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Install Postgres with Pip in Virtualenv

2 pointsby fforflo26 days ago
Hi HN,<p>I frequently work with Postgres &amp; Python and toggle between multiple versions of each. In Postgres, I keep a separate installation for each project, but I don&#x27;t like git submodules and don&#x27;t want to ship &quot;pg_build.sh&quot; scripts with the source code.<p>So, I built pgvenv as a Python shell package that, when installed, triggers a from-source installation of Postgres and installs it at venv&#x27;s prefix. Could become handy at times I think.<p>You can roughly use it like this.<p>python3.11 -m venv .&#x2F;venv<p>source .&#x2F;venv&#x2F;bin&#x2F;activate<p>PGVERSION=17.4 pip install pgvenv --force-reinstall --no-cache-dir<p>initdb .&#x2F;pgdata<p>postgres -D .&#x2F;pgdata<p>Many things can go wrong with this in production, so should probably use for development only.

no comments

no comments