Try using update-alternatives:
update-alternatives --config python
It should show you the gropus of links (to python versions) to python installed and will let you choose which one to use by default.
Luck.
Hello there!
I'm new to the BackTrack. Well, I have been messing with the distros since the times of Auditor, but now I'm getting really into it.
I have been using GNU/Linux from time to time, but I lack a solid base, so sometimes I get stuck.
Well, here's my problem. I've installed BT5r3 and updated lots of applications I regulary use without any big problems. But, once, I don't remember for what specific program, I was required to install Python2.7 so I did it, from the sources (yeah, I didn't know about the "make altinstall" thingy), and that was the start of my problems.
I discovered about pythonbrew, which is a tool for switching between Python version, but it never worked for me. I mean, it runs without errors, but it didn't change nothing, so I had to manually edit $PATH and $PYTHONPATH.
After many, many readings, research, testing, installing, uninstalling, reinstalling... I achieved a point where launching Python scripts from the console uses Python 2.6.5 (installed by default in BT5r3, and which I want to use), but, and here is the strange thing, launching Python scripts from the BackTrack menu throws errors like this:
I think the gnome command interpreter, or whatever way are the programs run by the GUI menu, is calling the wrong python version, because I got the same errors by using in the terminal:Code:Traceback (most recent call last): File "execute.py", line 8, in <module> from PyQt4 import QtGui,QtCore ImportError: No module named PyQt4
I see two possible solutions here:Code:root@bt:/pentest/web/sslstrip# python2.7 sslstrip.py Traceback (most recent call last): File "sslstrip.py", line 27, in <module> from twisted.web import http ImportError: No module named twisted.web
- To return/restore Python to the original 2.6.5. What I was trying to do.
- To update to Python 2.7.3. What, as I have read, is going to bring me lots of difficults. Plus I think I would have to migrate all the modules.
I hope someone can help me, because this is being a big headache and I'm running out of ideas.
Thank you for reading!
Try using update-alternatives:
update-alternatives --config python
It should show you the gropus of links (to python versions) to python installed and will let you choose which one to use by default.
Luck.
Hello Maverick35, thanks a lot for you answer, it is being useful, but according to the forum rules, my post was waiting for moderation for about two days because I'm a new user, so I have reduced a little the problems with Python.
I have repaired pythonbrew. Just for anyone with pythonbrew problems, here is it very well explained: http://blog.endpoint.com/2013/02/ins...directory.html. I was missing the part involving the source command, so pythonbrew was never used by the system. So, now I can switch between Python versions and I have been using 2.7.3 with [almost] all the BT5 required modules that I have compiled one by one. But just for the console. Everytime I call a python script from the menu, it calls the local python 2.6.5 instead of the pythonbrew managed one. I don't know why is this, here's an example:
fern-wifi-cracker:
Menu launcher command:I get this error:Code:sh -c "cd /pentest/wireless/fern-wifi-cracker/ && python execute.py;sudo -s"Which is exactly the same that if I use in the console:Code:Traceback (most recent call last): File "execute.py", line 8, in <module> from PyQt4 import QtGui,QtCore RuntimeError: the sip module implements API v9.0 to v9.2 but the PyQt4.QtGui module requires API v7.1By the other hand, if I write simply "python execute.py", then pythonbrew is in command and v2.7.3 is called. Note that I'm using just the "python" call (without version suffix, and without path), the same way that is in the launcher of the menu... so it seems to be a strange behaviour.Code:Python2.6 execute.py
I think that maverik35 give me the clue and I'm making some tests with that cool command that I, ignorant, didn't know before, so thank you mate, I'll tell you how it ends. Now I am also fighting with the dependences for the last version of keepnote, which is also being hard! but in the long way, I'm learning a lot.
Assuming these "from PyQt4 import QtGui,QtCore" are actually installed, then my guess is that your PYTHONPATH is still buggered.
I'm a compulsive post editor, you might wanna wait until my post has been online for 5-10 mins before quoting it as it will likely change.
I know I seem harsh in some of my replies. SORRY! But if you're doing something illegal or posting something that seems to be obvious BS I'm going to call you on it.