Python_building twisted on Windows

Source: Internet
Author: User
Overview

Some requirements must be met to build the "official" Win32 twisted. The official build produces two files with the following features:

  • One of the builds is for python 2.5, the other is for python 2.4.
  • There is a shortcut cut in the Start menu for the twisted command prompt which is a standard Windows Command Prompt with path and environment variables set up to invoke the twisted commands the same way you wowould on UNIX; e.g. "mktap ".

There are two ways to get twisted installed from source. One is to do the bare minimum necessary so that 'import Twisted' works; the other is the official method.

Bare minimum

This method is only necessary if you are trying to install twisted from e.g. The Subversion repository, and you don't want to acquire all things ls necessary to do the official build.

  • Install either Python 2.4 or Python 2.5
  • Install zopeinterface 3.3.0 or later for python
With msvc

Without cygwin installed, you need msvc installed for the cl.exe compiler, which is the default on Windows. Just issue the command: $ Python setup. py install

With mingw

The easiest way to build the extensions without msvc is to install mingw, for example using

Automated Installer. Then, create a distutils. cfg file in your distutils installation path (for example, c: \ python2.5 \ Lib \ distutils. cfg), and put the following content:

[build]compiler=mingw32

And then issue$ Python setup. py install. You can also pass-- Compiler = mingw32Option to the build command instead of using distutils. cfg.

With cygwin

With cygwin installed, you need to make sure these two packages are installed:

  • Gcc
  • Gcc-mingw

Once that's done, just issue the command:

python setup.py build --compiler=mingw32 install

If for some reason extensions won't build, try this instead:

python setup.py build_py build_scripts install --skip-build
Official

The official twisted is built with native Python 2.3 (latest), not thecygwin version of Python, however it is built with the help of cygwinpackages.

  • Python 2.5 and Python 2.4

You need both.

  • Zopeinterface 3.3.0

Download and install it for both versions of Python.

  • A-A-P

This is what actually does the building.
Http://www.a-a-p.org/download.html

After installing it, make sure the file AAP. bat is in your system path, using (for example) the environment variable applet.

  • Winreg

You need this little module:
Http://www.rutherfurd.net/python/winreg/

  • Cygwin

You will need cygwin, with the GCC-mingw package installed. Get cygwin:
Http://cygwin.com

Do not install cygwin python!

Do not install cygwin python!

(Install Native Windows python .)

  • Inno Setup

This creates nice self-installers with uninstall functionality:
Http://www.jrsoftware.org/isinfo.php

You need version 4.0.8 or above. (5.0.8 or later preferred .)

  • Bootstrap twisted

You will need an existing installation of twisted, as the build script uses some utilities within twisted. The "bare minimum" Install described abve will suffice.

  • Issue the build command

Bring up a cygwin prompt. Change directories to the root of your twisted source tree. It shoshould contain the directory "Win32/". Now run the following:

 aap.bat -f win32/build.aap

The four distributable files will be in DIST/when this is done.

Troubleshooting

If you have trouble building the official build, try the following:

  1. Remove "C: \ winnt \ AAP. Bat" or "C: \ WINDOWS \ AAP. Bat" which will have incorrect contents.
  2. Make sure that your system path has des c: \ Program Files \ AAP \ Exec
  3. Make sure your cygwin. bash_profile isn' t clobbering this system path
  4. Make sure you don't have cygwin's Python package installed.
  5. Make sure both Python 2.5 and Python 2.4 are installed.
  6. If you're doing an official release, see maintainer-notes.txt.
Windows maintainer instructions
  1. Wait for an official release of some kind
  2. Download the twisted tarball for that release. Do not download subpackage tarbils, download only the full twisted release.
  3. Unpack this tarball.
  4. In the unpacked sumo directory, SVN Co SVN + SSH: // svn.twistedmatrix.com/svn/twisted/trunk/win32
  5. AAP-F Win32/build. AAP
  6. Rename twisted. PTH-> twisted. PTH _ SO twisted is not in the python path
  7. Install Dist/FIG * 2.4 *. exe \
  8. Run twisted Command Prompt
  9. Run mktap, twistd with no args. Observe no errors.
  1. Repeat steps 7, 8, 9 for Dist/twisted * 2.5 *. exe
  2. Rename twisted. PTH _-> twisted. PTH \
  3. Bug someone to give you g + W to/twisted/releases/twisted/2 .?
  4. Upload Dist/*. EXE to twistedmatrix.com:/twisted/releases/twisted/2 .?
  5. Make sure uploaded files are mode 664, group CVS-twisted
  6. Update the Wiki front page and
    Twistedproject page with the new URLs.
  7. Repeat at step 1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.