- Using Windows Installer
- Non-interactive Installation
- Limited user interface
- Target directory
- Installation for All Users
- Feature Selection
- Uninstallation
- Administrative installation
- Advertisement
- Automatic Installation on a Group of Machines
- The PSF
- Installation on Windows (XP/Vista/Server 2003/Server 2008)¶
- Step 1 – Install Visual Studio 2008 Express¶
- Step 2 – Install Python¶
- Step 3 – Install Win32py extensions¶
- Step 4 – Python BIN¶
- Step 5 – Kallithea folder structure¶
- Step 6 – Install virtualenv¶
- Step 7 – Install Kallithea¶
- Step 8 – Configuring Kallithea¶
- Step 9 – Running Kallithea¶
Using Windows Installer
Python 2.5 is distributed as a Microsoft Installer (MSI) file on Windows. Typically, packages are installed by double-clicking them in the file explorer. However, with the msiexec.exe command line utility, additional features are available, like non-interactive installation and administrative installation.
Non-interactive Installation
installation can be initiated programmatically. Additional parameters can be passed at the end of this command line, like
msiexec /i python-2.5.msi TARGETDIR=r:\python25
Limited user interface
- /qn — No interface
- /qb — Basic interface — just a small progress dialog
- /qb! — Like /qb, but hide the Cancel button
- /qr — Reduced interface — display all dialogs that don’t require user interaction (skip all modal dialogs)
- /qn+ — Like /qn, but display «Completed» dialog at the end
- /qb+ — Like /qb, but display «Completed» dialog at the end
Target directory
The property TARGETDIR determines the root directory of the Python installation. For example, a different installation drive can be specified with
Installation for All Users
causes an installation for all users. By default, the non-interactive installation install the package just for the current user, and the interactive installation offers a dialog which defaults to «all users» if the user is sufficiently privileged.
Feature Selection
- DefaultFeature — install the interpreter proper, plus the core libraries
- Extensions — register extensions (.py, .pyc, etc)
- TclTk — install Tkinter, and IDLE
- Documentation — install documentation
- Tools — install the Tools/ directory
- Testsuite — install Lib/test/
- ADDLOCAL — list of feature to be installed on the local machine
- REMOVE — list of features to be removed
- ADDDEFAULT — list of features added in their default configuration (which is local for all Python features)
- REINSTALL — list of features to be reinstalled/repaired
- ADVERTISE — list of feature for which to perform an advertise installation
Uninstallation
python can be uninstalled. It is not necessary to have the MSI file available for uninstallation; alternatively, the package or product code can also be specified. You can find the product code by looking at the properties of the Uninstall shortcut that Python installs in the start menu.
Administrative installation
an «administrative» (network) installation can be initiated. The files get unpacked into the target directory (which should be a network directory), but no other modification is made to the local system. In addition, another (smaller) msi file is generated in the target directory, which clients can then use to perform a local installation (future versions may also offer to keep some features on the network drive altogether). Currently, there is no user interface for administrative installations, so the target directory must be passed on the command line. There is no specific uninstall procedure for an administrative install — just delete the target directory if no client uses it anymore.
Advertisement
it would be possible, in principle, to «advertise» python to a machine (with /ju to a user). This would cause the icons to appear in the start menu, and the extensions to become registered, without the software actually being installed. The first usage of a feature would cause that feature to be installed. The Python installer currently supports just advertisement of start menu entries, but no advertisement of shortcuts.
Automatic Installation on a Group of Machines
- Log on to the domain controller
- Copy the MSI file into a folder that is shared with access granted to all target machines.
- Open the MMC snapin «Active Directory users and computers»
- Navigate to the group of computers that need Python
- Open Properties
- Open Group Policies
- Add a new polices, and edit it
- In Computer Configuration/Software Installation, chose New/Package
- Select the MSI file through the network path
- Optionally, select that you want the Python to be deinstalled if the computer leaves the scope of the policy.
The PSF
The Python Software Foundation is the organization behind Python. Become a member of the PSF and help advance the software and our mission.
- About
- Applications
- Quotes
- Getting Started
- Help
- Python Brochure
- All releases
- Source code
- Windows
- macOS
- Other Platforms
- License
- Alternative Implementations
- Docs
- Audio/Visual Talks
- Beginner’s Guide
- Developer’s Guide
- FAQ
- Non-English Docs
- PEP Index
- Python Books
- Python Essays
- Diversity
- Mailing Lists
- IRC
- Forums
- PSF Annual Impact Report
- Python Conferences
- Special Interest Groups
- Python Logo
- Python Wiki
- Code of Conduct
- Community Awards
- Get Involved
- Shared Stories
- Arts
- Business
- Education
- Engineering
- Government
- Scientific
- Software Development
- Python News
- PSF Newsletter
- PSF News
- PyCon US News
- News from the Community
- Python Events
- User Group Events
- Python Events Archive
- User Group Events Archive
- Submit an Event
- Developer’s Guide
- Issue Tracker
- python-dev list
- Core Mentorship
- Report a Security Issue
Installation on Windows (XP/Vista/Server 2003/Server 2008)¶
This installation is for 32-bit systems, for 64-bit Windows you might need to download proper 64-bit versions of the different packages (Windows Installer, Win32py extensions) plus some extra tweaks. These extra steps haven been marked as “64-bit”. Tested on Windows Server 2008 R2 SP1, 9-feb-2013. If you run into any 64-bit related problems, please check these pages:
Step 1 – Install Visual Studio 2008 Express¶
Optional: You can also install MinGW, but VS2008 installation is easier.
You can also download full ISO file for offline installation, just choose “All – Offline Install ISO image file” in the previous page and choose “Visual C++ 2008 Express” when installing.
Using other versions of Visual Studio will lead to random crashes. You must use Visual Studio 2008!”
Silverlight Runtime and SQL Server 2008 Express Edition are not required, you can uncheck them
64-bit: You also need to install the Microsoft Windows SDK for .NET 3.5 SP1 (.NET 4.0 won’t work). Download from: http://www.microsoft.com/en-us/download/details.aspx?id=3138
64-bit: You also need to copy and rename a .bat file to make the Visual C++ compiler work. I am not sure why this is not necessary for 32-bit. Copy C:Program Files (x86)Microsoft Visual Studio 9.0VCbinvcvars64.bat to C:Program Files (x86)Microsoft Visual Studio 9.0VCbinamd64vcvarsamd64.bat
Step 2 – Install Python¶
Remember the specific major and minor version installed, because it will be needed in the next step. In this case, it is “3.8”.
64-bit: Just download and install the 64-bit version of python.
Step 3 – Install Win32py extensions¶
- Click on “pywin32” folder
- Click on the first folder (in this case, Build 218, maybe newer when you try)
- Choose the file ending with “.win32-py3.x.exe” -> x being the minor version of Python you installed (in this case, 7) When writing this guide, the file was: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win-amd64-py3.8.exe/download
Step 4 – Python BIN¶
Add Python BIN folder to the path
You have to add the Python folder to the path, you can do it manually (editing “PATH” environment variable) or using Windows Support Tools that came preinstalled in Vista/7 and can be installed in Windows XP.
- Using support tools on WINDOWS XP: If you use Windows XP you can install them using Windows XP CD and navigating to SUPPORTTOOLS. There, execute Setup.EXE (not MSI). Afterwards, open a CMD and type:
SETX PATH "%PATH%;[your-python-path]" -M
SETX PATH "%PATH%;[your-python-path]" /M
Step 5 – Kallithea folder structure¶
Create a Kallithea folder structure
This is only a example to install Kallithea, you can of course change it. However, this guide will follow the proposed structure, so please later adapt the paths if you change them. My recommendation is to use folders with NO SPACES. But you can try if you are brave…
Create the following folder structure:
C:\Kallithea C:\Kallithea\Bin C:\Kallithea\Env C:\Kallithea\Repos
Step 6 – Install virtualenv¶
Create a virtual Python environment in C:\Kallithea\Env (or similar). To do so, open a CMD (Python Path should be included in Step3), and write:
python3 -m venv C:\Kallithea\Env
Step 7 – Install Kallithea¶
Finally, install Kallithea
Close previously opened command prompt/s, and open a Visual Studio 2008 Command Prompt (IMPORTANT!!). To do so, go to Start Menu, and then open “Microsoft Visual C++ 2008 Express Edition” -> “Visual Studio Tools” -> “Visual Studio 2008 Command Prompt”
64-bit: For 64-bit you need to modify the shortcut that is used to start the Visual Studio 2008 Command Prompt. Use right-mouse click to open properties.
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" x86
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" amd64
In that CMD (loaded with VS2008 PATHs) type:
cd C:\Kallithea\Env\Scripts (or similar) activate pip install --upgrade pip setuptools
The prompt will change into “(Env) C:\Kallithea\Env\Scripts” or similar (depending of your folder structure). Then type:
(long step, please wait until fully complete)
Some warnings will appear, don’t worry as they are normal.
Step 8 – Configuring Kallithea¶
You have to use the same Visual Studio 2008 command prompt as Step7, so if you closed it reopen it following the same commands (including the “activate” one). When ready, just type:
cd C:\Kallithea\Bin kallithea-cli config-create my.ini
Then, you must edit my.ini to fit your needs (network address and port, mail settings, database, whatever). I recommend using NotePad++ (free) or similar text editor, as it handles well the EndOfLine character differences between Unix and Windows (http://notepad-plus-plus.org/)
For the sake of simplicity lets run it with the default settings. After your edits (if any), in the previous Command Prompt, type:
kallithea-cli db-create -c my.ini
This time a new database will be installed. You must follow a different process to later upgrade to a newer Kallithea version.
The script will ask you for confirmation about creating a NEW database, answer yes (y) The script will ask you for repository path, answer C:\Kallithea\Repos (or similar) The script will ask you for admin username and password, answer “admin” + “123456” (or whatever you want) The script will ask you for admin mail, answer “admin @ xxxx . com” (or whatever you want)
If you make some mistake and the script does not end, don’t worry, start it again.
Step 9 – Running Kallithea¶
In the previous command prompt, being in the C:\Kallithea\Bin folder, just type:
Open yout web server, and go to http://127.0.0.1:5000
Remark: If it does not work first time, just Ctrl-C the CMD process and start it again. Don’t forget the “http://” in Internet Explorer
What this Guide does not cover:
- Installing Celery
- Running Kallithea as Windows Service. You can investigate here:
- http://pypi.python.org/pypi/wsgisvc
- http://ryrobes.com/python/running-python-scripts-as-a-windows-service/
- http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service
- https://groups.google.com/group/rhodecode/msg/c433074e813ffdc4