Running python 3.2 programs from cygwin(windows 7 user) - python

I need to be able to run python 3.2 scripts from cygwin.However,the current setup of cygwin shows it isnt compatible with that.I searched on the internet and saw in some other forums that people have ben unable to do it.Anyone here has any idea how to do it?

You can install Python 3.1.5 using Cygwin Ports.
Python 3.2 hasn't been ported to Cygwin, almost certainly because it's relatively unstable compared to 3.1, which is now only taking security fixes. If you want Python 3.2, you'll need to port it to Cygwin yourself.

As of yesterday (Wed 25 July 2012), Python 3.2.3 is included in the standard Cygwin installer. Just run Cygwin's setup.exe again (download it from cygwin.com again if you need to), and you should be able to select and install it like any other package.

Ok.one solution i have found is that i can invoke cygwin through command window and then pass instructions using subprocess.However being able to run python 3.2 codes from cygwin would have been more preferable to me rather than the other way round!!

Related

Python3 Django project use the Python2 library

I have a project with Python 3.5.4, but I want to use a Python library called pyghmi, but the library only supports the Python 2.x.
How can I solve this issue?
The project was updated for python3 and is tested with python 3.5, though I will confess the vast majority of users are using python 2.7 at the moment. The building of rpms, however, has not yet been tested for python3 (so far system python of centos 6 and centos7 has been the rpm environment).
I would be interested to know the issue you are hitting.

Run Python 64bit In 32Bit mode?

Note: Running windows7X64
I want to use some audio functions I have seen allot for python 2.7 like snack and such, however I'm using python 3.3. I have come across pygame.py that has some audio functions however pygame doesn't support 64bit arch yet.
So can it be done? if not do we know of any python audio integration modules that can get the job done on python 3 with a 64bit arch
Yes I can just install python 3 32bit but that seems counterproductive and unnecessarily complicated.
Thanks
Ben
You'll have to install 32-bit Python to run 32-bit extension modules. In my experience, two Python installations can live side-by-side quite nicely on Windows, as long as you make sure your environment (PYTHONPATH esp.) is set properly.
Have you tried this?
$ defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
Edit: For the sake of sharing information, this will work (at least from my experience) on a Mac; however, it will not work on a Windows.

Getting shogun ML library to work with python

I was trying to install shogun on Windows:
http://www.shogun-toolbox.org/doc/installation.html
but evidently it requires python 2.5 to work. I tried with python 3 and it didn't work. But then python 2.5 no longer exists.
Does anybody know how to get it working with python without using python 2.5?
You won't get very far trying with Python 3 (which is not fully compatible with Python 2.x).
Furthermore, the installation instructions say:
"SHOGUN requires the standard linux
utils like bash, grep, test, sed, cut,
ldd, uname gcc g++ cat python"
sounds like you are out of luck on windows, unless you resort to Cygwin.
There are currently two Python languages out there
the original one, which is still being updated (currently at 2.7.2)
the overhauled Python 3, which is breaking compatibility (currently at 3.1.4)
Many libraries have not switched to Python 3 yet, and might not for some time, so you're better off getting 2.6 or 2.7.
For Windows or Mac, I can recommend the Enthought distribution (free for academic use), which contains loads of goodies, including scipy, which you'll very probably need -- and installs hassle-free!

Running Scapy on Windows with Python 2.7

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.

Modules between multiple versions of Python Linux

I have Python2.6.5 and Python2.4.4 on my linux machine.
At the moment, all the modules I have (wx, ply, pyserial, twisted, to name a few) are installed for the 2.6 version of python. If I try to import wx on Python2.4, I get the expected no module error.
The problem here, is that I have a lot of devices (Let's say over a thousand) all running 2.4.4, which will soon need to be supported by this machine (For builds of code, releases etc). Until now, I've been using an EeePC (Same device as the ones I'm supporting) to do builds and releases, which has worked well. (I develop on the 2.6 machine, and build on the EeePC).
How would I go about getting these modules to work for Python2.4? I've tried reinstalling (With 2.4 as my primary), but that just caused errors. The blogs/answers I've found say to use easy_install, but that doesn't support the packages I need (Or at least, it just died when I tried).
In short: I'm currently using python 2,6, but I'd like it to change to 2.4 for all the modules as that's what I'm going to be using.
You can't share modules between different versions of Python. If you want to use wxPython from Python 2.4, you need to install it for Python 2.4.
You said you tried to install it with Python 2.4 as your "primary". I'm not sure what that means. You would install wxPython for Python 2.4 by running the installer with Python 2.4, like so:
$sudo /usr/bin/python2.4 setup.py install
Or similar.
You can use easy_install as well, but then you need to install Distribute for Python 2.4 first. Did you do that?
I recently wrote a full explanation on my blog about this: http://regebro.wordpress.com/2011/02/02/newbie-hint-on-installing-python-and-its-modules-and-packages/
Don't attempt to share them; this has some chance of success with pure Python modules, but C modules will fail to work. Instead, install them using the appropriate interpreter executable, e.g. python2.4 setup.py install.

Categories

Resources