Skip to main content

Detecte et corrige les chemins absolus casses d'un venv deplace ou renomme.

Project description

venv-relocate

Detects and fixes broken absolute paths inside a Python virtual environment that has been moved or renamed.

The problem

When you move or rename the parent folder of a venv, all scripts inside it still hold the old absolute path hardcoded (shebangs, pyvenv.cfg, activation scripts). The venv becomes unusable even though the files are physically still there.

venv-relocate detects the mismatch between the recorded path and the real path, then rewrites the affected files in-place.

What it fixes

  • pyvenv.cfg
  • Shebangs of all scripts in bin/ (or Scripts/ on Windows)
  • Activation scripts: activate, activate.csh, activate.fish, Activate.ps1

Installation

pip install venv-relocate

Usage

# Preview what would be changed (nothing is written)
venv-relocate .venv --dry-run

# Apply fixes (creates .bak backups by default)
venv-relocate .venv

# Apply without backups
venv-relocate .venv --no-backup

License

Copyright (c) 2026 Mehdi.A — MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

venv_relocate-0.3.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

venv_relocate-0.3.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file venv_relocate-0.3.0.tar.gz.

File metadata

  • Download URL: venv_relocate-0.3.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for venv_relocate-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6051ff765b982e2f328d02d12d8adcc4dbae5fb22caef1816fda23556723f32a
MD5 de51d01b3564f3753af15114e778cd19
BLAKE2b-256 157bc23cb361e3022e6a23775c079a26cf9fa20c3b966c8db4533a727c7a7e22

See more details on using hashes here.

File details

Details for the file venv_relocate-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: venv_relocate-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for venv_relocate-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e92e24ff6df6472589245c5e10025922491c161f38c794a6032eb64c43193e47
MD5 92cd707b4eedcaba614ae9bf44943b92
BLAKE2b-256 0e291f7bddcd0d57a7aba26aba698ecf8c27ea27185a02e8569bf679c5796eeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page