Installing Requirements for Heroku Server - python

I am currently trying to set up a Flask webserver on Heroku, following the following instructions: http://virantha.com/2013/11/14/starting-a-simple-flask-app-with-heroku/
Right now I am trying to install requirements on a virtualenv so that I can deploy the app locally. However, when I run 'pip install -r requirements.txt', I get the following error log (including just the tail):
Using cached idna-2.1-py2.py3-none-any.whl
Collecting imread==0.5.1 (from -r requirements.txt (line 24))
Using cached imread-0.5.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/c3/nwlcwspn7l16n19lhzd7xky00000gn/T/pip-build-X2ZNNp/imread/setup.py", line 19, in <module>
import numpy as np
ImportError: No module named numpy
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/c3/nwlcwspn7l16n19lhzd7xky00000gn/T/pip-build-X2ZNNp/imread/
I tried fixing the errors by following the instructions at this thread: Can't install via pip because of egg_info error
but to no avail.
I'm wondering if anyone has any insights to offer for other things I can try, as I've been stuck on this for a few hours now.
Thanks!

Related

Pip Install Foundations

I'm working on a Twilio texting program I can't install foundations I keep getting this issue. I've already tried reinstalling pip, easy_setup, pip wheel, django, and python.
I have no idea why i'm still getting this error. I'm running Mac Osx
Collecting Foundations==2.1.0 (from -r requirements.txt (line 14))
Using cached https://files.pythonhosted.org/packages/d4/c4/341b76267c3969b46170f715524259c1c170992253cb7c425d746cb2e322/Foundations-2.1.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/l5/k0m1stsn5yz8x0sx_wj4z9qm0000gn/T/pip-install-xi0ft4n3/Foundations/setup.py", line 35, in <module>
_setEncoding()
File "/private/var/folders/l5/k0m1stsn5yz8x0sx_wj4z9qm0000gn/T/pip-install-xi0ft4n3/Foundations/setup.py", line 31, in _setEncoding
reload(sys)
NameError: name 'reload' is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l5/k0m1stsn5yz8x0sx_wj4z9qm0000gn/T/pip-install-xi0ft4n3/Foundations/
Foundations is only for Python 2.7.

django-numpy gives error with pip

I've been using django-numpy for some time now. But suddenly it gives an error, when I try to install it in a django project.
I've tried different approaches installing django-numpy - made a new venv - tried with another version og both django and django-numpy.
The error I get, when doing a pip install -r requirements.txt is:
Collecting django-numpy==1.0.1 (from -r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/35/b0/1f0be2e9c4df3b0736b09067dd041eb4475a6199b583428b241eb8576d7d/django-numpy-1.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-4qp99vp2/django-numpy/setup.py", line 6, in <module>
from pip.download import PipSession
ModuleNotFoundError: No module named 'pip.download'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-install-4qp99vp2/django-numpy/
I've tried installing different packages via requirements, with no problems. It's only django-numpy that gives an error?
I do not know if I should make an issue on django-numpy's github?

Install failed with Django-Chronograph by pip in django 1.10

Similar to this question but i got a different error.
I'm try to installing via pip with:
pip install django-chronograph
I'm using python 2.7 and a virtualenv
pip freeze
Django==1.10
django-backbone==0.2.3
django-jstemplate==1.1.1
gunicorn==18.0
MySQL-python==1.2.5
six==1.10.0
South==0.7.6
unicodecsv==0.9.4
Error:
pip install django-chronograph
Collecting django-chronograph
Using cached django-chronograph-0.3.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/setup.py", line 32, in <module>
setup_distribute()
File "/private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/setup.py", line 18, in setup_distribute
distribute_setup = __import__('distribute_setup')
File "distribute_setup.py", line 1
<html>
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/
The problem is with the installation script provided by django-chronograph.
In line 16 of setup.py, it tries to download a script:
https://bitbucket.org/wnielson/django-chronograph/src/f561106f6aaab62f2817e08e51c799320fd916d9/setup.py?at=default&fileviewer=file-view-default#setup.py-16
in this code block:
try:
import distribute_setup
except:
# Make sure we have Distribute
if not os.path.exists('distribute_setup'):
urllib.urlretrieve('http://nightly.ziade.org/distribute_setup.py',
'./distribute_setup.py')
However, when you visit the URL at http://nightly.ziade.org/distribute_setup.py, it gives a 404 error, thus the returned html in the error.
It looks like you might be able to get distribute here: https://pypi.python.org/pypi/distribute/0.7.3
Or try doing this before you install django-chronograph:
pip install distribute
Good luck!
django-chronograph is unmaintained. Its fork is doing much better and has support for Django 2.0 and Django 2.1: https://github.com/chrisspen/django-chroniker

amazon_scraper installation issue

This is the link from where i am trying to download the scraper:
https://pypi.python.org/pypi/amazon_scraper/0.1.2
After trying the command ( pip install amazon_scraper) i get this error :
pip install amazon_scraper
Collecting amazon-scraper
Using cached amazon_scraper-0.3.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "c:\users\saurin\appdata\local\temp\pip-build-jxcqui\amazon-scraper\setup.py", line 4, in <module>
del os.link
AttributeError: link
[31mCommand "python setup.py egg_info" failed with error code 1 in
c:\users\saurin\appdata\local\temp\pip-build-jxcqui\amazon-scraper[0m
I tried downloading the rar file running the setup file. I am getting various issues, does any one have solution to this ?
Ensure that you have all the require dependencies installed.
python-amazon-simple-product-api
requests
beautifulsoup4
xmltodict
python-dateutil

Trouble installing secondary dependencies on Heroku

Has anyone seen this before? Below are the output logs that occur when I try to push to heroku ever since adding a new dependency, pysendy.
Note that pysendy requires the module 'requests' and thus I have also added requests to my requirements.txt. If you look at the top of the logs carefully you'll see that the requests module is downloaded & unpacked during the dyno startup, but pysendy doesn't see it. I even tried putting 'requests' at the top of the requirements.txt and nothing changed. Heroku rejects the app. I can get around this by manually importing pysendy into my project because it is small, but that sort of defeats the point of having dependencies.
My suspicion is that something about the request module dependency's installation isn't complete when pysendy tries to access the requests module.
Requirements.txt:
requests==2.2.1
Django==1.6.2
dj-database-url==0.3.0
dj-static==0.0.5
django-toolbelt==0.0.1
djangorestframework==2.3.13
gunicorn==18.0
psycopg2==2.5.2
pysendy==0.0.3
pystache==0.5.3
static==1.0.2
Output Logs:
-----> Python app detected
-----> Using Python runtime (python-3.4.0)
-----> Installing dependencies using Pip (1.5.4)
Downloading/unpacking requests==2.2.1 (from -r requirements.txt (line 1))
Downloading/unpacking pysendy==0.0.3 (from -r requirements.txt (line 11))
Downloading pysendy-0.0.3.tar.gz
Running setup.py (path:/tmp/pip_build_u37993/pysendy/setup.py) egg_info for package pysendy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_u37993/pysendy/setup.py", line 5, in <module>
version = __import__('pysendy').__version__
File "/tmp/pip_build_u37993/pysendy/pysendy/__init__.py", line 2, in <module>
from .pysendy import *
File "/tmp/pip_build_u37993/pysendy/pysendy/pysendy.py", line 3, in <module>
import requests
ImportError: No module named 'requests'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_u37993/pysendy/setup.py", line 5, in <module>
version = __import__('pysendy').__version__
File "/tmp/pip_build_u37993/pysendy/pysendy/__init__.py", line 2, in <module>
from .pysendy import *
File "/tmp/pip_build_u37993/pysendy/pysendy/pysendy.py", line 3, in <module>
import requests
ImportError: No module named 'requests'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_u37993/pysendy
Storing debug log for failure in /app/.pip/pip.log
! Push rejected, failed to compile Python app
Seems like pysendy is trying to use requests during its installation, and despite having it in it's installation requirements (see https://github.com/thiagofa/pysendy/blob/master/setup.py) it's still not being installed. This is clearly an upstream bug since it reproduces on a clean virtual env.
A workaround could be to push an initial requirements.txt with pysendy commented out, let it complete, thus fully installing requests, and then push the full version again to Heroku.

Categories