Results 1 to 4 of 4

Thread: I think I've 'broken' Python. After working on the solution for 2 days, I need help..

  1. #1
    Just burned their ISO
    Join Date
    Mar 2013
    Posts
    2

    Default I think I've 'broken' Python. After working on the solution for 2 days, I need help..

    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:

    Code:
    Traceback (most recent call last):
      File "execute.py", line 8, in <module>
        from PyQt4 import QtGui,QtCore
    ImportError: No module named PyQt4
    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:
    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
    I see two possible solutions here:

    1. To return/restore Python to the original 2.6.5. What I was trying to do.
    2. 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!

  2. #2
    Very good friend of the forum maverik35's Avatar
    Join Date
    Sep 2009
    Location
    Debian land
    Posts
    734

    Default Re: I think I've 'broken' Python. After working on the solution for 2 days, I need he

    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.

  3. #3
    Just burned their ISO
    Join Date
    Mar 2013
    Posts
    2

    Default Re: I think I've 'broken' Python. After working on the solution for 2 days, I need he

    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:
    Code:
    sh -c "cd /pentest/wireless/fern-wifi-cracker/ && python execute.py;sudo -s"
    I get this error:
    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.1
    Which is exactly the same that if I use in the console:
    Code:
    Python2.6 execute.py
    By 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.

    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.

  4. #4
    My life is this forum thorin's Avatar
    Join Date
    Jan 2010
    Posts
    2,629

    Default Re: I think I've 'broken' Python. After working on the solution for 2 days, I need he

    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.

Similar Threads

  1. broken libroot-python-dev & libssl-dev
    By wewe73 in forum BackTrack 5 Bugs
    Replies: 1
    Last Post: 03-13-2012, 06:24 PM
  2. 3 Days
    By amphoterik in forum OLD Newbie Area
    Replies: 3
    Last Post: 02-11-2009, 09:48 AM
  3. NON-WORKING tablet PC---solution inside--
    By soysanti in forum OLD BT3beta NON-WORKING HARDWARE
    Replies: 0
    Last Post: 01-21-2008, 01:40 PM
  4. NON-WORKING tablet PC---solution inside--
    By soysanti in forum OLD Newbie Area
    Replies: 6
    Last Post: 01-13-2008, 01:56 AM
  5. Replies: 4
    Last Post: 12-28-2007, 08:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •