Heroku build fails always - Says no module named six

721 Views Asked by At
    Counting objects: 1260, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1208/1208), done.
Writing objects: 100% (1260/1260), 6.24 MiB | 184.00 KiB/s, done.
Total 1260 (delta 109), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing python-2.7.13
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote:        Collecting appdirs==1.4.3 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 1))
remote:          Downloading appdirs-1.4.3-py2.py3-none-any.whl
remote:        Collecting click==6.7 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 2))
remote:          Downloading click-6.7-py2.py3-none-any.whl (71kB)
remote:        Collecting Flask==0.12.2 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 3))
remote:          Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
remote:        Collecting gunicorn==19.7.1 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 4))
remote:          Downloading gunicorn-19.7.1-py2.py3-none-any.whl (111kB)
remote:        Collecting itsdangerous==0.24 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 5))
remote:          Downloading itsdangerous-0.24.tar.gz (46kB)
remote:        Collecting Jinja2==2.9.6 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 6))
remote:          Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB)
remote:        Collecting MarkupSafe==1.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 7))
remote:          Downloading MarkupSafe-1.0.tar.gz
remote:        Collecting packaging==16.8 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 8))
remote:          Downloading packaging-16.8-py2.py3-none-any.whl
remote:        Collecting pyparsing==2.2.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 9))
remote:          Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
remote:        Collecting six==1.10.0 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 10))
remote:          Downloading six-1.10.0-py2.py3-none-any.whl
remote:        Collecting Werkzeug==0.12.2 (from -r /tmp/build_05ed4039dfcb7243b9f260b604feea9c/requirements.txt (line 11))
remote:          Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312kB)
remote:        Installing collected packages: appdirs, click, itsdangerous, Werkzeug, MarkupSafe, Jinja2, Flask, gunicorn, pyparsing, six, packaging
remote:          Running setup.py install for itsdangerous: started
remote:            Running setup.py install for itsdangerous: finished with status 'error'
remote:            Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-H6YgNg/itsdangerous/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VAC6vv-record/install-record.txt --single-version-externally-managed --compile:
remote:            running install
remote:            running build
remote:            running build_py
remote:            creating build
remote:            creating build/lib
remote:            copying itsdangerous.py -> build/lib
remote:            running install_lib
remote:            copying build/lib/itsdangerous.py -> /app/.heroku/python/lib/python2.7/site-packages
remote:            byte-compiling /app/.heroku/python/lib/python2.7/site-packages/itsdangerous.py to itsdangerous.pyc
remote:            running install_egg_info
remote:            running egg_info
remote:            writing itsdangerous.egg-info/PKG-INFO
remote:            writing top-level names to itsdangerous.egg-info/top_level.txt
remote:            writing dependency_links to itsdangerous.egg-info/dependency_links.txt
remote:            reading manifest file 'itsdangerous.egg-info/SOURCES.txt'
remote:            reading manifest template 'MANIFEST.in'
remote:            writing manifest file 'itsdangerous.egg-info/SOURCES.txt'
remote:            Copying itsdangerous.egg-info to /app/.heroku/python/lib/python2.7/site-packages/itsdangerous-0.24-py2.7.egg-info
remote:            running install_scripts
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/tmp/pip-build-H6YgNg/itsdangerous/setup.py", line 20, in <module>
remote:                'Programming Language :: Python :: 3',
remote:              File "/app/.heroku/python/lib/python2.7/distutils/core.py", line 151, in setup
remote:                dist.run_commands()
remote:              File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 953, in run_commands
remote:                self.run_command(cmd)
remote:              File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command
remote:                cmd_obj.run()
remote:              File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
remote:                return orig.install.run(self)
remote:              File "/app/.heroku/python/lib/python2.7/distutils/command/install.py", line 575, in run
remote:                self.run_command(cmd_name)
remote:              File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 326, in run_command
remote:                self.distribution.run_command(command)
remote:              File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command
remote:                cmd_obj.run()
remote:              File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 17, in run
remote:                import setuptools.command.easy_install as ei
remote:              File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in <module>
remote:                from setuptools.py27compat import rmtree_safe
remote:              File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/py27compat.py", line 7, in <module>
remote:                import six
remote:            ImportError: No module named six
remote:            
remote:            ----------------------------------------
remote:        Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-H6YgNg/itsdangerous/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VAC6vv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-H6YgNg/itsdangerous/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to searchword.
remote: 
To https://git.heroku.com/searchword.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/searchword.git'

I don't know what is happening. Few days ago, I was able to deploy apps on heroku with no such error. I am running on virtual environment. I activated it before pushing to heroku master. I even checked which pip I am referring to but all in vain. I have installed module 'six' on my local machine and on virtual environment even. Still always it says No module named six and fails my deploy. Please help!! Its frustrating!

3

There are 3 best solutions below

1
On

Because it is google translation, I'm sorry if it turned funny. I was addicted in exactly the same situation. I do not know why it went well, but I replaced it to describe "six == 1.10.0" at the beginning of "requirements.txt" and deployed it. by the way, but my version of python is 3.6・・・

2
On

This is an issue currently with the latest release of setuptools (36.0.0). You can track the issue here - https://github.com/pypa/setuptools/issues/1042

0
On

I solved this issue by removing the module needing six from the reqirements.txt. Then push to heroku and the build was succesful. Next I added the package which needed six and it worked.