2014-09-17 9 views
7

ich die für pip folgenden requirements.txt mit:Installation pyOpenSSL, Kryptographie auf Heroku

Django==1.4.3 
Pillow==2.4.0 
South==0.7.5 
amqp==1.4.5 
anyjson==0.3.3 
argparse==1.2.1 
billiard==3.3.0.18 
boto==2.4.1 
celery==3.1.12 
cffi==0.8.6 
cryptography==0.5.4 
dj-database-url==0.2.0 
django-annoying==0.7.6 
django-appconf==0.6 
django-articles==2.4.1 
django-celery==3.1.10 
django-compressor==1.3 
django-debug-toolbar==1.2.1 
django-jsonfield==0.9.13 
django-pdb==0.4.0 
django-postmark==0.1.6 
django-s3-folder-storage==0.2 
django-storages==1.1.4 
docopt==0.6.1 
facebook-sdk==0.4.0 
google-api-python-client==1.2 
gunicorn==0.15.0 
httplib2==0.9 
ipython==2.1.0 
itsdangerous==0.24 
kombu==3.0.20 
mailchimp==2.0.8 
path-and-address==0.2.0 
psycopg2==2.4.5 
pyOpenSSL==0.14 
pycparser==2.10 
pyparsing==2.0.2 
python-dateutil==2.2 
pytz==2013b 
requests==2.3.0 
six==1.8.0 
sqlparse==0.1.11 
tweepy==2.3.0 
wsgiref==0.1.2 

Dinge arbeiten, bis ich

cffi==0.8.6 
cryptography==0.5.4 
google-api-python-client==1.2 
httplib2==0.9 
pyOpenSSL==0.14 
pycparser==2.10 
pyparsing==2.0.2 

hinzugefügt, die ich hinzugefügt, um Google Kalender-API zu verwenden, da SignedJwtAssertionCredentials hängt von pyOpenSSL ab. Jetzt

wenn ich Heroku schieben traf ich Fehler während des Build scheinbar im Zusammenhang mit six und cffi oder cyrptography:

Der vollständige Buildprotokoll ist here, aber einige relevante Schnipsel:

Fetching repository, done. 

-----> Python app detected 
-----> Noticed cffi. Bootstrapping libffi. 
-----> Installing dependencies with pip 

building '_Cryptography_cffi_684bb40axf342507b' extension 

     creating /tmp/pip_build_u50597/cryptography/cryptography/hazmat/primitives/__pycache__/cryptography 

     creating /tmp/pip_build_u50597/cryptography/cryptography/hazmat/primitives/__pycache__/cryptography/hazmat 

     creating /tmp/pip_build_u50597/cryptography/cryptography/hazmat/primitives/__pycache__/cryptography/hazmat/primitives 

     creating /tmp/pip_build_u50597/cryptography/cryptography/hazmat/primitives/__pycache__/cryptography/hazmat/primitives/__pycache__ 

     gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/app/.heroku/python/include/python2.7 -c cryptography/hazmat/primitives/__pycache__/_Cryptography_cffi_684bb40axf342507b.c -o /tmp/pip_build_u50597/cryptography/cryptography/hazmat/primitives/__pycache__/cryptography/hazmat/primitives/__pycache__/_Cryptography_cffi_684bb40axf342507b.o 

     gcc -pthread -shared /tmp/pip_build_u50597/cryptography/cryptography/hazmat/primitives/__pycache__/cryptography/hazmat/primitives/__pycache__/_Cryptography_cffi_684bb40axf342507b.o -L/app/.heroku/python/lib -lpython2.7 -o /tmp/pip_build_u50597/cryptography/cryptography/hazmat/primitives/__pycache__/_Cryptography_cffi_684bb40axf342507b.so 

     Traceback (most recent call last): 

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

     File "/tmp/pip_build_u50597/cryptography/setup.py", line 174, in <module> 

      "test": PyTest, 

     File "/app/.heroku/python/lib/python2.7/distutils/core.py", line 151, in setup 

      dist.run_commands() 

     File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 953, in run_commands 

      self.run_command(cmd) 

     File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command 

      cmd_obj.run() 

     File "<string>", line 15, in replacement_run 

     File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 186, in find_sources 

     File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 246, in run 

     File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 282, in add_defaults 

     File "build/bdist.linux-x86_64/egg/setuptools/command/sdist.py", line 167, in add_defaults 

     File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command 

      cmd_obj.ensure_finalized() 

     File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized 

      self.finalize_options() 

     File "build/bdist.linux-x86_64/egg/setuptools/command/build_py.py", line 26, in finalize_options 

     File "/app/.heroku/python/lib/python2.7/distutils/command/build_py.py", line 46, in finalize_options 

      ('force', 'force')) 

     File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 298, in set_undefined_options 

      src_cmd_obj.ensure_finalized() 

     File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized 

      self.finalize_options() 

     File "/tmp/pip_build_u50597/cryptography/setup.py", line 88, in finalize_options 

      self.distribution.ext_modules = get_ext_modules() 

     File "/tmp/pip_build_u50597/cryptography/setup.py", line 65, in get_ext_modules 

      from cryptography.hazmat.primitives import constant_time, padding 

     File "cryptography/hazmat/primitives/padding.py", line 25, in <module> 

      from cryptography.hazmat.primitives import interfaces 

     File "cryptography/hazmat/primitives/interfaces.py", line 21, in <module> 

      @six.add_metaclass(abc.ABCMeta) 

     AttributeError: 'module' object has no attribute 'add_metaclass' 

Einige googeln scheint zu zeigen, dass six.add_metaclass in früheren Versionen von sechs aufgetreten ist, aber die Version, die ich verwende, ist die neueste ich glaube, und außerdem scheint dies auch lokal zu arbeiten, wenn ich ein neues virtualenv erstellen und pip install -r requirements.txt tun (solange ich installiert habe libffi auf jeden Fall mit sudo apt-get install libffi-dev.

Jeder hat eine Idee, warum dies nicht funktioniert Heroku und wie zu beheben?

EDIT ich da entdeckt haben, dass dies nicht passiert, wenn ich die Python-Version angeben, genau das meiner lokalen Maschine zu sein, indem ein runtime.txt mit python-2.7.6 (vs der Heroku Standard 2.7.7) verwenden. Trotzdem finde ich das jetzt etwas merkwürdig, ist es nur ein Käfer?

Antwort

0

Das Problem ist mit six. Ich habe dieses Problem zuvor durch Deinstallation und Installation von six gelöst. Versuchen Sie es und tu es erneut, wenn es funktioniert.

pip uninstall six 
pip install six