Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Default configuartion for Python 2.7.3 in Ubuntu 12.04

  1. #1
    Join Date
    Nov 2011
    Beans
    6

    Default configuartion for Python 2.7.3 in Ubuntu 12.04

    I need to replace the default Python 2.7.3 installation on Ubuntu with an installation from source with --enable-shared add to the configuration options. I've been able to reinstall, but the problem is that the new installation doesn't seem to have everything the original default one had. Before I continue to piecemeal it all together, I thought I would ask: which configuration options are equivalent to the default install of Python 2.7.3? If I know that, I should just be able to add --enable-shared to the end of it, and be done (I hope).

  2. #2
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    What makes you think you need to do that? What you probably need to do is to install libpython, which is in a separate package.
    「明後日の夕方には帰ってるからね。」


  3. #3
    Join Date
    Nov 2011
    Beans
    6

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    Bachstelze,

    The original problem I am trying to solve is a python mismatch between mod_wgsi and my native python (2.7.2 vs 2.7.3) for a django application. I'm definitely a novice, but all of the research I've done seems to indicate that the best way around this is to install python from source with the --enable-shared option, and then to install mod_wgsi from source using the new python installation.

  4. #4
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    Can you provide links that say this? In particular, are they Ubuntu-specific? Python is a crucial part of Ubuntu, so if you want to tinker with it you should be certain it works.
    「明後日の夕方には帰ってるからね。」


  5. #5
    Join Date
    Nov 2011
    Beans
    6

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    Thanks for taking an interest in my problem.

    I've been working on this problem for a few days, and honestly can't remember everything that I tried. But I did try to get around it without a new Python installation first. This has been a last resort in desperation.

    Some of the links that helped bring me to the conclusion that I needed a new python installation with the --enable-shared option are:

    http://stackoverflow.com/questions/1...per-and-django

    which points to this discussion:
    https://groups.google.com/forum/?fro...gi/F5Wn4uWrQAg

    There is also this:
    http://code.google.com/p/modwsgi/wik...Level_Mismatch

    And I ended up trying to follow these instructions:
    http://cysec.org/content/compiling-m...m-python-build

    A few additional points:

    I am trying to run my django app in a virtualenv using virtualenvwrapper. Also, I'm not trying to set up a second python installation, just trying to replace the original. If there is a simpler way that works, I'm certainly willing to try it.

    I was originally following these instructions for setting up a Django site on a linode:
    http://library.linode.com/frameworks...tu-10.04-lucid

    Making slight changes because the documentation is a little old (for instance, you no longer have to create your own django.wsgi file because it produces wsgi.py for you).

    Any ideas?

  6. #6
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    And what is the problem you get when following that last link? Normally, you shouldn't get any version mismatch because all the packages in the repositories are compiled against other packages in the same repositories, so it all should fit. If it's really a version mismatch, it's probably a bug in the packages.
    「明後日の夕方には帰ってるからね。」


  7. #7
    Join Date
    Nov 2011
    Beans
    6

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    When I made a request to the django app part of my site, my Apache error log gave me something very similar to this (I am copying and pasting from a web page, so the dates are different):

    [Tue Aug 21 19:33:26 2012] [warn] mod_wsgi: Compiled for Python/2.7.2+.
    [Tue Aug 21 19:33:26 2012] [warn] mod_wsgi: Runtime using Python/2.7.3.
    ...
    [Tue Aug 21 19:33:26 2012] [error] python_init: Python version mismatch, expected '2.7.2+', found '2.7.3'.

    After this, I first tried just installing mod_wsgi from source, hoping that compiling it with 2.7.3 would be enough, but strangely I got the same error afterward.

  8. #8
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    EDIT: The problem seems to be with libapache2-mod-python. Recompiling it (and not mod-wsgi) according to instruction below seems to fix it (I no longer get the "mismatch" error messages).

    -------------------

    If you don't need this to work urgently, what you should do is probably report this as a bug and see what the developers say. https://help.ubuntu.com/community/ReportingBugs

    I find it weird, though, that recompiling wsgi failed to fix the problem, so perhaps you didn't compile it properly. Try this:

    1. Uninstall all wsgi related packages.
    2. Get the source package with: apt-get source mod-wsgi
    3. Install the build dependencies with: sudo apt-get build-dep mod-wsgi
    4. Move into the source package dir and build the binary packages: debuild

    Then after a while it will create a bunch of packages, which are identical to the packages form the repositories, except that they are compiled on your machine. Try installing them and see what happens. If it still doesn't work, you have a real problem...
    Last edited by Bachstelze; November 27th, 2012 at 12:43 AM.
    「明後日の夕方には帰ってるからね。」


  9. #9
    Join Date
    Nov 2011
    Beans
    6

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    Thank you, I will try this and report back.

    Any way for me to revert back to the original ubuntu python installation? Or do i need to start from scratch with a fresh install of ubuntu?

  10. #10
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Default configuartion for Python 2.7.3 in Ubuntu 12.04

    See my edit.

    Quote Originally Posted by LotsOfStuff View Post
    Any way for me to revert back to the original ubuntu python installation? Or do i need to start from scratch with a fresh install of ubuntu?
    It depends what exactly you have changed, but if you can afford to start over from scratch, it is of ourse the safest way to go if you are unsure.
    Last edited by Bachstelze; November 27th, 2012 at 12:52 AM.
    「明後日の夕方には帰ってるからね。」


Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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