Transcrypt版本降级失败:卸载重装后仍显示2.2.0,如何降级至2.1.0?
I’ve run into this exact issue before—usually it boils down to conflicting global vs. local installations, leftover executable files, or pip cache serving the old version. Let’s walk through the steps to fix this properly:
Step 1: Locate where your current Transcrypt is running from
First, figure out which executable your shell is picking up. Run:
- On Linux/macOS:
which transcrypt - On Windows (Command Prompt):
where transcrypt - On Windows (PowerShell):
Get-Command transcrypt
Note down the full path shown—this is the binary that’s still reporting 2.2.0, and we’ll need to clean it up.
Step 2: Uninstall all instances of Transcrypt
Uninstall via pip (cover both global and local environments):
- If you use a virtual environment for your project, activate it first, then run:
pip uninstall -y transcrypt - For global system-wide installations, run:
(Addpip uninstall -y transcryptsudoat the start if you installed it system-wide on Linux/macOS.)
- If you use a virtual environment for your project, activate it first, then run:
Manually delete leftover executable files:
If the path from Step 1 isn’t inside your project’s virtual environment or pip’s standard directories, delete that file directly:- Linux/macOS:
rm /path/to/transcrypt(replace with the path you noted) - Windows: Delete the
.exefile from the path shown.
- Linux/macOS:
Step 3: Clear pip’s cache
Pip might still have the 2.2.0 package cached, which can cause accidental reinstalls of the wrong version. Clear the cache with:
pip cache purge
Step 4: Install Transcrypt 2.1.0 specifically
Make sure you’re in your project’s virtual environment (this is highly recommended to avoid future dependency conflicts), then run:
pip install transcrypt==2.1.0
Step 5: Verify the downgrade
Run transcrypt --version again. If it still shows 2.2.0, try running the executable directly from your project’s virtual environment to confirm:
- Linux/macOS:
./venv/bin/transcrypt --version(adjustvenvto your virtual environment name) - Windows:
.\venv\Scripts\transcrypt.exe --version
If this direct call shows 2.1.0, your shell’s PATH is prioritizing the global Transcrypt over your local one. Ensure your virtual environment’s bin/Scripts directory is at the top of your PATH when the environment is activated.
Bonus: If you installed via a system package manager
If you originally installed Transcrypt using brew (macOS) or another system package manager, uninstall it from there first too:
brew uninstall transcrypt
Then proceed with the pip installation steps above.
内容的提问来源于stack exchange,提问作者pma133

