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.
Related
What problems can I have if I will use python 2.7 instead python 2.6 for my pylons/pyramid projects? Before I use python 2.6 on my ubuntu 10.04 but now I have ubuntu 11.04 on my laptop with python 2.7.
If you're using Ubuntu the package manager will fix most of the minor issues such as finding the packages you used to have in 2.6.
But there are some Packages that isn't compliant with Python2.7.
Mainly Python2.7 is a backwards compatible version from 3.X, or at least Python 2.7 was an upgrade from 2.6 towards the 3.X syntax and all it's new functions while the translation to 3.X was made.
Here's some info:
http://docs.python.org/dev/whatsnew/2.7.html
http://www.python.org/getit/releases/2.7/
Mainly Python2.7 should just give you more functions but can cause unexpected problems,
Go ahead and upgrade it on a seperate machine, run your code, if it works, upgrade your real machine to Python2.7.
The problems that might occur are minor, you should be able to fix them within 1h.
According to this post, Pyramid 1.2 (as is 1.1) is fully supported on Python 2.5.x, 2.6.x, and 2.7.x so you should be all set. From my own personal experience,I haven't run into any issues with Pyramid/Python2.7.
These days my Pyramid stack consists of:
python 2.7
khufu
sqlalchemy 0.7.x
and it works quite well.
Take a look at http://docs.python.org/dev/whatsnew/2.7.html
You'll find what all you'll ever need to know.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can I install python 3.x and 2.x on the same computer?
I am learning Python which I started with 3.2. Now I know basics and want to use some frameworks to learn web development. Here, I came to notice Django doesn't supports Python 3x yet.
So, I need to use Python 2x on same machine. How can I install both?
PS. I am currently using Windows XP.
Just install them normally. By default each version of Python is installed to a different path, and won't conflict. Python 3 and Python 2 don't even use the same executable name (python vs python3), so there's not a lot to worry about.
they will install into C:\Python27, and C:\Python32 by default.
no conflicts.
i didn't want to answer this but i have to since you might have a problem that no one is talking about lol
first don't install python from the official website go to activestate and download activepython for python 2,7
here's a direct link
http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-win32-x86.msi
activepython will help a lot when downloading packages trust me, so to install django, open pypm and type pypm install django
learn python 2.x and not 3.x because:
1-All the modules work on 2.x and not 3.x, python is a modular language, it's useless if you can't find modules
2- python 2.x will be there for at least 5 years so there's a long time for you to get started on 3.x maybe by then it will be more supported
3-now we are using 2.7, starting from 2.5 python started doing small changes to help programmers have a smooth transition from 2.x and 3.x, so when 2.9 arrives it will look a lot like 3.x
4-if you installed 2.7 and 3.2 on xp and lets say you made 2.7 your default version, which is the right thing to do, then there's a big possibility that 3.2 won't work, it will give you this error: Error runtime
program C:\python32\pythonw.py
this application has requested the runtime to terminate it in an unusual way, please contact the application support team for more information
so it will just give you a headache lol
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!
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 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.