heroku-buildpack-scipy icon indicating copy to clipboard operation
heroku-buildpack-scipy copied to clipboard

ImportError: Numerical Python (NumPy) is not installed.

Open andrecp opened this issue 9 years ago • 5 comments

Hello, I a trying to use the buildpack in my heroku project.

My requirements.txt has

numpy==1.8.1
scipy==0.14.0
scikit-learn==0.17b1

I am using python-2.7.10

I've done

heroku buildpacks:set https://github.com/thenovices/heroku-buildpack-scipy

I get

ImportError: Numerical Python (NumPy) is not installed.

I got some error in the process like

-----> Downloading BLAS/LAPACK/ATLAS/Fortran binaries.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
Traceback (most recent call last):
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 81, in <module>
    main()
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 77, in main
    grep(**kwargs)
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 45, in grep
    r = Requirements(reqfile)
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 27, in __init__
    self.load(reqfile)
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 38, in load
    for requirement in parse_requirements(reqfile, finder=finder, session=requests):
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/req/req_file.py", line 129, in parse_requirements
    isolated=options.isolated_mode if options else False,
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/req/req_install.py", line 92, in from_editable
    editable_req, default_vcs)
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/req/req_install.py", line 1045, in parse_editable
    url_no_extras
pip.exceptions.InstallationError: Directory '.' is not installable. File 'setup.py' not found.
Traceback (most recent call last):
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 81, in <module>
    main()
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 77, in main
    grep(**kwargs)
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 45, in grep
    r = Requirements(reqfile)
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 27, in __init__
    self.load(reqfile)
  File "/tmp/buildpack20151106-157-n5ixfp/vendor/pip-pop/pip-grep", line 38, in load
    for requirement in parse_requirements(reqfile, finder=finder, session=requests):
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/req/req_file.py", line 129, in parse_requirements
    isolated=options.isolated_mode if options else False,
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/req/req_install.py", line 92, in from_editable
    editable_req, default_vcs)
  File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/req/req_install.py", line 1045, in parse_editable
    url_no_extras
pip.exceptions.InstallationError: Directory '.' is not installable. File 'setup.py' not found.
remote:            /tmp/easy_install-g1b60o/numpy-1.10.1/_configtest.c:6: undefined reference to `exp'
remote:            collect2: error: ld returned 1 exit status
remote:            _configtest.o: In function `main':
remote:            /tmp/easy_install-g1b60o/numpy-1.10.1/_configtest.c:6: undefined reference to `exp'
remote:            collect2: error: ld returned 1 exit status

Any idea what I could do? Thanks

andrecp avatar Nov 06 '15 13:11 andrecp

I've tried python 2.7.8 and numpy==1.7.0 scipy==0.11.0 scikit-learn==0.13.1

but no joy...

If I go with

numpy==1.9.2
scipy==0.15.1

I get

Collecting numpy==1.9.2 (from -r requirements.txt (line 36))
         Downloading numpy-1.9.2.tar.gz (4.0MB)
           Running from numpy source directory.

but then

ollecting scipy==0.15.1 (from -r requirements.txt (line 37))
         Downloading scipy-0.15.1.tar.gz (11.4MB)
           Running from numpy source directory.
           /tmp/easy_install-qNpPQk/numpy-1.10.1/numpy/distutils/system_info.py:1651: 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.
             warnings.warn(AtlasNotFoundError.__doc__)
           /tmp/easy_install-qNpPQk/numpy-1.10.1/numpy/distutils/system_info.py:1660: 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.
             warnings.warn(BlasNotFoundError.__doc__)
           /tmp/easy_install-qNpPQk/numpy-1.10.1/numpy/distutils/system_info.py:1663: 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.
             warnings.warn(BlasSrcNotFoundError.__doc__)
           /bin/sh: 1: svnversion: not found
           non-existing path in 'numpy/distutils': 'site.cfg'
           /bin/sh: 1: svnversion: not found
           /tmp/easy_install-qNpPQk/numpy-1.10.1/numpy/distutils/system_info.py:1552: 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.
             warnings.warn(AtlasNotFoundError.__doc__)
           /tmp/easy_install-qNpPQk/numpy-1.10.1/numpy/distutils/system_info.py:1563: 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.
             warnings.warn(LapackNotFoundError.__doc__)
           /tmp/easy_install-qNpPQk/numpy-1.10.1/numpy/distutils/system_info.py:1566: 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.
             warnings.warn(LapackSrcNotFoundError.__doc__)
           /app/.heroku/python/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'define_macros'
             warnings.warn(msg)
           Could not locate executable gfortran
           Could not locate executable f95
           Could not locate executable ifort
           Could not locate executable ifc
           Could not locate executable lf95
           Could not locate executable pgfortran
           Could not locate executable f90
           Could not locate executable f77
           Could not locate executable fort
           Could not locate executable efort
           Could not locate executable efc
           Could not locate executable g77
           Could not locate executable g95
           Could not locate executable pathf95
           don't know how to compile Fortran code on platform 'posix'

andrecp avatar Nov 06 '15 13:11 andrecp

And my last attempt:

numpy==1.8.1
scipy==0.14.0
 ImportError: No module named numpy.distutils.core
           Complete output from command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-JxpeWb/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hAt4gU-record/install-record.txt --single-version-externally-managed --compile:
           Traceback (most recent call last):

             File "<string>", line 1, in <module>

             File "/tmp/pip-build-JxpeWb/scipy/setup.py", line 237, in <module>

               setup_package()

             File "/tmp/pip-build-JxpeWb/scipy/setup.py", line 225, in setup_package

               from numpy.distutils.core import setup

           ImportError: No module named numpy.distutils.core

andrecp avatar Nov 06 '15 14:11 andrecp

Running into this today w/- Python 3.5.2 numpy==1.9.2 scipy==0.15.1

iansprice avatar Dec 21 '16 03:12 iansprice

This buildpack doesn't support python 3

branliu0 avatar Dec 21 '16 18:12 branliu0

I'm all ears to this one...

simranjotsandhu avatar Apr 30 '18 20:04 simranjotsandhu