1

I am trying to deploy a small website I've been working on using Heroku.

When I run the 'git push heroku master' command from the terminal, however, the following import error message comes up:

ImportError: No module named numpy

From what I understand, the error occurs when this process tries to install the CVXcanon module from the 'requirements.txt' file, which is dependent on numpy. I'm not sure how to resolve this issue.

A similar question was posted by someone a while back, however the solution provided involved manually installing the module dependency before proceeding with the remaining installation of 'requirement.txt' modules1

EDIT Here are the contents of the 'requirements.txt' file:

backports-abc==0.4
bokeh==0.12.1
certifi==2016.8.8
click==6.6
CVXcanon==0.1.1
cvxpy==0.4.3
dill==0.2.5
ecos==2.0.4
fastcache==1.0.2
Flask==0.11.1
futures==3.0.5
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
multiprocess==0.70.4
numpy==1.11.1
pandas==0.18.1
pandas-datareader==0.2.1
patsy==0.4.1
python-dateutil==2.5.3
pytz==2016.6.1
PyYAML==3.11
requests==2.11.0
requests-file==1.4
scipy==0.18.0
scs==1.2.6
singledispatch==3.4.0.3
six==1.10.0
statsmodels==0.6.1
toolz==0.8.0
tornado==4.4.1
Werkzeug==0.11.10
WTForms==2.1

And here's the error message in more detail:

 Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-build-hyC0O_/CVXcanon/setup.py", line 4, in <module>
remote:                import numpy
remote:            ImportError: No module named numpy
remote:            
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hyC0O_/CVXcanon/
maria saz
  • 191
  • 1
  • 10
  • Can you paste the contents of what you have in `requirements.txt`? – rdegges Aug 15 '16 at 17:33
  • Yes, I've just edited my post... As you'll see though everything's a bit clumsy... my requirements file seems to contain all my system packages, which I'm not sure how to resolve.. any advice would be very much appreciated! – maria saz Aug 15 '16 at 18:07
  • I can't get your requirements to actually install on Heroku, things error out. If I just install numpy by itself in requirements, however, things work fine. It looks like one (or maybe more?) of your dependencies is not compatible with Heroku due to requiring some C libraries that Heroku doesn't have installed. – rdegges Aug 15 '16 at 18:19
  • Is there another way of installing requirements onto Heroku, perhaps manually one by one? I think the issue is specifically with the dependency "CVXcannon" which requires numpy to already be installed for its setup? – maria saz Aug 15 '16 at 18:34
  • You can remove that dependency from requirements.txt, then re-push your code to Heroku. If that works, you'll know that dependency is the issue. You can do this to help narrow down where the problem package is. – rdegges Aug 15 '16 at 18:44
  • I must be doing something utterly wrong... even when leaving a single dependency in the requirements.txt file, say pandas, the exact same error occurs? (Sorry to be weighing on you with all these questions) – maria saz Aug 15 '16 at 20:38
  • Try to create a new Heroku app and give it a go from there. Maybe you have some odd variables in the environment or a custom buildpack? – rdegges Aug 15 '16 at 20:39
  • Thanks for the advice @rdegges! It's working now :) – maria saz Aug 16 '16 at 16:37

0 Answers0