I am looking for a Python3.0 version of "py2exe". I tried running 2to3 on the source for py2exe but the code remained broken.
Any ideas?
Update 2014-05-15
py2exe for Python 3.x is now released! Get it on PyPI.
Old information
Have a look at the py2exe SourceForge project SVN repository at:
http://py2exe.svn.sourceforge.net/
The last I looked at it, it said the last update was August 2009. But keep an eye on that to see if there's any Python 3 work in-progress.
I've also submitted two feature requests on the py2exe tracker. So far, no feedback on them:
Support Python 3.x
Project roadmap
Did you check out cx_Freeze? It seems to create standalone executables from your Python scripts, including support for Python 3.0 and 3.1
py2exe for Python3 is out!
Here is the original bug report:
http://sourceforge.net/projects/py2exe/
Here is the comment mentioning the release:
http://sourceforge.net/projects/py2exe/
Here is the package on pypi:
https://pypi.python.org/pypi/py2exe/0.9.2.0
Note that py2exe for Python 3 only supports Python 3.3 and above!
A huge thank you to the py2exe development team!
The py2exe and 2to3 programs serve completely different purposes, so I'm not sure what your ultimate goal is.
If you want to build an executable from a working Python program, use the version of py2exe that is suitable for whichever Python you are using (version 2 or version 3).
If you want to convert an existing Python 2 program to Python 3, use 2to3 plus any additional editing as necessary. The Python 3 documentation describes the conversion process in more detail.
Update: I now understand that you might have been trying to run 2to3 against py2exe itself to try to make a Python 3 compatible version. Unfortunately, this is definitely beyond the capabilities of 2to3. You will probably have to wait for the py2exe project to release a Python 3 compatible version.
If you have easy setup installed, type pip install py2exe in a shell to install.
Related
We used to distribute (for Windows) a very large Python 2/PyGTK application by packaging Python installer itself along other needed installers and packages through an InnoSetup script. Among with those other installers and packages we deliver an all-in-one PyGTK package and it worked very well.
Now we've converted our software for Python 3 and GTK 3. Ok, there is an all-in-one for PyGI [1] (PyGObject Introspection), but just for Python 2.7 to 3.4 and we need at least Python 3.7.
I've spent last couple of weeks learning MSYS2 and trying to understand how MyPaint or Gaphor (which are similar apps) are distributed for Windows without success. I am able to download and install GTK and PyGI using pacman on MSYS2/MingW64 but I cannot figure out how can I create such a package like PyGI all-in-one. I asked for help or instructions on SourceForge but I got no responses so far.
I am asking for help or any clues on how can I generate a PyGI-all-in-one-like installer. Thanks in advance!
[1] https://sourceforge.net/projects/pygobjectwin32/
You can bundle a PyGObject app in Windows using PyInstaller. It can be used with either MSYS2 or gvsbuild to find and bundle all the GTK libraries you need. Then you can use your InnoSetup script to create an installer.
I'm helping my 10yo go through the book "Python for Kids" by Jason Briggs, on Windows 7. He already knows Scratch. He's making great progress in the book, but I'm surprised that it has no information about creating an exe; it assumes Python will be installed on any computer the kids' programs run on. That isn't going to work when the kid wants to give his programs to his friends. Helping him with this book is my own first exposure to Python.
Google led me to cx_Freeze 4.3.4, but when I try to install it (cx_Freeze-4.3.4.win32-py3.4.exe), I get the message:
"Python version 3.4 required, which was not found in the registry."
Does that mean I have to downgrade to Python 3.4? But then I found this thread which seems to indicate that cx_Freeze should work on Python 3.5:
https://sourceforge.net/p/cx-freeze/mailman/message/34695906/
What do I need to do?
cx_Freeze 4.3.4 doesn't work with Python 3.5. However, the development version of cx_Freeze 5.0 is reasonably stable, but since there is still no official release yet, I could not find any easily usable distribution for Windows. So I've created a simple GitHub page with some instructions and pre-built binary Python Wheels for anyone who needs to create an exe distribution with Python 3.5 on Windows: https://github.com/sekrause/cx_Freeze-Wheels
Last I checked Pyinstaller has official support (think it's the only one thus far?) for Python 3.5
Here's a friendly tutorial on how to make an .exe using Pyinstaller. His steps works for me for simple 3.5 applications which might be all you need it for. The youtuber in the link also has a very well-covered playlist for python GUI development which was my first exposure to python GUI development.
I like to use Scapy with Python v2.7 under Windows 7.
How can I install the required module pypcap for Python 2.7?
Will it be possible to make Python scripts depending on Scapy into standalone Windows applications using a distribution tool such as py2exe?
The particular Python distribution I am using is Enthought Python distribution 7.02.
Intrusive update: please note that this answer is outdated, with recent versions (>=2.4.0) scapy will ONLY require Npcap (or Winpcap) to work, and IPython for the console. Have a look at the official windows page
In case someone needs Scapy for 64-bit + Python 2.7, I've uploaded the binaries here:
https://github.com/Kondziowy/scapy_win64
dnet-1.12.win-amd64-py2.7.exe
pcap-1.1.win-amd64-py2.7.exe
scapy-2.2.0.win-amd64.exe
In addition, you probably need to install WinPcap from the official site
Compiling it yourself required a few fixes - I'll commit them upstream soon.
Q: how can i install required module pypcap
Using Scapy with Windows 7 is possible, but it does not exactly work out of the box. An install guide can be found here:
http://www.secdev.org/projects/scapy/doc/installation.html#windows
I strongly recommend to switch to python 2.6, as this will make your live much easier.
When you insist on 2.7 you will have to compile some of the require modules yourself. Also, some key modules like pypcap have to be patched before they can be compiled with python 2.7 (see pycap patch).
Here you will find some guidance on how to build the modules.
Q: will it be possible to make python scripts depending on scapy into standalone windows applications
Yes and no. While you can use py2exe to build a an EXE from your python code. Scapy uses WinPcap which you have to install in addition to your application.
Dirk Loss provides an Windows installer for the dnet package for Python 2.7. Together with the Windows installer for the pypcap package for Python 2.7 I was able to run Scapy successfully on Python 2.7 on Windows.
A LOT OF ANSWERS ARE OUTDATED !
Latest scapy version, that you can download on the official GitHub page:
https://github.com/secdev/scapy
Works without the old hand-compiled dependencies!
They are two easy requirements: IPython (for the console) and npcap (or winpcap)
You may follow the official tutorial here:
http://scapy.readthedocs.io/en/latest/installation.html#windows
Using the link posted by circus, I created binary installations for Scapy for python 2.7.x 32bit. Link for the setups (with dependencies) https://github.com/Kondziowy/scapy_win64
If you don't have limitations forcing you to work with python2, you can try scapy3k from http://github.com/phaethon/scapy or pip install scapy-python3.
It does not require dnet nor pypcap, no C compilation required. I work with following config Windows 10/Anaconda 3.5/latest WinPcap.
Minimum requirement to get Scapy running on Windows with Python 2.7 seems to be: pyreadline, pcapy, and dnet. The last two are the trickiest to compile and/or find pre-compiled binaries. One option for these is listed in the above answer. Another download, together with with detailed steps on how getting Scapy to run on Windows is at: https://github.com/zlorb/scapy. These steps describe also how to get the optional dependencies, such as Gnuplot and Tex.
I have Mercurial 1.3 installed on my Windows 7 machine. I don't have python installed, but Mercurial seems to be OK with that.
How does it work?
Also, is it possible to force Mercurial run on IronPython and will it be compatible?
Thank you.
The Mercurial windows installer is packaged using py2exe. This places the python interpreter as a DLL inside of a file called "library.zip".
On my machine, it is placed in "C:\Program Files\TortoiseHg\library.zip"
This zip file also contains the python libraries that are required by mercurial.
For a detailed description of how mercurial is packaged for windows, see the developer page describing building windows installer.
Since there is a "library.zip"(9MB), Mercurial's Windows binary package maybe made by py2exe, py2exe is a Python Distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.
Others have answered the first question -- let me give a guess about the second part.
Mercurial will normally use some C extensions for speed. You cannot use those with IronPython.
But we also ship pure Python versions of these modules, and depending on how much IronPython implements of a standard Python 2.4 environment, those modules could be compatible. I have seen reports on IRC about Jython (the Java port of Python) being able to do a few operations using the pure modules. You should download Mercurial and take a look at the mercurial/pure folder. These modules simply has to be moved up one directory level to be found, the setup.py script can do this if you pass the --pure flag. Please see its source or come talk with us on the Mercurial mailinglist/IRC.
Mercurial bundles the necessary python binaries within it, I believe.
I'm currently toying with python at home and I'm planning to switch to python 3.1. The fact is that I have some scripts that use python 2.6 and I can't convert them since they use some modules that aren't available for python 3.1 atm. So I'm considering installing python 3.1 along with my python 2.6. I only found people on the internet that achieve that by compiling python from the source and use make altinstall instead of the classic make install. Anyway, I think compiling from the source is a bit complicated. I thought running two different versions of a program is easy on Linux (I run fedora 11 for the record). Any hint?
Thanks for reading.
On my Linux system (Ubuntu Jaunty), I have Python 2.5, 2.6 and 3.0 installed, just by installing the binary (deb) packages 'python2.5', 'python2.6' and 'python3.0' using apt-get. Perhaps Fedora packages them and names them as RPMs in a similar way.
I can run the one I need from the command line just by typing e.g. python2.6. So I can also specify the one I want at the top of my script by putting e.g.:
#!/usr/bin/python2.6
Download the python version you want to have as an alternative, untar it, and when you configure it, use --prefix=/my/alt/dir
Cheers
Nik
You're not supposed to need to run them together.
2.6 already has all of the 3.0 features. You can enable those features with from __future__ import statements.
It's much simpler run 2.6 (with some from __future__ import) until everything you need is in 3.x, then switch.
Why do you need to use make install at all? After having done make to compile python 3.x, just move the python folder somewhere, and create a symlink to the python executable in your ~/bin directory. Add that directory to your path if it isn't already, and you'll have a working python development version ready to be used. As long as the symlink itself is not named python (I've named mine py), you'll never experience any clashes.
An added benefit is that if you want to change to a new release of python 3.x, for example if you're following the beta releases, you simply download, compile and replace the folder with the new one.
It's slightly messy, but the messiness is confined to one directory, and I find it much more convenient than thinking about altinstalls and the like.