Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Announcement] Python2.7 for Maemo5

    Reply
    Page 6 of 10 | Prev |   4     5   6   7     8   | Next | Last
    MartinK | # 51 | 2014-04-20, 20:53 | Report

    Originally Posted by nahci13 View Post
    Hello all!
    I want installing python for example version 2.7 or 3.2 on my N900.
    I installed and every think is ok, but how I can new version installed set on default python to run?
    for example after install python v2.7 when I type in x-terminal "python" I see old version(2.5)! every time I must type "python2.7 xxx.py" for run?
    How I can replace new version with old version? when type and run "python" in x-terminal run python v2.7?

    Thank you
    Note that code that is working with 2.5 might not work with 2.7 and even less will work with 3.2 out of the box. That's also the reason for the python<version> commands, as applications might expect Python 2.5 as it is the default.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    AapoRantalainen | # 52 | 2014-04-21, 09:40 | Report

    Originally Posted by nahci13 View Post
    How I can replace new version with old version? when type and run "python" in x-terminal run python v2.7?
    As stated it might not be safe to do, but using terminal
    Code:
    root
    rm /usr/bin/python
    ln -s python2.7 /usr/bin/python
    exit
    Explanation: /usr/bin/python is symlink to the python2.5 (you can see that with 'ls -al /usr/bin/python'). rm deletes old symlink, and ln -s creates it again but pointing to the python2.7

    ---
    Better way is to start your script.py -file with row:
    Code:
    #! /usr/bin/env python2.7
    And then 'chmod +x script.py' it and start it with './script.py', or if it is in the path just 'script.py'.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 5 Users Say Thank You to AapoRantalainen For This Useful Post:
    Estel, mr_pingu, nahci13, peterleinchen, pichlo

     
    marmistrz | # 53 | 2014-04-21, 11:25 | Report

    Or use
    Code:
    python2.7 /path/to/script.py

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to marmistrz For This Useful Post:
    mr_pingu, nahci13

     
    Android_808 | # 54 | 2014-04-21, 12:58 | Report

    In the long term, when more packages require 2.7 or 3.x the default python symlink would be updated but as for now the env option is probably the best to avoid breaking other apps.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Android_808 For This Useful Post:
    Estel

     
    marmistrz | # 55 | 2014-04-22, 11:47 | Report

    Originally Posted by Android_808 View Post
    In the long term, when more packages require 2.7 or 3.x the default python symlink would be updated but as for now the env option is probably the best to avoid breaking other apps.
    First libraries such as pyqt or pyside would have to be build against 2.7 (as python2 and python3 aren't compatible)

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to marmistrz For This Useful Post:
    mr_pingu

     
    Xagoln | # 56 | 2014-06-24, 03:44 | Report

    Does anyone have pip working on N900? I'd like to install an app called 'jrnl' which is available through pip.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    misiak | # 57 | 2014-06-27, 14:29 | Report

    https://hackerone.com/reports/12297 - security issue found in python (2.7 and newer), there is also code which can check if our version is vulnerable (I don't have 2.7 on my device I think, so I cannot test your build) and patch available.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to misiak For This Useful Post:
    mr_pingu, peterleinchen

     
    marmistrz | # 58 | 2014-09-04, 18:07 | Report

    Is this normal?

    Code:
    $ sudo apt-get install python2.7
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      python2.7-minimal
    Suggested packages:
      python2.7-doc binutils binfmt-support
    The following NEW packages will be installed:
      python2.7 python2.7-minimal
    0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
    Need to get 0B/4098kB of archives.
    After this operation, 15,2MB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Selecting previously deselected package python2.7-minimal.
    (Reading database ... 52018 files and directories currently installed.)
    Unpacking python2.7-minimal (from .../python2.7-minimal_2.7.3~rc2-2.1-maemo9_armel.deb) ...
    Selecting previously deselected package python2.7.
    Unpacking python2.7 (from .../python2.7_2.7.3~rc2-2.1-maemo9_armel.deb) ...
    Setting up python2.7-minimal (2.7.3~rc2-2.1-maemo9) ...
    python2.7: can't open file '/usr/lib/python2.7/py_compile.py': [Errno 2] No such file or directory
    Linking and byte-compiling packages for runtime python2.7...
    INFO: using unknown version '/usr/bin/python2.7' (debian_defaults not up-to-date?)
    rmdir /var/lib/python
    Setting up python2.7 (2.7.3~rc2-2.1-maemo9) ...
    python2.7: can't open file '/usr/lib/python2.7/py_compile.py': [Errno 2] No such file or directory
    and after installing `import ssl` fails (ssl not defined)

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by marmistrz; 2014-09-04 at 18:40.

     
    disappear | # 59 | 2014-09-05, 11:30 | Report

    HI Marmistrz,i haven't any problems with installing python2.7,but i install two packages python2.7-minimal and python2.7-examples,why you don't try with:
    sudo gainroot
    mkdir -p /usr/lib/python2.7
    apt-get install --reinstall python2.7-minimal
    apt-get install python2.7-examples
    for now only with this i can help you

    regards

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by disappear; 2014-09-05 at 13:57.

     
    marmistrz | # 60 | 2014-09-05, 14:46 | Report

    OK, noticed that py_compile.py is in /usr/lib/python2.7/python2.7

    removed the package, moved /usr/lib/python2.7 and install back again, worked like charm. Seems like bug in postinst or somewhere else.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by marmistrz; 2014-09-05 at 17:31.

     
    Page 6 of 10 | Prev |   4     5   6   7     8   | Next | Last
vBulletin® Version 3.8.8
Normal Logout