jwmayfield / pywkher

Use wkhtmltopdf in your Python project on Heroku
http://www.codetalk.rs/2012/08/26/pywkher-wkhtmltopdf-for-python-on-heroku.html
BSD 3-Clause "New" or "Revised" License
13 stars 22 forks source link

Not working with Heroku and Python 3 #4

Open ghost opened 8 years ago

ghost commented 8 years ago

When i try to upload my project to Heroku with the package pywkher==1.0.4 in the requirements, Heroku starts to install it and then this error is shown:

   Running setup.py install for pywkher: started
   Running setup.py install for pywkher: finished with status 'error'
   Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-j_pu3yo4/pywkher/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rdt_r9fd-record/install-record.txt --single-version-externally-managed --compile:
   running install
   running build
   running build_py
   creating build
   creating build/lib
   creating build/lib/pywkher
   copying pywkher/__init__.py -> build/lib/pywkher
   running build_scripts
   creating build/scripts-3.5
   Traceback (most recent call last):
     File "/app/.heroku/python/lib/python3.5/tokenize.py", line 392, in find_cookie
       line_string = line.decode('utf-8')
   UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 24: invalid start byte

   During handling of the above exception, another exception occurred:

   Traceback (most recent call last):
     File "<string>", line 1, in <module>
     File "/tmp/pip-build-j_pu3yo4/pywkher/setup.py", line 30, in <module>
       zip_safe=False
     File "/app/.heroku/python/lib/python3.5/distutils/core.py", line 148, in setup
       dist.run_commands()
     File "/app/.heroku/python/lib/python3.5/distutils/dist.py", line 955, in run_commands
       self.run_command(cmd)
     File "/app/.heroku/python/lib/python3.5/distutils/dist.py", line 974, in run_command
       cmd_obj.run()
     File "/app/.heroku/python/lib/python3.5/site-packages/setuptools-20.4-py3.5.egg/setuptools/command/install.py", line 61, in run
     File "/app/.heroku/python/lib/python3.5/distutils/command/install.py", line 539, in run
       self.run_command('build')
     File "/app/.heroku/python/lib/python3.5/distutils/cmd.py", line 313, in run_command
       self.distribution.run_command(command)
     File "/app/.heroku/python/lib/python3.5/distutils/dist.py", line 974, in run_command
       cmd_obj.run()
     File "/app/.heroku/python/lib/python3.5/distutils/command/build.py", line 135, in run
       self.run_command(cmd_name)
     File "/app/.heroku/python/lib/python3.5/distutils/cmd.py", line 313, in run_command
       self.distribution.run_command(command)
     File "/app/.heroku/python/lib/python3.5/distutils/dist.py", line 974, in run_command
       cmd_obj.run()
     File "/app/.heroku/python/lib/python3.5/distutils/command/build_scripts.py", line 50, in run
       self.copy_scripts()
     File "/app/.heroku/python/lib/python3.5/distutils/command/build_scripts.py", line 82, in copy_scripts
       encoding, lines = tokenize.detect_encoding(f.readline)
     File "/app/.heroku/python/lib/python3.5/tokenize.py", line 433, in detect_encoding
       encoding = find_cookie(first)
     File "/app/.heroku/python/lib/python3.5/tokenize.py", line 397, in find_cookie
       raise SyntaxError(msg)
   SyntaxError: invalid or missing encoding declaration for 'bin/wkhtmltopdf-heroku'

   ----------------------------------------

Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-j_pu3yo4/pywkher/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-rdt_r9fd-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-j_pu3yo4/pywkher/


Push rejected, failed to compile Python app

What's wrong?

introbig commented 8 years ago

same

lucasmatheustesta commented 8 years ago

? any solution ?

Geebz commented 8 years ago

Wait update, I think. Look`s like every user who use Python3 on his project has the same error.

juanjgarcia commented 4 years ago

Hey future dev. If you come across this same problem. Here is our working fork!

https://github.com/HousekeepLtd/pywkher

jwmayfield commented 4 years ago

@juanjgarcia Thanks for the work on the fork. Between being swamped at a startup the past several years and Heroku opening up their buildpack infrastructure (there are many buildpacks that install wkhtmltopdf, for example), there seemed less need for this repo and I'd honestly mostly forgotten about it.

If you think there is a real need for this package, I'm happy to accept a PR and revive this.