Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#23765 closed defect (worksforme)

Incomplete Python 2.6 installation (Snow leopard)

Reported by: gilles.lenfant@… Owned by: blb@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), michaelld (Michael Dickens)
Port: python26

Description

Hi,

Python 2.6 comes with an incomplete standard library. "hashlib" is not usable. As a consequence, I cannot install "mercurial". As I'm a MacPorts newbie, perhaps I missed something, but MacPorts is supposed to manage such dependencies.

glenfant@bidule:~
$ sudo port install python26
--->  Computing dependencies for python26
--->  Cleaning python26

glenfant@bidule:~
$ python2.6
Python 2.6.4 (r264:75706, Feb 16 2010, 02:42:21) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/hashlib.py", line 136, in <module>
    md5 = __get_builtin_constructor('md5')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5
>>> 

Change History (10)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Cc: mcalhoun@… added
Owner: changed from macports-tickets@… to blb@…
Port: python26 added

I am able to import hashlib with no problems. Something strange is going on with your install.

comment:2 Changed 15 years ago by gilles.lenfant@…

Hi,

  • upgraded Leopard to Snow Leopard on my Intel MacBook,
  • added XCode and Unix developer tools from the Snow Leopard DVD
  • removed completely /opt/local/*
  • installed Macports 1.8.2 for snow leopard / Intel
  • reinstalled what was formerly installed with Leopard

Is there something I missed ? Thanks for your fast reply.

comment:3 Changed 15 years ago by michaelld (Michael Dickens)

Cc: michaelld@… added

Cc Me!

comment:4 Changed 15 years ago by mf2k (Frank Schima)

That sounds good except I would download Xcode 3.2.1, which is the latest version. The Snow Leopard DVD only has version 3.2.

Did you modify your macports.conf file? Did you build with +universal or other variants?

comment:5 Changed 15 years ago by blb@…

Failure to build hashlib is frequently caused by oddities with openssl, so in addition to macsforever2000@'s questions, what is the result from running the following?

$ lipo -info /opt/local/lib/libcrypto.0.9.8.dylib

comment:6 Changed 15 years ago by gilles.lenfant@…

Many thanks again for your fast replies.

@macsforever2000-AT-macports.org:

  • I'll try again with your suggestion (latest XCode) and send feedback on this ticket.
  • I didn't change my macports.conf file, and did build everything with no special option

@blb-AT-macports.org:

$ lipo -info /opt/local/lib/libcrypto.0.9.8.dylib
Non-fat file: /opt/local/lib/libcrypto.0.9.8.dylib is architecture: i386

comment:7 Changed 15 years ago by gilles.lenfant@…

Ah, that's a lot better now after upgrading to XCode 3.2.1. And reinstalling MacPorts/Snow Leopard 1.8.2 from scratch. The docs maintainer should perhaps emphasize to use XCode 3.2.1 dowloaded from ADC rather than using the one that comes with Snow Leopard DVD.

After installing only python2.6 (with no option)

sudo port installed
  bzip2 @1.0.5_3+darwin (active)
  db46 @4.6.21_6 (active)
  expat @2.0.1_0 (active)
  fontconfig @2.8.0_0+macosx (active)
  freetype @2.3.12_0+macosx (active)
  gdbm @1.8.3_2 (active)
  gettext @0.17_4 (active)
  gperf @3.0.4_0 (active)
  libiconv @1.13.1_0 (active)
  ncurses @5.7_0+darwin_10 (active)
  ncursesw @5.7_0+darwin_10 (active)
  openssl @0.9.8l_0+darwin (active)
  pkgconfig @0.23_1 (active)
  python26 @2.6.4_0+darwin (active)
  readline @6.1.000_1+darwin (active)
  sqlite3 @3.6.22_0 (active)
  tcl @8.5.8_0+darwin (active)
  tk @8.5.8_0+darwin (active)
  Xft2 @2.1.14_0 (active)
  xorg-bigreqsproto @1.1.0_0 (active)
  xorg-inputproto @2.0_0 (active)
  xorg-kbproto @1.0.4_0 (active)
  xorg-libX11 @1.3.3_0 (active)
  xorg-libXau @1.0.5_0 (active)
  xorg-libXdmcp @1.0.3_0 (active)
  xorg-libXext @1.1.1_0 (active)
  xorg-libXScrnSaver @1.2.0_0 (active)
  xorg-renderproto @0.11_0 (active)
  xorg-scrnsaverproto @1.2.0_0 (active)
  xorg-util-macros @1.6.0_0 (active)
  xorg-xcmiscproto @1.2.0_0 (active)
  xorg-xextproto @7.1.1_0 (active)
  xorg-xf86bigfontproto @1.2.0_0 (active)
  xorg-xproto @7.0.16_0 (active)
  xorg-xtrans @1.2.5_0 (active)
  xrender @0.9.5_0 (active)
  zlib @1.2.3_4 (active)

Then I ran the unit tests

$ cd /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/test
$ python2.6 testall.py
(lots of noise before this conclusion)

313 tests OK.
18 tests failed:
    test_ctypes test_distutils test_gettext test_import test_linecache
    test_macostools test_posixpath test_repr test_shelve test_site
    test_sqlite test_tcl test_tempfile test_unicode_file test_urllib
    test_xmlrpc test_zipfile test_zipimport
34 tests skipped:
    test_al test_bsddb185 test_bsddb3 test_cd test_cl
    test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp
    test_codecmaps_kr test_codecmaps_tw test_curses test_dl test_epoll
    test_gl test_imageop test_imgfile test_largefile test_lib2to3
    test_linuxaudiodev test_normalization test_ossaudiodev test_pep277
    test_poll test_py3kwarn test_smtpnet test_socketserver
    test_startfile test_sunaudiodev test_timeout test_urllib2net
    test_urllibnet test_winreg test_winsound test_zipfile64
3 skips unexpected on darwin:
    test_lib2to3 test_dl test_bsddb185

But this seems to be fine for the Python apps I need.

comment:8 Changed 15 years ago by mf2k (Frank Schima)

Resolution: worksforme
Status: newclosed

So the original issue working for you now? I'll re-open the ticket if not.

comment:9 Changed 15 years ago by gilles.lenfant@…

Yes,

I installed other Pyhon based applications that groove and rock on top of MacPorts Python 2.6.

Quoting the installation manual, http://www.macports.org/install.php

Apple's Xcode Developer Tools (version 3.2.1 or later for Snow Leopard, 3.1.4 or
later for Leopard, or 2.5 for Tiger), found at the Apple Developer Connection
site or on your Mac OS X installation CDs/DVD. Ensure that the optional
components for command line development are installed ("Unix Development" in the
Xcode 3.x installer).

You should perhaps mention for other newcomers that the XCode 3.2 that comes with Snow Leopard DVD does not fit the job.

Close that ticket, have an excellent week-end and thanks again for your fast and efficient support.

comment:10 Changed 15 years ago by blb@…

If the previous lipo -info command now says that libcrypto.0.9.8.dylib is x86_64 then it actually sounds like you didn't fully clear out your old MacPorts when upgrading to 10.6, instead of this being an Xcode issue (and FWIW, 3.2 built python26 fine for me prior to 3.2.1 being released).

Note: See TracTickets for help on using tickets.