[Numpy-discussion] Status of NumPy and Python 3.3

Ondřej Čertík ondrej.certik@gmail....
Sun Jul 29 16:45:21 CDT 2012

Hi Ronan!

On Sun, Jul 29, 2012 at 2:27 PM, Ronan Lamy <ronan.lamy@gmail.com> wrote:
> Le samedi 28 juillet 2012 à 18:09 -0700, Ondřej Čertík a écrit :
>> So now the PR actually seems to work. The rest of the failures are here:
>> https://gist.github.com/3195520
> I wanted to have a look at the import errors in your previous gist. How
> did you get rid of them? I can't even install numpy on 3.3 as setup.py

Do you mean this gist:


? I have incorrectly run the tests from the wrong directory and numpy
was picking up the wrong files to import --- I think either from the
numpy directory directly (there is a check for this though), or from
numpy/core or something, I don't remember anymore. So I then run the
tests from /tmp and posted the correct result into the same gist as a
new commit:


> chokes on 'import numpy.distutils.core':
> (py33)ronan@ronan-desktop:~/dev/numpy$ python setup.py install
> Converting to Python3 via 2to3...
> Running from numpy source directory.
> /home/ronan/dev/numpy/py33/lib/python3.3/distutils/__init__.py:16:
> ResourceWarning: unclosed file <_io.TextIOWrapper
> name='/usr/local/lib/python3.3/distutils/__init__.py' mode='r'
> encoding='UTF-8'>
>   exec(open(os.path.join(distutils_path, '__init__.py')).read())
> Traceback (most recent call last):
>   File "setup.py", line 214, in <module>
>     setup_package()
>   File "setup.py", line 191, in setup_package
>     from numpy.distutils.core import setup
>   File "/home/ronan/dev/numpy/build/py3k/numpy/distutils/core.py", line
> 25, in <module>
>     from numpy.distutils.command import config, config_compiler, \
>   File
> "/home/ronan/dev/numpy/build/py3k/numpy/distutils/command/__init__.py",
> line 17, in <module>
>     __import__('distutils.command',globals(),locals(),distutils_all)
> ImportError: No module named 'distutils.command.install_clib'
> Actually, I don't even understand how this __import__() call can work on
> earlier versions, nor what it's trying to achieve.

That's weird, I've never seen this error before. Try to install numpy
using your regular Python like this:

python setup.py install --prefix /tmp

let's say. If it works, then something is wrong with your Python 3.3
installation. If you want to reproduce my setup, checkout my repo:


and from inside it, run:

SPKG_LOCAL=`pwd`/xx MAKEFLAGS="-j4" sh spkg-install

(adjust the "-j4" flag, or remove it). You need a few packages
installed like zlib1g-dev and so on. Then install virtualenv by
downloading the tar.gz and from inside it doing
"/path/to/my/python-3.3/xx/bin/python3.3 setup.py install". Add the
/path/to/my/python-3.3/xx/bin/virtualenv-3.3 into your $PATH.


rm -rf $HOME/py33
virtualenv-3.3 $HOME/py33
. $HOME/py33/bin/activate

go to your numpy directory and do "python setup.py install". To run
tests, you also need to:

rm -rf $TMPDIR
mkdir $TMPDIR
tar xzf $tarballs/nose-1.1.2.tar.gz
cd nose-1.1.2
python setup.py install

using the virtualenv environment. When I tried to install nose into
the python installation in python-3.3./xx, then it failed...


More information about the NumPy-Discussion mailing list