Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2013-10-20 23:36:20

  morfik - Cenzor wirtualnego świata

morfik
Cenzor wirtualnego świata
Skąd: ze WSI
Zarejestrowany: 2011-09-15
Serwis

[SOLVED] live-build i domyślny python w systemie

Chciałem sobie zbudować nieco bardziej aktualny obraz live na pena ale dostałem taki komunikat:

Kod:

# lb build
[2013-10-20 22:53:29] lb build 
P: Executing auto/build script.
[2013-10-20 22:53:29] lb build noauto
P: live-build 4.0~alpha27
P: Building config tree for a debian/jessie/i386 system
[2013-10-20 22:53:30] lb bootstrap 
P: Setting up cleanup function
[2013-10-20 22:53:30] lb bootstrap_cache restore
P: Restoring bootstrap stage from cache...
[2013-10-20 22:53:49] lb bootstrap_debootstrap 
  File "/usr/lib/live/build/bootstrap_debootstrap", line 46
    print('E: config/build - no such file', file=sys.stderr)
                                                ^
SyntaxError: invalid syntax
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists...
Building dependency tree...
Reading state information...

Jestem podpięty pod ten śmieszny system mailingowy debiana live i tam był podobny przypadek. Z tym, że koleś napisał:

The Python code "print('E: config/build - no such file', file=sys.stderr)"
works fine for me in python 3.3.2, but the default python on my system is
2.7.5, and it doesn't work there.[/quote]
Cały bug tutaj: http://lists.debian.org/debian-live/2013/10/msg00051.html

Mam obecnie zainstalowane dwa pythony — 2.7 i 3.3.

Kod:

root:/media/Server/live# dpkg -l | grep python2
ii  libpython2.7:i386                                           2.7.5-8                             i386         Shared Python runtime library (version 2.7)
ii  libpython2.7-minimal:i386                                   2.7.5-8                             i386         Minimal subset of the Python language (version 2.7)
ii  libpython2.7-stdlib:i386                                    2.7.5-8                             i386         Interactive high-level object-oriented language (standard library, version 2.7)
ii  python2.7                                                   2.7.5-8                             i386         Interactive high-level object-oriented language (version 2.7)
ii  python2.7-minimal                                           2.7.5-8                             i386         Minimal subset of the Python language (version 2.7)

root:/media/Server/live# dpkg -l | grep python3
ii  libpython3-stdlib:i386                                      3.3.2-17                            i386         interactive high-level object-oriented language (default python3 version)
ii  libpython3.3:i386                                           3.3.2-7                             i386         Shared Python runtime library (version 3.3)
ii  libpython3.3-minimal:i386                                   3.3.2-7                             i386         Minimal subset of the Python language (version 3.3)
ii  libpython3.3-stdlib:i386                                    3.3.2-7                             i386         Interactive high-level object-oriented language (standard library, version 3.3)
ii  python3                                                     3.3.2-17                            i386         interactive high-level object-oriented language (default python3 version)
ii  python3-minimal                                             3.3.2-17                            i386         minimal subset of the Python language (default python3 version)
ii  python3-uno                                                 1:4.1.1-1+b1                        i386         Python-UNO bridge
ii  python3.3                                                   3.3.2-7                             i386         Interactive high-level object-oriented language (version 3.3)
ii  python3.3-minimal                                           3.3.2-7                             i386         Minimal subset of the Python language (version 3.3)

W /usr/bin mam:

Kod:

# ls -al /usr/bin/python*
lrwxrwxrwx 1 root root    9 Oct 20 22:33 /usr/bin/python -> python2.7*
lrwxrwxrwx 1 root root    9 Sep 13 23:40 /usr/bin/python2 -> python2.7*
-rwxr-xr-x 1 root root 3.1M Sep 17 21:32 /usr/bin/python2.7*
lrwxrwxrwx 1 root root    9 Sep 23 21:44 /usr/bin/python3 -> python3.3*
-rwxr-xr-x 2 root root 3.6M Sep 23 23:53 /usr/bin/python3.3*
-rwxr-xr-x 2 root root 3.6M Sep 23 23:53 /usr/bin/python3.3m*
lrwxrwxrwx 1 root root   10 Sep 23 21:44 /usr/bin/python3m -> python3.3m*

Zgodnie z tym co piszą na wiki archa: https://wiki.archlinux.org/index.php/python — miałem poczynić poniższe kroki by domyślnym pythonem w systemie był ten 3.3 zamiast 2.7:

Kod:

# cd /root
root:~# mkdir bin
root:~# ln -s /usr/bin/python3.3 ~/bin/python
root:~# tree /root/bin/
/root/bin/
└── python3.3 -> /usr/bin/python3.3

0 directories, 1 file
root:~# export PATH=~/bin:$PATH
root:~# echo $PATH
/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Myślałem, że to załatwi sprawę ale podczas próby zbudowania obrazu, dostałem znowu ten sam komunikat. Patrzę dalej na wiki archa i tam jest:

To check which python interpreter is being used by env, use the following command:

$ which python[/quote]
No to wpisałem mu powyższe polecenie:

Kod:

# which python
/usr/bin/python

Czyli nie używa tego linku w /root/bin.

Na wiki archa był jeszcze python2-config ale tutaj u mnie nie ma żadnego python + config w /usr/bin/ .

Jako, że w /usr/bin/ python jest podlinkowany pod 2.7 , to usunąłem to dowiązanie i i podlinkowałem go bezpośrednio do 3.3:

Kod:

# cd /usr/bin/
root:/usr/bin# rm python
root:/usr/bin# ln -s python3.3 python
root:/usr/bin# ls -al python*
lrwxrwxrwx 1 root root    9 Oct 20 23:09 python -> python3.3*
lrwxrwxrwx 1 root root    9 Sep 13 23:40 python2 -> python2.7*
-rwxr-xr-x 1 root root 3.1M Sep 17 21:32 python2.7*
lrwxrwxrwx 1 root root    9 Sep 23 21:44 python3 -> python3.3*
-rwxr-xr-x 2 root root 3.6M Sep 23 23:53 python3.3*
-rwxr-xr-x 2 root root 3.6M Sep 23 23:53 python3.3m*
lrwxrwxrwx 1 root root   10 Sep 23 21:44 python3m -> python3.3m*

Ale to też nie pomaga, z tym, że teraz dostaje nieco inny błąd przy budowaniu obrazu:

Kod:

# lb build
[2013-10-20 23:11:34] lb build 
P: Executing auto/build script.
[2013-10-20 23:11:34] lb build noauto
Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 28, in <module>
    import lsb_release
ImportError: No module named 'lsb_release'
P: live-build 4.0~alpha27
P: Building config tree for a debian/jessie/i386 system
[2013-10-20 23:11:34] lb bootstrap 
Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 28, in <module>
    import lsb_release
ImportError: No module named 'lsb_release'
P: Setting up cleanup function
[2013-10-20 23:11:34] lb bootstrap_cache restore
Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 28, in <module>
    import lsb_release
ImportError: No module named 'lsb_release'
P: Restoring bootstrap stage from cache...
[2013-10-20 23:11:48] lb bootstrap_debootstrap 
Traceback (most recent call last):
  File "/usr/lib/live/build/bootstrap_debootstrap", line 156, in <module>
    main()
  File "/usr/lib/live/build/bootstrap_debootstrap", line 36, in main
    formatter_class = argparse.ArgumentDefaultsHelpFormatter
TypeError: __init__() got an unexpected keyword argument 'version'
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists...
Building dependency tree...
Reading state information...

Wersja live-build jest z experimentala bo z tą z testinga były jakieś problemy.

Kod:

# dpkg -l | grep live-build
ii  live-build                                                  4.0~alpha27-1                       all          Live System Build Components

Ostatni obraz budowałem jakiś czas temu i wszystko było w porządku ale to dziwne, że tej osobie z listy mailingowej się buduje na pythonie 3.3, a u mnie nie chce. xD Jakieś pomysły?

Ostatnio edytowany przez morfik (2013-11-04 18:29:58)

Offline

 

#2  2013-11-04 18:29:39

  morfik - Cenzor wirtualnego świata

morfik
Cenzor wirtualnego świata
Skąd: ze WSI
Zarejestrowany: 2011-09-15
Serwis

Re: [SOLVED] live-build i domyślny python w systemie

Wygląda na to, że problem został poprawiony w  live-build v. 4.0~alpha29-1 :

Kod:

Changes: 
 live-build (4.0~alpha29-1) experimental; urgency=low
 .
   * Updating to standards version 3.9.5.
   * Rewriting bootstrap_hooks in python.
   * Making various things in bootstrap manpages more consistent.
   * Also processing config/hooks/*.hook in bootstrap_hooks, if any.
   * Adding lb_bootstrap_hooks manpage.
   * Rewriting chroot_hooks in python.
   * Adding lb_chroot_hooks manpage.
   * Updating file suffixes of the internal default hooks.
   * Automatically symlink hooks upon creation of the configuration tree.
   * Updating configuration path in update-apt-file-cache.hook.chroot.
   * Rewriting binary_hooks in python.
   * Adding lb_binary_hooks manpage.
   * Rewriting source_hooks in python.
   * Adding lb_source_hooks manpage.
   * Adding see also entries in hooks manpages.
   * Moving python stubs to their own subdirectory within the source tree.
   * Manually adding --version to argparse in python stub since python 3.3
     dropped the version keyword.
   * Replacing os.link calls for hooks with shutil.copy to properly
     dereference symlinks in python stubs.

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
To nie jest tylko forum, to nasza mała ojczyzna ;-)

[ Generated in 0.007 seconds, 9 queries executed ]

Informacje debugowania

Time (s) Query
0.00015 SET CHARSET latin2
0.00005 SET NAMES latin2
0.00068 SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='18.216.104.106' WHERE u.id=1
0.00103 REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '18.216.104.106', 1732898196)
0.00025 SELECT * FROM punbb_online WHERE logged<1732897896
0.00067 SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=24446 AND t.moved_to IS NULL
0.00025 SELECT search_for, replace_with FROM punbb_censoring
0.00127 SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=24446 ORDER BY p.id LIMIT 0,25
0.00070 UPDATE punbb_topics SET num_views=num_views+1 WHERE id=24446
Total query time: 0.00505 s