Heroku构建总是失败 - 没有名为six的模块

时间:2017-06-01 08:12:55

标签: python heroku six

    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'

我不知道发生了什么。几天前,我能够在heroku上部署应用程序,没有这样的错误。我在虚拟环境上运行。我在推送到heroku master之前激活了它。我甚至检查了我指的是哪一个,但都是徒劳的。我已经安装了模块&#39; six&#39;在我的本地机器和虚拟环境甚至。仍然总是说没有名为六的模块并且我的部署失败了。请帮忙!!令人沮丧!

3 个答案:

答案 0 :(得分:1)

因为它是谷歌翻译,如果它变得有趣,我很抱歉。 我完全沉迷于完全相同的情况。 我不知道为什么它进展顺利,但我用它来代替它来描述 在“requirements.txt”开头的“six == 1.10.0”并进行部署。 顺便说一句,但我的python版本是3.6···

答案 1 :(得分:0)

这是最新版本的setuptools(36.0.0)的问题。您可以在此处跟踪问题 - https://github.com/pypa/setuptools/issues/1042

答案 2 :(得分:0)

我通过从reqirements.txt中删除需要六个的模块解决了这个问题。然后推送到heroku并且构建成功。接下来我添加了需要六个的包,它起作用了。