Windows command-line tool to switch between different installed versions of Python.
Project description
Description
From the command-line, run:
> pychoose XY
This will make Python version X.Y active, if it is installed, for subsequent commands from the same prompt. The change is local to this shell.
The prompt is modified to indicate the modified environment.
To revert to the previously used version of Python, type ‘exit’
This works by starting a new Cmd shell with a modified PATH, by prepending C:\PythonXY and its subdirectories, and importantly by removing any other C:\PythonZZ directories and subdirectories.
Multiple invocations of pychoose can be nested.
Dependencies
No dependencies other than Python itself. Only tested on 2.4, 2.5, 2.6.
Installing
Windows users may download and double-click a graphical installer from http://pypi.python.org/pypi/pychoose.
Command-line jockeys with setuptools installed may use:
easy_install pychoose
or, if pip is installed:
pip install pychoose
or download a zip of the source from http://pypi.python.org/pypi/pychoose and use:
python setup.py install
Alternatively, to check out the latest unstable source from subversion, including tests, see:
Known Problems
Should get install dirs of various Python version from the registry, insted of assuming they are all variations on C:\PythonXX.
When it operates, it changes the path to put itself out of reach! So, like any other Python package, it requires installing separately for each Python version you have installed, which is a bit irksome. It would be better if it installed to some location that was always on the path, even when specific Python versions are removed from the path. Or perhaps it should copy itself into the Python version being activated? Hmmm…
Doesn’t affect Windows .py filetype associations. Perhaps this could be tackled by inserting an environment variable into the registry keys, set the env var in the registry (to persist its default value) and then change that value temporarily and locally in this script.
Doesn’t modify PYTHONPATH. Should it ever?
Should be cross-platform, but isn’t yet. As I understand it, on other platforms we wouldn’t even have to start a new shell to work.
Currently adds all subdirectories of PythonXX to the PATH. This is probably overkill. Can we filter out desired subdirectories with any reliability?
License
Pychoose is distributed under the BSD license. Live long and prosper.
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
Built Distribution
File details
Details for the file pychoose-0.1.1.zip
.
File metadata
- Download URL: pychoose-0.1.1.zip
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf0cd9b5f0c25cc7364857de1131dd623417d035712d95016c03e6b5944cb74a |
|
MD5 | 94856e7f79db38f1f626c7825b71588e |
|
BLAKE2b-256 | 7c52c012ce82a1953283eb3a6750cddf52dbbb8d545e914000d4931d13bd3c57 |
File details
Details for the file pychoose-0.1.1.win32.exe
.
File metadata
- Download URL: pychoose-0.1.1.win32.exe
- Upload date:
- Size: 202.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bca4ee675c783f0baac1b4b6eead887f6d87dfb85f4c395018b94d3afd52048b |
|
MD5 | 5a625a5cb2e64e2e0b2f9886953d51f1 |
|
BLAKE2b-256 | d68e017bbfbca3ac50271e3e9a01edefa06c0961a21d0b9541a67d8e9250ba9a |