compiling py 2.7.3 with openssl

2012-06-09 Thread V N
RHEL 5.3 x86_64 / Python 2.7.3

compiled as shown below ==>

PYTHON=Python-2.7.3
tar xjf bin/$PYTHON.tar.bz2
cd $PYTHON
PYHOME=/usr/local/$PYTHON; export PYHOME
LDFLAGS="-L/usr/local/lib64"; export LDFLAGS
CPPFLAGS="-I/usr/local/include/ncurses -I/usr/local/include/readline 
-I/usr/local/include"; export CPPFLAGS
./configure --prefix=$PYHOME 1>"$PYTHON"_cfg.log 2>&1
make 1>"$PYTHON"_mk.log 2>&1
sudo make install 1>"$PYTHON"_inst.log 2>&1

able to install setuptools-0.6c11 and libraries such as nose, cx_Oracle, 
pyODBC, etc.

suppose I compile and install openssl (same thing happens with openssl 1.0.0x 
as well)

OPNSSL=openssl-1.0.1c
tar xzf bin/$OPNSSL.tar.gz
cd $OPNSSL
./config --prefix=/usr/local zlib-dynamic 1>"$OPNSSL"_cfg.log 2>&1
make 1>"$OPNSSL"_mk.log 2>&1
sudo make install 1>"$OPNSSL"_inst.log 2>&1

and change CPPFLAGS as
CPPFLAGS="...  -I/usr/local/include/openssl -I/usr/local/include"; export 
CPPFLAGS

I can compile python but when I trying to install setuptools-0.6c11, I get

[... setuptools-0.6c11]$ sudo -E $PYHOME/bin/python setup.py build install
running build
running build_py
running install
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 139, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 91, in 
__get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 139, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 91, in 
__get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 139, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 91, in 
__get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 139, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 91, in 
__get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 139, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 91, in 
__get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 139, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Python-2.7.3/lib/python2.7/hashlib.py", line 91, in 
__get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "setup.py", line 94, in 
scripts = scripts,
  File "/usr/local/Python-2.7.3/lib/python2.7/distutils/core.py", line 152, in 
setup
dist.run_commands()
  File "/usr/local/Python-2.7.3/lib/python2.7/distutils/dist.py", line 953, in 
run_commands
self.run_command(cmd)
  File "/usr/local/Python-2.7.3/lib/python2.7/distutils/dist.py", line 972, in 
run_command
cmd_obj.run()
  File "/export/home/myacc/setuptools-0.6c11/setuptools/command/install.py", 
line 76, in run
self.do_egg_install()
  File "/export/home/myacc/setuptools-0.6c11/setuptools/command/install.py", 
line 85, in do_egg_install
easy_install = self.distribution.get_command_class('easy_install')
  File "/export/home/myacc/setuptools-0.6c11/setuptools/dist.py", line 395, in 
get_command_class
self.cmdclass[command] = cmdclass = ep.load()
  File "/export/home/myacc/setuptools-0.6c11/pkg_resources.py", line 1954, in 
load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File 
"/export/home/myacc/setuptools-0.6c11/setuptools/command/easy_install.py", line 
21, in 
from setuptools.package_index import PackageIndex, parse_bdist_wininst
  File "/export/home/myacc/setuptools-0.6c11/setuptools/package_index.py", line 
10, in 
from md5 import md5
  File "/usr/local/Python-2.7.3/lib/python2.7/md5.py", line 10, in 
from hashl

py 2.7.1 & openssl

2011-03-30 Thread V N
I installed openssl-1.0.0d.tar.gz on my RHEL 5 box using:
 ./config --prefix=/usr/local --openssldir=/usr/local/openssl
shared zlib
 make
 sudo make install

Then I installed python 2.7.1 using
 PYHOME=/usr/local/Python-2.7.1; export PYHOME
 LD_RUN_PATH=$PYHOME/lib; export LD_RUN_PATH
 LDFLAGS="-L /usr/local/lib64 -L /usr/local/lib"; export
LDFLAGS
 CPPFLAGS="-I /usr/local/include -I /usr/local/include/
openssl"; export CPPFLAGS
 ./configure --enable-shared --prefix=$PYHOME > log_cfg 2>&1
 make > log_mk 2>&1
 sudo make install > log_mk_i 2>&1

I am trying to install
sudo $PYHOME/bin/python bin/ez_setup.py

and I get the following error:

Traceback (most recent call last):
  File "bin/ez_setup.py", line 67, in 
except ImportError: from md5 import md5
  File "/usr/local/Python-2.7.1/lib/python2.7/md5.py", line 10, in

from hashlib import md5
  File "/usr/local/Python-2.7.1/lib/python2.7/hashlib.py", line 136,
in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Python-2.7.1/lib/python2.7/hashlib.py", line 71, in
__get_builtin_constructor
import _md5
ImportError: No module named _md5

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py 2.7.1 & openssl

2011-03-31 Thread V N
Thank you for your response. Here's some more information:

RHEL 5.3 / x86_64,  using gcc

I am now compiling openssl-1.0.0d using:
./config --prefix=/usr/local --openssldir=/usr/local/openssl -fPIC
shared threads zlib
I do have the logs for config, make and make install. There are no
errors in any of them. When I run make test, there are no errors
reported. And, the following files are created in /usr/local/lib64:
libssl.a, libssl.so, libcrypto.a, libcrypto.so.  Also, the binary
openssl is created in the bin directory.

When I compile Python, I do not get any errors. In fact, I am able to
import hashlib, ssl, md5  and
>>> hashlib.md5


The issue is only with setup tools. I tried the following:

tar xzf bin/setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
$PYHOME/bin/python setup.py build

I tried to see exactly what fails in the install:
sudo $PYHOME/bin/python setup.py install_lib  <== works fine
sudo $PYHOME/bin/python setup.py install_headers <== works fine
sudo $PYHOME/bin/python setup.py install_scripts <== get ERROR

  File "setup.py", line 94, in 
scripts = scripts,
  File "/usr/local/Python-2.7.1/lib/python2.7/distutils/core.py", line
138, in setup
ok = dist.parse_command_line()
  File "/export/home/vnori/setuptools-0.6c11/setuptools/dist.py", line
271, in parse_command_line
result = _Distribution.parse_command_line(self)
  File "/usr/local/Python-2.7.1/lib/python2.7/distutils/dist.py", line
467, in parse_command_line
args = self._parse_command_opts(parser, args)
  File "/export/home/vnori/setuptools-0.6c11/setuptools/dist.py", line
590, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
  File "/usr/local/Python-2.7.1/lib/python2.7/distutils/dist.py", line
523, in _parse_command_opts
cmd_class = self.get_command_class(command)
  File "/export/home/vnori/setuptools-0.6c11/setuptools/dist.py", line
395, in get_command_class
self.cmdclass[command] = cmdclass = ep.load()
  File "/export/home/vnori/setuptools-0.6c11/pkg_resources.py", line
1954, in load
entry = __import__(self.module_name, globals(),globals(),
['__name__'])
  File "/export/home/vnori/setuptools-0.6c11/setuptools/command/
install_scripts.py", line 3, in 
from easy_install import get_script_args, sys_executable, chmod
  File "/export/home/vnori/setuptools-0.6c11/setuptools/command/
easy_install.py", line 12, in 
import sys, os.path, zipimport, shutil, tempfile, zipfile, re,
stat, random
  File "/usr/local/Python-2.7.1/lib/python2.7/tempfile.py", line 34,
in 
from random import Random as _Random
  File "/usr/local/Python-2.7.1/lib/python2.7/random.py", line 49, in

import hashlib as _hashlib
  File "/usr/local/Python-2.7.1/lib/python2.7/hashlib.py", line 136,
in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Python-2.7.1/lib/python2.7/hashlib.py", line 71, in
__get_builtin_constructor
import _md5
ImportError: No module named _md5

Any idea(s)?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py 2.7.1 & openssl

2011-03-31 Thread V N
Yes, _md5 is enabled but I get a very long list under

Failed to build these modules:
_bisect_codecs_cn _codecs_hk
_codecs_iso2022_codecs_jp _codecs_kr
_codecs_tw _collections   _csv
_ctypes_ctypes_test   _curses
_curses_panel  _elementtree   _functools
_hashlib   _heapq _hotshot
_io_json  _locale
_lsprof_multibytecodec_multiprocessing
_random_socket_sqlite3
_ssl   _struct_testcapi
array  audioopbinascii
bz2cmath  cPickle
crypt  cStringIO  datetime
fcntl  future_builtinsgrp
itertools  linuxaudiodev  math
mmap   nisoperator
ossaudiodevparser pyexpat
readline   resource   select
spwd   strop  syslog
termiostime   unicodedata
zlib

This list was empty earlier.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py 2.7.1 & openssl

2011-04-01 Thread V N
I tried all your suggestions. No success.

On Apr 1, 8:35 am, nirinA  wrote:
> hi,
>
> > Yes, _md5 is enabled but I get a very long list under
> >  Failed to build these modules:
> > ... list of mostly all extension modules ...
> > This list was empty earlier.
>
> at some point, the compilation failed to detect
> needed headers or libraries files.
> i suggest you to try something simple in order to
> see  what is wrong in the compilation step.
-- 
http://mail.python.org/mailman/listinfo/python-list


escape character / csv module

2010-07-01 Thread V N
string "\x00" has a length of 1.  When I use the csv module to write
that to a file

csv_f = csv.writer(file("test.csv","wb"),delimiter="|")
csv_f.writerow(["\x00","zz"])

The output file looks like this:
|zz

Is it possible to force the writer to write that string?
-- 
http://mail.python.org/mailman/listinfo/python-list