Resolving 'python: command not found' After Installing Python 3.13 with asdf
You’ve just installed Python 3.13—the latest version packed with exciting features like improved performance and new syntax—using the popular asdf version manager. But when you run python --version, you get the frustrating error: bash: python: command not found.
Don’t worry. This common issue happens because asdf uses shims (proxy scripts) to manage multiple versions, and they aren’t always immediately available in your PATH. asdf stands apart by managing versions across languages like Python, Node.js, and Ruby—unlike pyenv, which specializes in Python, or rbenv for Ruby. All employ shims for transparent switching, so these fixes apply analogously, adjusted for each tool’s setup.\n\n## Step 1: Verify Installation and Reshim
First, confirm Python 3.13 is installed:
$ asdf list python
Expected output shows 3.13.0 (or similar).
You should see 3.13.0 (or similar). If not, install it:
$ asdf install python 3.13.0
Now regenerate shims:
$ asdf reshim python
Test:
$ python --version
Expected: Python 3.13.0
Output: Python 3.13.0
This often resolves the issue immediately.
Step 2: Set Global or Local Version
If reshim doesn’t work, set the version explicitly:
Global (for all projects):
$ asdf global python 3.13.0
Local (for current directory/project):
$ asdf local python 3.13.0
Reshim again:
$ asdf reshim python
Verify with:
$ which python
It should point to ~/.asdf/shims/python.
Step 3: Source asdf in Your Shell
asdf requires its environment to load. Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):
$ echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc
$ source ~/.bashrc
Or for fish shell:\n bash\n $ echo 'asdf' >> ~/.config/fish/config.fish\n
Restart your terminal or run:\n bash\n $ source ~/.bashrc\n
Why This Happens with asdf and Python
- Shims directory not in PATH: asdf adds
~/.asdf/shimsto PATH only after sourcing. - No version set: Without
globalorlocal, no shim activates. - Shell caching: Bash and similar shells cache command locations. Clear with:\n
bash\n $ hash -r\n\n- Plugin updates: For Python 3.13, update the plugin:\nbash\n $ asdf plugin update python\n
Troubleshooting Common Pitfalls
| Issue | Fix |
|---|---|
asdf: No such plugin: python | asdf plugin add python https://github.com/asdf-community/asdf-python.git |
Run:\n bash\n $ asdf current python\n \nto check active version.
Verify Everything Works
Create a test script test.py:
import sys
print(f"Python {sys.version}")
print("Hello from Python 3.13!")
Run:\n bash\n $ python test.py\n
Conclusion\n\nThese steps resolve the ‘command not found’ issue for Python 3.13 under asdf. Version managers like asdf enable reproducible multi-version environments across languages—consider your workflow needs when choosing between asdf, pyenv, or others.
Related: asdf Installation Guide, Python 3.13 Release Notes
Found this helpful? Share your asdf tips in the comments!
Sponsored by Durable Programming
Need help maintaining or upgrading your Python application? Durable Programming specializes in keeping Python apps secure, performant, and up-to-date.
Hire Durable Programming