![](https://secure.gravatar.com/avatar/1ab2fcee545e82d972b21b320377dce7.jpg?s=120&d=mm&r=g)
Hi devs! This is my first post to the discussion list! Has anyone tried to build numpy with python3.7.0a3? I get the following gcc errors during compile: . . . compiling C sources C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC compile options: '-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/local/include/python3.7m -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -c' gcc: numpy/random/mtrand/mtrand.c numpy/random/mtrand/mtrand.c: In function ‘__Pyx__ExceptionSave’: numpy/random/mtrand/mtrand.c:40970:19: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’? *type = tstate->exc_type; ^~ . . . error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/local/include/python3.7m -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -c numpy/random/mtrand/mtrand.c -o build/temp.linux-x86_64-3.7/numpy/random/mtrand/mtrand.o -MMD -MF build/temp.linux-x86_64-3.7/numpy/random/mtrand/mtrand.o.d" failed with exit status 1 Version info: ------------- gcc --version: gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 2017040 numpy version: 1.15.0.dev0+d233e1f The same error comes up when building via pip. I don't know enough about the underlying C code to know how to debug this. Any help would be greatly appreciated! Cheers, -- Hannes Breytenbach PhD Candidate South African Astronomical Observatory +27 82 726 9311
![](https://secure.gravatar.com/avatar/97c543aca1ac7bbcfb5279d0300c8330.jpg?s=120&d=mm&r=g)
Try upgrading cython? On Fri, Dec 15, 2017 at 2:11 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
-- Nathaniel J. Smith -- https://vorpus.org
![](https://secure.gravatar.com/avatar/1ab2fcee545e82d972b21b320377dce7.jpg?s=120&d=mm&r=g)
I don't think this is a cython version issue - cloned the latest version from git yesterday... python3.7 -c "import cython; print(cython.__version__)" 0.28a0 ----- Original Message ----- From: "Nathaniel Smith" <njs@pobox.com> To: "Discussion of Numerical Python" <numpy-discussion@python.org> Sent: Friday, December 15, 2017 12:30:48 PM Subject: Re: [Numpy-discussion] building numpy with python3.7 Try upgrading cython? On Fri, Dec 15, 2017 at 2:11 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
-- Nathaniel J. Smith -- https://vorpus.org _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion !DSPAM:5a33a46a14261384311406!
![](https://secure.gravatar.com/avatar/97c543aca1ac7bbcfb5279d0300c8330.jpg?s=120&d=mm&r=g)
On Fri, Dec 15, 2017 at 2:42 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
It is a cython version issue: https://github.com/cython/cython/issues/1955 It's supposed to be fixed though, so I don't know why you it isn't working for you. Are you sure that cython is installed in the same virtualenv as you're using to build numpy? If you were using a numpy sdist then it would make sense because we include the pre-generated .c files in the sdists instead of running cython, but given that you're building from a numpy checkout I dunno. -n -- Nathaniel J. Smith -- https://vorpus.org
![](https://secure.gravatar.com/avatar/8744048060e5931c500d3c9d1ecb997e.jpg?s=120&d=mm&r=g)
I have been building numpy master with CPython master but am also using cython master. My not-pretty script for doing this is: #! /usr/bin/bash set -e TARGET_ENV=bleeding OSPATH=~/source/other_source/ pushd $OSPATH/cpython/ git pull git clean -xfd ./configure make -j 9 ./python -m venv --copies --clear ~/.virtualenvs/$TARGET_ENV popd source ~/.virtualenvs/$TARGET_ENV/bin/activate master_build () { git checkout master git pull git clean -xfd pip install -v . } pushd $OSPATH/cython master_build popd pushd $OSPATH/numpy master_build popd Tom On Fri, Dec 15, 2017 at 5:54 AM Nathaniel Smith <njs@pobox.com> wrote:
![](https://secure.gravatar.com/avatar/1ab2fcee545e82d972b21b320377dce7.jpg?s=120&d=mm&r=g)
OK, thanks for the link to the issue. I'm not using virtual environments - I built python3.7 (and 2.7) with the `make altinstall` method. I managed to get the numpy build working on 3.7 by removing the `random/mtrand/mtrand.c` file so that it gets (re-)generated during the build using the latest cython version. Thanks for the help! ----- Original Message ----- From: "Nathaniel Smith" <njs@pobox.com> To: "Discussion of Numerical Python" <numpy-discussion@python.org> Sent: Friday, December 15, 2017 12:53:39 PM Subject: Re: [Numpy-discussion] building numpy with python3.7 On Fri, Dec 15, 2017 at 2:42 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
It is a cython version issue: https://github.com/cython/cython/issues/1955 It's supposed to be fixed though, so I don't know why you it isn't working for you. Are you sure that cython is installed in the same virtualenv as you're using to build numpy? If you were using a numpy sdist then it would make sense because we include the pre-generated .c files in the sdists instead of running cython, but given that you're building from a numpy checkout I dunno. -n -- Nathaniel J. Smith -- https://vorpus.org _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion !DSPAM:5a33a9d014269019821239!
![](https://secure.gravatar.com/avatar/1ab2fcee545e82d972b21b320377dce7.jpg?s=120&d=mm&r=g)
Hi Chuck I'm using Cython 0.28a0. Hannes ----- Original Message ----- From: "Charles R Harris" <charlesr.harris@gmail.com> To: "Discussion of Numerical Python" <numpy-discussion@python.org> Sent: Tuesday, December 19, 2017 10:01:40 PM Subject: Re: [Numpy-discussion] building numpy with python3.7 On Mon, Dec 18, 2017 at 3:20 AM, Hannes Breytenbach < hannes@saao.ac.za > wrote: OK, thanks for the link to the issue. I'm not using virtual environments - I built python3.7 (and 2.7) with the `make altinstall` method. I managed to get the numpy build working on 3.7 by removing the `random/mtrand/mtrand.c` file so that it gets (re-)generated during the build using the latest cython version. Thanks for the help! Just to be sure, which Cython version is that? Chuck !DSPAM:5a39704114261779167816! _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion !DSPAM:5a39704114261779167816!
![](https://secure.gravatar.com/avatar/03f2d50ce2e8d713af6058d2aeafab74.jpg?s=120&d=mm&r=g)
Hello, After failing with several attempts to build numpy on python 3.7.0a4, the combo that worked with pip was cython 0.28a0 (current master) numpy 1.15.0.dev0 (current master) in a fresh, clean venv. Older cython (0.27.3 where the aforementioned issue seems to have been solved https://github.com/cython/cython/issues/1955) didn't help. Stable numpy 1.14.0 didn't seem to work even with cython master. This seems to be the same setup that Thomas mentioned, I mostly want to note that anything less doesn't seem to compile yet. András On Wed, Dec 20, 2017 at 9:15 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
![](https://secure.gravatar.com/avatar/03f2d50ce2e8d713af6058d2aeafab74.jpg?s=120&d=mm&r=g)
On Thursday, January 18, 2018, Charles R Harris <charlesr.harris@gmail.com> wrote:
On Thu, Jan 18, 2018 at 8:54 AM, Andras Deak <deak.andris@gmail.com>
wrote:
Yes, I did with my last attempts (in earlier attempts I did pull earlier versions from github but only before I realized I had to upgrade cython altogether). So that's probably it; sorry, I had no understanding of the workings of pip. I'll retry with cython stable and numpy from source, and only post again if I find something surprising in order to reduce further noise. Thanks, András
![](https://secure.gravatar.com/avatar/97c543aca1ac7bbcfb5279d0300c8330.jpg?s=120&d=mm&r=g)
Try upgrading cython? On Fri, Dec 15, 2017 at 2:11 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
-- Nathaniel J. Smith -- https://vorpus.org
![](https://secure.gravatar.com/avatar/1ab2fcee545e82d972b21b320377dce7.jpg?s=120&d=mm&r=g)
I don't think this is a cython version issue - cloned the latest version from git yesterday... python3.7 -c "import cython; print(cython.__version__)" 0.28a0 ----- Original Message ----- From: "Nathaniel Smith" <njs@pobox.com> To: "Discussion of Numerical Python" <numpy-discussion@python.org> Sent: Friday, December 15, 2017 12:30:48 PM Subject: Re: [Numpy-discussion] building numpy with python3.7 Try upgrading cython? On Fri, Dec 15, 2017 at 2:11 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
-- Nathaniel J. Smith -- https://vorpus.org _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion !DSPAM:5a33a46a14261384311406!
![](https://secure.gravatar.com/avatar/97c543aca1ac7bbcfb5279d0300c8330.jpg?s=120&d=mm&r=g)
On Fri, Dec 15, 2017 at 2:42 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
It is a cython version issue: https://github.com/cython/cython/issues/1955 It's supposed to be fixed though, so I don't know why you it isn't working for you. Are you sure that cython is installed in the same virtualenv as you're using to build numpy? If you were using a numpy sdist then it would make sense because we include the pre-generated .c files in the sdists instead of running cython, but given that you're building from a numpy checkout I dunno. -n -- Nathaniel J. Smith -- https://vorpus.org
![](https://secure.gravatar.com/avatar/8744048060e5931c500d3c9d1ecb997e.jpg?s=120&d=mm&r=g)
I have been building numpy master with CPython master but am also using cython master. My not-pretty script for doing this is: #! /usr/bin/bash set -e TARGET_ENV=bleeding OSPATH=~/source/other_source/ pushd $OSPATH/cpython/ git pull git clean -xfd ./configure make -j 9 ./python -m venv --copies --clear ~/.virtualenvs/$TARGET_ENV popd source ~/.virtualenvs/$TARGET_ENV/bin/activate master_build () { git checkout master git pull git clean -xfd pip install -v . } pushd $OSPATH/cython master_build popd pushd $OSPATH/numpy master_build popd Tom On Fri, Dec 15, 2017 at 5:54 AM Nathaniel Smith <njs@pobox.com> wrote:
![](https://secure.gravatar.com/avatar/1ab2fcee545e82d972b21b320377dce7.jpg?s=120&d=mm&r=g)
OK, thanks for the link to the issue. I'm not using virtual environments - I built python3.7 (and 2.7) with the `make altinstall` method. I managed to get the numpy build working on 3.7 by removing the `random/mtrand/mtrand.c` file so that it gets (re-)generated during the build using the latest cython version. Thanks for the help! ----- Original Message ----- From: "Nathaniel Smith" <njs@pobox.com> To: "Discussion of Numerical Python" <numpy-discussion@python.org> Sent: Friday, December 15, 2017 12:53:39 PM Subject: Re: [Numpy-discussion] building numpy with python3.7 On Fri, Dec 15, 2017 at 2:42 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
It is a cython version issue: https://github.com/cython/cython/issues/1955 It's supposed to be fixed though, so I don't know why you it isn't working for you. Are you sure that cython is installed in the same virtualenv as you're using to build numpy? If you were using a numpy sdist then it would make sense because we include the pre-generated .c files in the sdists instead of running cython, but given that you're building from a numpy checkout I dunno. -n -- Nathaniel J. Smith -- https://vorpus.org _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion !DSPAM:5a33a9d014269019821239!
![](https://secure.gravatar.com/avatar/1ab2fcee545e82d972b21b320377dce7.jpg?s=120&d=mm&r=g)
Hi Chuck I'm using Cython 0.28a0. Hannes ----- Original Message ----- From: "Charles R Harris" <charlesr.harris@gmail.com> To: "Discussion of Numerical Python" <numpy-discussion@python.org> Sent: Tuesday, December 19, 2017 10:01:40 PM Subject: Re: [Numpy-discussion] building numpy with python3.7 On Mon, Dec 18, 2017 at 3:20 AM, Hannes Breytenbach < hannes@saao.ac.za > wrote: OK, thanks for the link to the issue. I'm not using virtual environments - I built python3.7 (and 2.7) with the `make altinstall` method. I managed to get the numpy build working on 3.7 by removing the `random/mtrand/mtrand.c` file so that it gets (re-)generated during the build using the latest cython version. Thanks for the help! Just to be sure, which Cython version is that? Chuck !DSPAM:5a39704114261779167816! _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion !DSPAM:5a39704114261779167816!
![](https://secure.gravatar.com/avatar/03f2d50ce2e8d713af6058d2aeafab74.jpg?s=120&d=mm&r=g)
Hello, After failing with several attempts to build numpy on python 3.7.0a4, the combo that worked with pip was cython 0.28a0 (current master) numpy 1.15.0.dev0 (current master) in a fresh, clean venv. Older cython (0.27.3 where the aforementioned issue seems to have been solved https://github.com/cython/cython/issues/1955) didn't help. Stable numpy 1.14.0 didn't seem to work even with cython master. This seems to be the same setup that Thomas mentioned, I mostly want to note that anything less doesn't seem to compile yet. András On Wed, Dec 20, 2017 at 9:15 AM, Hannes Breytenbach <hannes@saao.ac.za> wrote:
![](https://secure.gravatar.com/avatar/03f2d50ce2e8d713af6058d2aeafab74.jpg?s=120&d=mm&r=g)
On Thursday, January 18, 2018, Charles R Harris <charlesr.harris@gmail.com> wrote:
On Thu, Jan 18, 2018 at 8:54 AM, Andras Deak <deak.andris@gmail.com>
wrote:
Yes, I did with my last attempts (in earlier attempts I did pull earlier versions from github but only before I realized I had to upgrade cython altogether). So that's probably it; sorry, I had no understanding of the workings of pip. I'll retry with cython stable and numpy from source, and only post again if I find something surprising in order to reduce further noise. Thanks, András
participants (5)
-
Andras Deak
-
Charles R Harris
-
Hannes Breytenbach
-
Nathaniel Smith
-
Thomas Caswell