u/Schnidi01

Self-compiles into a .exe via its own PyInstaller GUI – that's VenvHub Pro, my Python venv manager GUI app.

Hello Python community,

I'm working on a tool called VenvHub Pro (virtual environment management, packages, VS Code profiles, etc.).

Interestingly, the app includes its own PyInstaller Builder. It's not just an external script, but a full-fledged tab in the GUI. Thanks to it, the app can compile itself into a .exe file.

How it technically works (in short):

In the "Builder" tab, just select the entry point (main.py), set the assets (mandatory folders like ui, core/themes, translations, assets, navod), and hit the BUILD button.

Interestingly, the app runs on PyQt6, but thanks to a "Compatibility Bridge" (MetaPathFinder), it can also run under PySide6. When compiling under PySide6, the builder must manually add hidden imports (PySide6, PySide6.QtCore...) so PyInstaller knows what to package, and also exclude PyQt6 to keep the size down.

It also has an "Auto-Injector" that reads linked local packages and injects them into the final build.

Why I find this interesting:

If the builder can compile such a complex app that uses dynamic UI files and bridged frameworks, it's a solid "dogfooding" test. Plus, the resulting .exe contains all necessary files (including themes and translations) and is fully portable.

"So the question is: Would you like to try it out? If so, I'll drop the GitHub link here, where the entire repository is located, including instructions on how to run it.

Thanks for any feedback! ??"

u/Schnidi01 — 21 hours ago

apt-get autoremove for Python linker packages – finally automatic venv dependency cleanup

Hey everyone,

I'm currently working on this feature – autoremove is already implemented in the local packages linker branch and will soon be part of the official VenvHub Pro release.

During development in virtual environments, I always had one big problem: How to figure out which packages are no longer needed?

Manually going through pip list and trying to uninstall "surely nobody uses this" is a road to hell. That's why I added a feature inspired by Linux APT to my tool VenvHub Pro (Linker branch) – automatic dependency cleanup.

How it works?

The tool tracks which packages you installed explicitly (via pip install, requirements.txt, birth certificate, or venvhub.json). It builds a dependency graph and periodically checks for orphaned packages.

When you run Autoremove, the tool:

  • Goes through all installed packages in the venv.
  • Compares them with the set of explicit roots + their dependency tree.
  • Removes every package that is not explicitly required by any root and was not installed manually outside the system.

What makes this mechanism safe – self-healing mechanism:

If a package is installed but not recorded anywhere (e.g., you manually ran pip install requests in the terminal), the tool automatically adopts it – marks it as explicit so it won't be accidentally removed.

This means autoremove is conservative: it never deletes something you might have installed intentionally.

You can also explicitly "release" a package (e.g., when you remove it from requirements.txt) and the system will then treat it as a candidate for removal.

Why is it useful?

  • Venvs stay lean – no accumulated dependencies from experiments.
  • Safe – adopting manually installed packages prevents accidental deletion.
  • Fully automatic – no manual guessing about what belongs to whom.

This is currently only the Linker branch (local packages) – it works 100%.

u/Schnidi01 — 2 days ago

Would you appreciate APT‑style autoremove for your pip‑managed venvs? (thinking of adding it to my VenvHub Pro)

Hey everyone,

I’m the developer of VenvHub Pro, a desktop tool for managing Python virtual environments. I’ve been working on a feature that brings Linux’s apt-get autoremove mentality to pip – i.e., it keeps your venvs clean by automatically removing orphan packages that were only installed as dependencies but are no longer needed.

Before I polish and release it, I’d love to hear if the community would actually find this valuable.

How it works (TL;DR)

  • Every time you install/uninstall/upgrade a package through the UI or command‑line, VenvHub secretly records which packages were explicitly requested.
  • When a dependency is no longer required by any explicit package (and is not pinned in your requirements.txtvenv_birth_certificate.json, or local package metadata), it gets automatically cleaned up.
  • It also plays nicely with pip’s own resolution – it never removes manually installed tools like pipsetuptools, etc.

Safety nets

  • State file (venvhub_apt_state.json) keeps the explicit list.
  • Before removal, the system checks:
    • 📄 requirements.txt
    • 📜 venv_birth_certificate.json
    • 🔗 local_meta.json (for local package dependencies)
    • 🧠 Self‑healing: if a package is installed but not tracked anywhere, it’s assumed to be intentional and added to the safe list (so it never gets removed by mistake).
  • The whole process runs under a threading lock to avoid race conditions during concurrent operations.

Logical diagram

Here’s the decision logic it follows every time a package action occurs:

https://preview.redd.it/vynaqblejfeh1.png?width=1851&format=png&auto=webp&s=52073d38626319349ecb393327a3a3064bdd0cba

What I’m asking you

  • Would you use such a feature in a venv manager?
  • Do you see any pitfalls I might have overlooked?
  • Is this something you’d trust, or would you prefer manual control?

Any feedback – positive or critical – is super welcome! I want to make sure this adds real value before I invest more time into it.

Thanks! 🙌

reddit.com
u/Schnidi01 — 4 days ago

VenvHub Pro: A custom Python "Linker" that goes beyond code linking—syncing your IDE configs on the fly!

Hi !

We all know pip install -e . (editable installs). It’s the standard for linking local code during development. But for my project, VenvHub Pro, I wanted to take the local dev experience to another level. I created a Local Linker that isn't just a simple file-system pointer—it’s a full-blown IDE-Sync engine.

Why our Linker is unique (compared to the standard workflow):

1. Full Meta-Sync (VS Code Automation):
This is the core value-add. When you link a local package, the system reads its local_meta.json. It doesn’t just make the code importable; it automatically injects custom Tasks and Keybindings directly into your project's .vscode/ folder.

  • Example: Link your "Database" module, and VS Code instantly gains commands like "Flush Cache" or "Run Migrations" defined inside that package. No more manual tasks.json or keybindings.json copy-pasting.

2. Zero Admin Rights / No UAC (Import Hooks):
Instead of creating system-level symlinks or junctions that often require Admin privileges on Windows, we use Python Import Hooks (sys.meta_path). It’s pure Python, lightning-fast, and works securely even on network drives (NAS) without annoying UAC prompts.

3. Smart IntelliSense (Pylance):
The Linker automatically syncs the python.analysis.extraPaths field in your VS Code settings. Your editor sees your local code and provides full autocomplete/IntelliSense immediately, no matter where the source is located on your disk.

4. Smart Portability & Safety (Silent Path Healing):
VenvHub Pro is built for USB-drive workflows and features a "Silent Path Healing" mechanism:

  • If you use Embeddable (portable) Python and your drive letter changes (e.g., E: -> F:), the system instantly heals all paths in the Linker mapping, .pth files, and VS Code settings. Everything just works.
  • However, if you move a System Venv to a different machine where that specific Python installation doesn't exist, VenvHub detects the hardware fingerprint mismatch and safely locks the environment to prevent binary incompatibility and crashes.

5. Recursive Local Dependency Resolution:
If "Package A" requires "Local Package B", the Linker automatically resolves the entire local dependency tree and links all required modules in one click.

Under the Hood:

We use a tiny bootstrap script in site-packages that maps imports via a custom finder in sys.meta_path using JSON mapping. It’s clean, isolated, and designed for maximum portability.

What do you think? Do you stick to plain pip -e for local dev, or would you prefer this kind of deep, automated integration with your editor? Let's discuss!

local_meta.json package A

{
    "name": "My App Core",
    "version": "2.1.0",
    "requires_local": ["my_logger"],
    "requires_pip": [],
    "short_description": "test code"
}

local_meta.json package B

{
    "name": "My Logger",
    "version": "1.0.0",
    "requires_local": [],
    "requires_pip": ["colorama"]
}
u/Schnidi01 — 4 days ago

Python environment cloner: 1:1 including pip -e, embedded vs system Python

What it does:

Clones entire Python environment including editable (-e) packages. Auto-detects Python type and uses different approach.

Embedded Python:

- installs virtualenv into source
- creates clone via virtualenv
- fixes ._pth file
- downgrades setuptools (83→82) for compatibility

System Python:

- uses built-in venv
- no extra steps

Both then:

- install setuptools, wheel
- install all packages
- install editable packages (pip install -e)
- write birth certificate

Video shows both scenarios side by side. Same source env, different strategies. Works on Windows.

Does anyone know of a Windows tool that creates a complete 1:1 copy of a virtual environment, INCLUDING editable packages (pip install -e), without manual intervention?

u/Schnidi01 — 6 days ago

Showcase: Floating Python Widget for Quick Launch (Terminal, Background, CLI)

Hey Pythonistas,

I'd like to show what you can build in Python that's both polished and functional. I've written a complete Python widget for quickly launching projects – it's a floating toolbar that stays on top of my desktop.

It's currently running stable at version 2.5.16, so this isn't just a prototype – it's a full-fledged tool that genuinely saves me time during everyday development.

The widget offers three ways to run a script:

  • Open Terminal: Doesn't start any script – just opens a CMD/PowerShell window with the virtual environment already activated. Perfect when I need to manually run commands, pip install packages, or debug things interactively.
  • Run in Terminal: The classic approach – opens a new window, activates the venv, and runs the script. I can see all logs, print statements, and errors in real time.
  • Run in Background / Silent: The script starts completely invisible – no console window at all. Great for GUI applications (so they don't have an unnecessary black console in the background) or for headless processes that need to run quietly.

What's going on under the hood:

The entire GUI is built on the PyQt6/PySide6 framework. The source code is written 100% for PyQt6, but the application contains a Compatibility Bridge that allows it to run on PySide6 as well – for licensing reasons (LGPL vs GPL).

The bridge works at the import level using the MetaPathFinder technique:

  1. When main.py starts, it detects which library is available in the system.
  2. If PyQt6 is found, the application runs natively.
  3. If PySide6 is found, the bridge injects itself into system memory.
  4. When Python encounters import from PyQt6..., the interceptor steps in, translates the request, and returns the equivalent from PySide6.

The result? The source code stays clean and unified, while the software automatically rewrites all imports, signals, and slots at runtime based on what's currently installed.

Additionally, I'm using:

  • psutil for reliable process management and monitoring
  • Native Windows API calls (via ctypes and pywin32-ctypes) for low-level system integration

Since the primary target platform is Windows, I addressed stability issues that typical Python apps often overlook – especially clean cleanup after termination.

Specifically, I'm using two low-level techniques:

  1. Windows Job Objects – I create a system process container and assign every spawned subprocess to it. If the parent application unexpectedly crashes, Windows automatically terminates all associated processes. No orphaned processes left behind to block ports or consume memory.
  2. Windows Handles – When registering a process, I keep an open system reference (Handle) in memory. As long as it's open, Windows guarantees that the PID won't be recycled and reassigned to another application. This gives me accurate process state detection and eliminates the risk of accidentally terminating a foreign program.

All Handles are internally protected by thread locks and are properly closed on every stop or cleanup – no memory leaks.

In short: The widget is functional, stable, and most importantly – it doesn't leave a mess behind when you close it.

Question for you:
How do you handle launching scripts in different modes? Do you stick with manual terminal commands, or have you also built your own launcher? What features would you appreciate in a tool like this?

u/Schnidi01 — 6 days ago

I built a Python venv manager GUI that handles VS Code integration automatically – is this useful?

"Hello everyone,

with my new Python program I combined venv management with injecting the interpreter into VS Code.

As you can see I have created two venvs – one embed venv 3.14.6 and the second venv with system Python 3.14.2. The program automatically creates .vscode/settings.json and writes paths to the interpreters. When I change the venv in the program, it automatically checks which venv it is and immediately switches the interpreter.

Do you like this kind of integration into a manager?"

u/Schnidi01 — 7 days ago

where python › all versions are detected by VenvHub Pro too

Another small showcase of my python project VenvHub Pro.

I decided to show you how perfectly my application works with system and embed Python.

As you can see in the video, there are up to four different Python paths on my system, and the app automatically finds all of them – without me having to manually enter any paths anywhere.

And if the system Python isn't enough for you, or you don't have it on your system at all, you don't have to install it. Just add an embed Python and VenvHub Pro takes care of everything – it automatically installs pip and virtualenv.

As you also saw in the video, the app automatically creates .vscode/settings.json in your project, so you can switch interpreters instantly directly from VS Code – no manual configuration needed.

It just works exactly the way I needed it to. 🙂

Just curious – do you like it? I'd really appreciate your honest opinion.

u/Schnidi01 — 8 days ago

After months of fighting 'Dependency Hell', I built a GUI that manages Python venvs, works with PyQt6 AND PySide6 (no UAC).

Hey everyone! 👋

I've been working with Python for a while now and finally decided to build my first major project. It was inspired by months of battling dependency conflicts and broken virtual environments on USB drives.

What it does:

  • Centralized Environment Management: Manages all virtual environments in one place (venvs are stored centrally, outside of project folders).
  • Full VS Code Integration: Automatically configures the correct interpreter, syncs local packages (for IntelliSense), and supports isolated profiles (each project gets its own extensions and settings).
  • PyQt6 & PySide6 Compatibility Bridge: Works seamlessly with both, requiring zero code changes.
  • Powered by uv**:** Uses the blazing-fast uv installer (10–100x faster than pip) and can automatically resolve dependency conflicts after bulk updates.
  • Portable Mode: Automatically fixes paths when the drive letter changes (perfect for running off USB drives).
  • Integrated PyInstaller GUI: Automatically bundles your local packages into the build.
  • Two Ways to Work with Local Code:
    • Local Packages (Linker): Dynamically links code between projects without requiring UAC (leverages Python Import Hooks).
    • Editable Packages (pip install -e): Full-fledged library development with automatic dependency management and portability support.
  • No UAC Required to link local packages.

What do you think? Do you like the look and feel? Could you see yourself using something like this on Windows?

📽️ **See it in action:** [How to create a venv in 2 clicks]:
https://www.reddit.com/r/madeinpython/s/lg395T9IuQ
u/Schnidi01 — 8 days ago