Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install numpy fails #136

Closed
urrut opened this issue Feb 7, 2016 · 51 comments
Closed

pip install numpy fails #136

urrut opened this issue Feb 7, 2016 · 51 comments

Comments

@urrut
Copy link

@urrut urrut commented Feb 7, 2016

Also scipy installation not working. But i can install another packages with pip like bpython, six, greenlet...

@Almtesh

This comment has been minimized.

Copy link

@Almtesh Almtesh commented Feb 22, 2016

I have the same problem with psutil. Does the error comes from gcc execution?

@urrut

This comment has been minimized.

Copy link
Author

@urrut urrut commented Feb 22, 2016

Yes error comes from gcc. And here is the error: numpy/core/src/private/npy_config.h:78:31: error: missing binary operator before token "("
#define TRIG_OK __GLIBC_PREREQ(2, 16)

@Almtesh

This comment has been minimized.

Copy link

@Almtesh Almtesh commented Feb 22, 2016

I get this :
psutil/_psutil_linux.c:12:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1

@Neo-Oli

This comment has been minimized.

Copy link
Member

@Neo-Oli Neo-Oli commented Feb 22, 2016

@Almtesh Try installing python-dev. apt install python-dev. It contains the Python.h library.
Psutil still doesn't seem to work but at least we get past this error now.

@Neo-Oli

This comment has been minimized.

Copy link
Member

@Neo-Oli Neo-Oli commented Apr 8, 2016

While this has previously failed for me, I can now install numpy with pip install numpy without error. I don't know what change caused this.
But when I try to import it it throws 'ImportError: dlopen failed: unknown reloc type 17 @ 0xb61a1644 (2957)'

@bobikaBo

This comment has been minimized.

Copy link

@bobikaBo bobikaBo commented Apr 11, 2016

I have the same issue as @Neo-Oli

@fornwall

This comment has been minimized.

Copy link
Member

@fornwall fornwall commented Apr 18, 2016

@Neo-Oli @bobikaBo The unknown reloc type 17 error was due to a misconfiguration of gcc - this has now been fixed in the 5.3.0-2 version of the gcc package, which you can update to with apt update && apt upgrade.

After doing this you need to rebuild any package you have built with the old gcc version. I think

pip install --upgrade  --force-reinstall numpy

will force a reinstallation of all dependencies.

Let me know how it works now!

@Neo-Oli

This comment has been minimized.

Copy link
Member

@Neo-Oli Neo-Oli commented Apr 19, 2016

I reinstalled python and all packages and now I get a new error:

$ python
Python 3.5.1 (default, Feb 29 2016, 01:52:42)
[GCC 4.9 20140827 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/core/__init__.py", line 14, in <module>
    from . import multiarray
SystemError: initialization of multiarray raised unreported exception
>>>

And what I observed by accident: if I import numpy twice, python segfaults.

@bobikaBo

This comment has been minimized.

Copy link

@bobikaBo bobikaBo commented Apr 19, 2016

@fornwall it is working on my phone (Nexus 5) now. Thank you.

Btw, is there a way how to install libatlas-base-dev?

@alextz

This comment has been minimized.

Copy link

@alextz alextz commented Apr 21, 2016

On a Marshmellow Nexus 5X I just apt install python-dev, and tried pip install numpy. There was a fuss about the pip version, so I did what the fuss said, pip install --upgrade pip and got

.
.
.
     File "/data/data/com.termux/files/usr/tmp/pip-build-nte5frkn/numpy/numpy/distutils/command/build_src.py", line 376, in generate_sources
        source = func(extension, build_dir)
      File "numpy/core/setup.py", line 654, in get_mathlib_info
        raise RuntimeError("Broken toolchain: cannot link a simple C program")
    RuntimeError: Broken toolchain: cannot link a simple C program

    ----------------------------------------
Command "/data/data/com.termux/files/usr/bin/python -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-build-nte5frkn/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-xfr3yxan-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-build-nte5frkn/numpy/

@elomatt

This comment has been minimized.

Copy link

@elomatt elomatt commented Apr 21, 2016

I am experiencing exactly the same symptoms as alextz, before and after apt install python-dev

@fornwall

This comment has been minimized.

Copy link
Member

@fornwall fornwall commented Apr 21, 2016

@alextz @elomatt Have you run apt install gcc to install gcc?

@alextz

This comment has been minimized.

Copy link

@alextz alextz commented Apr 22, 2016

apt install gcc did the trick, though it installed for python3.

@elomatt

This comment has been minimized.

Copy link

@elomatt elomatt commented Apr 22, 2016

Same here, thank you very much.

Matthew Aldous


From: alextz [notifications@github.com]
Sent: 22 April 2016 09:58
To: termux/termux-packages
Cc: Aldous M.R.E.; Mention
Subject: {Disarmed} Re: [termux/termux-packages] pip install numpy fails (#136)

apt install gcc did the trick, though it installed for python3.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com//issues/136#issuecomment-213338586

@jph00

This comment has been minimized.

Copy link

@jph00 jph00 commented May 2, 2016

I'm getting the same "multiarray initialization" error as this comment above from @Neo-Oli . I get it on two different devices - a Samsung tablet and an LG phone. Any ideas about what I could do to get more debugging info, or ideas for a workaround?
(This happens on Python3 BTW; on Python2 I can't get it to install at all...)

@exzombie

This comment has been minimized.

Copy link

@exzombie exzombie commented May 3, 2016

Another case of "multiarray initialization" error here. Could it be caused by python being compiled with a different gcc version (4.9) than the one installed by the gcc package (6.1) which is used for building extensions?

@exider

This comment has been minimized.

Copy link

@exider exider commented May 16, 2016

"Multiarray initialization" error here too.
On Samsung Galaxy note 3.
Does anyone solve this issue?

@tigran123

This comment has been minimized.

Copy link

@tigran123 tigran123 commented Sep 5, 2016

The current (Termux v0.40, 5 Sep 2016) state of this problem is as follows --- pip install numpy apparently succeeds, but trying to import numpy fails because of __mulodi4 symbol referenced by one of numpy's shared libraries.

$ pip install numpy
Collecting numpy
  Downloading numpy-1.11.1.zip (4.7MB)
    100% |████████████████████████████████| 4.7MB 228kB/s
Installing collected packages: numpy
  Running setup.py install for numpy ... done
Successfully installed numpy-1.11.1
$ python
Python 3.5.2 (default, Jul 19 2016, 10:10:11)
[GCC 4.9.x 20150123 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/core/__init__.py", line 21, in <module>
    from . import umath
ImportError: dlopen failed: cannot locate symbol "__mulodi4" referenced by "/data/data/com.termux/files/usr/lib/python3.5/site-packages/numpy/core/umath.cpython-35m-i386-linux-gnu.so"...
@its-pointless

This comment has been minimized.

Copy link
Contributor

@its-pointless its-pointless commented Sep 15, 2016

I got numpy to compile using LDFLAGS=" -lcompiler_rt" pip install numpy ...
Don't know if its any help. But it should deal with " __mulodi4"

@ahartikainen

This comment has been minimized.

Copy link

@ahartikainen ahartikainen commented Sep 18, 2016

I was able to compile numpy with pip succesfully.

First installed clang, python, python-dev, fftw with apt install. (Not sure if numpy uses the installed fftw)

apt update
apt install clang python python-dev fftw

And then install numpy with pip

LDFLAGS=" -lm -lcompiler_rt" pip install numpy

edit.
Also pandas, cython and bokeh are working. For pandas there is libmsgpack in apt, but not sure if that is needed for read and write msgpack files with pandas.

LDFLAGS=" -lm -lcompiler_rt" pip install pandas
LDFLAGS=" -lcompiler_rt" pip install cython
LDFLAGS=" -lcompiler_rt" pip install bokeh

@Neo-Oli Neo-Oli added the python label Oct 7, 2016
@safijari

This comment has been minimized.

Copy link

@safijari safijari commented Dec 1, 2016

@ahartikainen That worked for me. I did not have to install fftw.

@yydcool

This comment has been minimized.

Copy link

@yydcool yydcool commented Feb 22, 2017

Also works for python2.
I use

LDFLAGS=" -lm -lcompiler_rt" pip2 install numpy

If I get it right, -lm means link with libm.so, -lcompiler_rt means link with clang's compiler_rt.

@HJarausch

This comment has been minimized.

Copy link

@HJarausch HJarausch commented Jun 13, 2017

Can anybody please try to do
LDFLAGS=" -lm -lcompiler_rt" pkg install numpy -U

I get strange errors:
Broken toolchain: cannot link a simple C program

Many thanks for a comment,
Helmut

@ahartikainen

This comment has been minimized.

Copy link

@ahartikainen ahartikainen commented Jun 13, 2017

pkg to pip?

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jul 10, 2017

You have to must install clang compiler in Termux.

@sudhanshuptl

This comment has been minimized.

Copy link

@sudhanshuptl sudhanshuptl commented Jul 13, 2017

Hi guys I am trying to install numpy in termux.
But facing issue.

Clang and python developer is already installed.

I used this command
LDFLAGS=" -lm -lcompiler_rt" pip install numpy

Error:

File "/data/data/com.termux/files/usr/tmp/pip-build-i4vhsaxa/numpy/numpy/distutils/command/build_src.py", line 148, in run self.build_sources() File "/data/data/com.termux/files/usr/tmp/pip-build-i4vhsaxa/numpy/numpy/distutils/command/build_src.py", line 159, in build_sources self.build_library_sources(*libname_info) File "/data/data/com.termux/files/usr/tmp/pip-build-i4vhsaxa/numpy/numpy/distutils/command/build_src.py", line 294, in build_library_sources sources = self.generate_sources(sources, (lib_name, build_info)) File "/data/data/com.termux/files/usr/tmp/pip-build-i4vhsaxa/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 674, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program") RuntimeError: Broken toolchain: cannot link a simple C program ---------------------------------------- Command "/data/data/com.termux/files/usr/bin/python -u -c "import setuptools, tokenize;file='/data/data/com.termux/files/usr/tmp/pip-build-i4vhsaxa/numpy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-36v2rie9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-build-i4vhsaxa/numpy/

@Grimler91

This comment has been minimized.

Copy link
Member

@Grimler91 Grimler91 commented Jul 13, 2017

@sudhanshuptl, you can install from its-pointless repo instead. There's some instructions in the repo's readme as well as in termux's wiki.

@ahartikainen

This comment has been minimized.

Copy link

@ahartikainen ahartikainen commented Jul 13, 2017

Or use 1.12.

LDFLAGS=" -lm -lcompiler_rt" pip install numpy==1.12
@sudhanshuptl

This comment has been minimized.

Copy link

@sudhanshuptl sudhanshuptl commented Jul 14, 2017

Thanks ahartikainen
It's working .

@phcoder

This comment has been minimized.

Copy link
Contributor

@phcoder phcoder commented Aug 1, 2017

With newest termux it works however you need to invoke it as:
SHELL=$PREFIX/bin/sh pip install numpy

@yjw413

This comment has been minimized.

Copy link

@yjw413 yjw413 commented Aug 4, 2017

Thanks a lot! Before I read this issue comments, I had tried many ways for many times, including "apt install clang python python-dev", and "LDFLAGS=" -lm -lcompiler_rt" pip install numpy". when I running “apt install fftw; LDFLAGS=" -lm -lcompiler_rt" pip install numpy==1.12”, now it works.

so, that
apt install clang python python-dev fftw
LDFLAGS=" -lm -lcompiler_rt" pip install numpy==1.12 ` is the right way!

@yjw413

This comment has been minimized.

Copy link

@yjw413 yjw413 commented Aug 4, 2017

while I'm still failed to installing "scipy".

@Grimler91

This comment has been minimized.

@var23rav

This comment has been minimized.

Copy link

@var23rav var23rav commented Aug 23, 2017

Make sure your pip and virtualenv is up-to-date..
I face similar issue, but once i updated the them; Its start working fine.
(I face one more issue like, even after i install packages using pip... it wasn't listing in pip freeze )

@martmists

This comment has been minimized.

Copy link

@martmists martmists commented Sep 11, 2017

For some reason it stopped working after setting zsh as my main shell, not sure if zsh or oh-my-zsh bug, but using @phcoder's solution it worked

@shashank-simha

This comment has been minimized.

Copy link

@shashank-simha shashank-simha commented Nov 1, 2017

Hello I tried installing numpy using the command
pip install numpy
but it throws an error


$ pip install numpy
Collecting numpy
  Using cached numpy-1.13.3.zip
Installing collected packages: numpy
  Running setup.py install for numpy ... error
    Complete output from command /data/data/com.termux/files/usr/bin/python -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-gxs3xa6q-record/install-record.txt --single-version-externally-managed --compile:
    Running from numpy source directory.

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install numpy`   (last NumPy release on PyPi)


    blas_opt_info:
    blas_mkl_info:
      libraries mkl_rt not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    blis_info:
      libraries blis not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    openblas_info:
      libraries openblas not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    atlas_3_10_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    atlas_3_10_blas_info:
      libraries satlas not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    atlas_blas_info:
      libraries f77blas,cblas,atlas not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    /data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/system_info.py:572: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      self.calc_info()
    blas_info:
      libraries blas not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    /data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/system_info.py:572: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      self.calc_info()
    blas_src_info:
      NOT AVAILABLE

    /data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/system_info.py:572: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      self.calc_info()
      NOT AVAILABLE

    /data/data/com.termux/files/usr/bin/sh: 1: svnversion: not found
    non-existing path in 'numpy/distutils': 'site.cfg'
    /data/data/com.termux/files/usr/bin/sh: 1: svnversion: not found
    F2PY Version 2
    lapack_opt_info:
    lapack_mkl_info:
      libraries mkl_rt not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    openblas_lapack_info:
      libraries openblas not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas,tatlas not found in /data/data/com.termux/files/usr/lib
      libraries lapack_atlas not found in /data/data/com.termux/files/usr/lib
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
      libraries satlas,satlas not found in /data/data/com.termux/files/usr/lib
      libraries lapack_atlas not found in /data/data/com.termux/files/usr/lib
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in /data/data/com.termux/files/usr/lib
      libraries lapack_atlas not found in /data/data/com.termux/files/usr/lib
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
      libraries f77blas,cblas,atlas not found in /data/data/com.termux/files/usr/lib
      libraries lapack_atlas not found in /data/data/com.termux/files/usr/lib
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    lapack_info:
      libraries lapack not found in ['/data/data/com.termux/files/usr/lib']
      NOT AVAILABLE

    /data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/system_info.py:572: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      self.calc_info()
    lapack_src_info:
      NOT AVAILABLE

    /data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/system_info.py:572: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      self.calc_info()
      NOT AVAILABLE

    /data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    running install
    running build
    running config_cc
    unifing config_cc, config, build_clib, build_ext, build commands --compiler options
    running config_fc
    unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
    running build_src
    build_src
    building py_modules sources
    creating build
    creating build/src.linux-armv7l-3.6
    creating build/src.linux-armv7l-3.6/numpy
    creating build/src.linux-armv7l-3.6/numpy/distutils
    building library "npymath" sources
    customize Gnu95FCompiler
    Could not locate executable gfortran
    Could not locate executable f95
    customize IntelFCompiler
    Could not locate executable ifort
    Could not locate executable ifc
    customize LaheyFCompiler
    Could not locate executable lf95
    customize PGroupFCompiler
    Could not locate executable pgfortran
    customize AbsoftFCompiler
    Could not locate executable f90
    Could not locate executable f77
    customize NAGFCompiler
    customize VastFCompiler
    customize CompaqFCompiler
    Could not locate executable fort
    customize IntelItaniumFCompiler
    Could not locate executable efort
    Could not locate executable efc
    customize IntelEM64TFCompiler
    customize GnuFCompiler
    Could not locate executable g77
    customize G95FCompiler
    Could not locate executable g95
    customize PathScaleFCompiler
    Could not locate executable pathf95
    don't know how to compile Fortran code on platform 'posix'
    C compiler: arm-linux-androideabi-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -Oz -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -Oz -fPIC

    compile options: '-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/data/data/com.termux/files/usr/include/python3.6m -c'
    arm-linux-androideabi-clang: _configtest.c

    failure.
    removing: _configtest.c _configtest.o
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/setup.py", line 392, in <module>
        setup_package()
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/setup.py", line 384, in setup_package
        setup(**metadata)
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/core.py", line 169, in setup
        return old_setup(**new_attr)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/command/install.py", line 62, in run
        r = self.setuptools_run()
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
        return distutils_install.run(self)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/command/build.py", line 47, in run
        old_build.run(self)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/data/data/com.termux/files/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/command/build_src.py", line 148, in run
        self.build_sources()
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/command/build_src.py", line 159, in build_sources
        self.build_library_sources(*libname_info)
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/command/build_src.py", line 294, in build_library_sources
        sources = self.generate_sources(sources, (lib_name, build_info))
      File "/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
        source = func(extension, build_dir)
      File "numpy/core/setup.py", line 674, in get_mathlib_info
        raise RuntimeError("Broken toolchain: cannot link a simple C program")
    RuntimeError: Broken toolchain: cannot link a simple C program

    ----------------------------------------
Command "/data/data/com.termux/files/usr/bin/python -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-gxs3xa6q-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-build-3uwksmiu/numpy/
$

the same thing is happening with pandas, scipy and pandas also
please fix this.
thank you

Sent from my Google Nexus 7 using FastHub

@tigran123

This comment has been minimized.

Copy link

@tigran123 tigran123 commented Nov 1, 2017

See here:

https://wiki.termux.com/wiki/Package_Management#its-pointless_.28live_the_dream.29

After registering the repository of @its-pointless you should do pkg install numpy and not pip install numpy, i.e. numpy is a Linux package, not a python package. Yes, there is also a python package of that name also, but you can't use it in Termux environment. You must install a Linux package which contains the python numpy package in itself.

@martmists

This comment has been minimized.

Copy link

@martmists martmists commented Nov 1, 2017

I still don't understand what the issue is as numpy seems to build fine on my OnePlus 3T

@kirAn-sAi

This comment has been minimized.

Copy link

@kirAn-sAi kirAn-sAi commented Nov 10, 2017

LDFLAGS=" -lm -lcompiler_rt" pip install numpy==1.12

It worked for me

Thank you @ahartikainen

@abbazs

This comment has been minimized.

Copy link

@abbazs abbazs commented Nov 15, 2017

struggled for so may days and almost gave up and then this works !

LDFLAGS=" -lm -lcompiler_rt" pip install numpy==1.12

@Grimler91

This comment has been minimized.

Copy link
Member

@Grimler91 Grimler91 commented Nov 26, 2017

I think we by now can conclude that numpy can be installed either through its-pointless repo (latest numpy version, recommended) or with LDFLAGS=" -lm -lcompiler_rt" pip install numpy==1.12.

@Grimler91 Grimler91 closed this Nov 26, 2017
@Shourai

This comment has been minimized.

Copy link

@Shourai Shourai commented Nov 29, 2017

For anyone scrolling down for the latest answer:

The following by @ahartikainen works for me (did not need fftw):
#136 (comment)

apt update
apt install clang python python-dev
LDFLAGS=" -lm -lcompiler_rt" pip install numpy
LDFLAGS=" -lm -lcompiler_rt" pip install pandas

I am running numpy 1.13.3 and pandas 0.21.0 (which requires numpy) together with python 3.6.3.

@AbsarF

This comment has been minimized.

Copy link

@AbsarF AbsarF commented Nov 30, 2017

Managed to install python 3.6.3 , install numpy and scipy through pkg”@its-pointless”.
Trying to install pandas via LDFLAGS=”......
But getting error “No command ‘pip’ found”....
any clue ?
Would like to install pandas, sklearn and other libs...
Please help..thanks in advance...

@Grimler91

This comment has been minimized.

Copy link
Member

@Grimler91 Grimler91 commented Nov 30, 2017

@AbsarF sounds like python hasn't been installed correctly. Try reinstalling with apt update && apt install python --reinstall

@AbsarF

This comment has been minimized.

Copy link

@AbsarF AbsarF commented Nov 30, 2017

Worked like a charm 😀 many thanks @Grimler91

@wrecodde

This comment has been minimized.

Copy link

@wrecodde wrecodde commented Dec 22, 2017

Followed the steps listed here but numpy still fails to install.

RuntimeError: Broken toolchain: cannot link a simple C program

@tigran123

This comment has been minimized.

Copy link

@tigran123 tigran123 commented Dec 22, 2017

The proper manual for install numpy and scipy is here:

https://wiki.termux.com/wiki/Package_Management#its-pointless_.28live_the_dream.29

@termux termux locked as resolved and limited conversation to collaborators Dec 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.