Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80024 > unrolled thread
| Started by | robert brook <software.by.python@gmail.com> |
|---|---|
| First post | 2014-10-31 09:46 -0700 |
| Last post | 2014-10-31 18:45 +0100 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.python
Implementing pdfkit and wkhtmltopdf on windows fails robert brook <software.by.python@gmail.com> - 2014-10-31 09:46 -0700
Re: Implementing pdfkit and wkhtmltopdf on windows fails Dave Angel <davea@davea.name> - 2014-10-31 13:02 -0400
Re: Implementing pdfkit and wkhtmltopdf on windows fails robert brook <software.by.python@gmail.com> - 2014-10-31 10:25 -0700
Re: Implementing pdfkit and wkhtmltopdf on windows fails Peter Otten <__peter__@web.de> - 2014-10-31 18:45 +0100
| From | robert brook <software.by.python@gmail.com> |
|---|---|
| Date | 2014-10-31 09:46 -0700 |
| Subject | Implementing pdfkit and wkhtmltopdf on windows fails |
| Message-ID | <ff33a03e-8b6a-427d-b4ea-c267a768cb15@googlegroups.com> |
I am able to install both of these packages on my mac at home and it works well.
I am trying to install on windows 7 at work and it fails. PDFKit is trying to find the wkh package and it cannot. I have entered the full path to the exe for the environment variables and the error below is spit out.
If I explicitly cd into the directory that has the executable the script works fine
>>> import os
>>> path='C:\\wkhtmltopdf\\bin\\'
>>> os.chdir(path)
>>> pdfkit.from_string('Hello!', 'out.pdf')
Loading pages (1/6) #this works after cd into the exe directory
Where can I specify the path to the executable?
*************
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
g\pdfkit\api.py", line 66, in from_string
File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
g\pdfkit\pdfkit.py", line 39, in __init__
File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
g\pdfkit\configuration.py", line 27, in __init__
OSError: No wkhtmltopdf executable found: "b''"
If this file exists please check that this process can read it. Otherwise please
install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing
-wkhtmltopdf
**********************
[toc] | [next] | [standalone]
| From | Dave Angel <davea@davea.name> |
|---|---|
| Date | 2014-10-31 13:02 -0400 |
| Message-ID | <mailman.15360.1414774933.18130.python-list@python.org> |
| In reply to | #80024 |
On 10/31/2014 12:46 PM, robert brook wrote:
> I am able to install both of these packages on my mac at home and it works well.
>
> I am trying to install on windows 7 at work and it fails. PDFKit is trying to find the wkh package and it cannot. I have entered the full path to the exe for the environment variables and the error below is spit out.
>
> If I explicitly cd into the directory that has the executable the script works fine
>
>>>> import os
>>>> path='C:\\wkhtmltopdf\\bin\\'
>>>> os.chdir(path)
>>>> pdfkit.from_string('Hello!', 'out.pdf')
> Loading pages (1/6) #this works after cd into the exe directory
>
>
> Where can I specify the path to the executable?
>
> *************
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
> g\pdfkit\api.py", line 66, in from_string
> File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
> g\pdfkit\pdfkit.py", line 39, in __init__
> File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
> g\pdfkit\configuration.py", line 27, in __init__
> OSError: No wkhtmltopdf executable found: "b''"
> If this file exists please check that this process can read it. Otherwise please
> install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing
> -wkhtmltopdf
>
> **********************
>
I don't know your particular module, but generally, you want modules
installed on your sys.path. Either install it there, or add the
directory to sys.path (which is a list)
I'd suggest doing the latter, then figure whether a reinstall is called
for. It looks like you installed it in the root directory of C:, rather
than in the site-packages.
--
DaveA
[toc] | [prev] | [next] | [standalone]
| From | robert brook <software.by.python@gmail.com> |
|---|---|
| Date | 2014-10-31 10:25 -0700 |
| Message-ID | <9dcc7bcc-4a1d-4625-a036-591bb2f977db@googlegroups.com> |
| In reply to | #80027 |
On Friday, October 31, 2014 1:02:44 PM UTC-4, Dave Angel wrote:
> On 10/31/2014 12:46 PM, robert brook wrote:
> > I am able to install both of these packages on my mac at home and it works well.
> >
> > I am trying to install on windows 7 at work and it fails. PDFKit is trying to find the wkh package and it cannot. I have entered the full path to the exe for the environment variables and the error below is spit out.
> >
> > If I explicitly cd into the directory that has the executable the script works fine
> >
> >>>> import os
> >>>> path='C:\\wkhtmltopdf\\bin\\'
> >>>> os.chdir(path)
> >>>> pdfkit.from_string('Hello!', 'out.pdf')
> > Loading pages (1/6) #this works after cd into the exe directory
> >
> >
> > Where can I specify the path to the executable?
> >
> > *************
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
> > g\pdfkit\api.py", line 66, in from_string
> > File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
> > g\pdfkit\pdfkit.py", line 39, in __init__
> > File "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-py3.3.eg
> > g\pdfkit\configuration.py", line 27, in __init__
> > OSError: No wkhtmltopdf executable found: "b''"
> > If this file exists please check that this process can read it. Otherwise please
> > install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing
> > -wkhtmltopdf
> >
> > **********************
> >
>
> I don't know your particular module, but generally, you want modules
> installed on your sys.path. Either install it there, or add the
> directory to sys.path (which is a list)
>
> I'd suggest doing the latter, then figure whether a reinstall is called
> for. It looks like you installed it in the root directory of C:, rather
> than in the site-packages.
>
>
> --
> DaveA
I see the problem. The installation of the package did not drop down the files that the executable is looking for.
Thanks
[toc] | [prev] | [next] | [standalone]
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2014-10-31 18:45 +0100 |
| Message-ID | <mailman.15365.1414777515.18130.python-list@python.org> |
| In reply to | #80024 |
robert brook wrote:
> I am able to install both of these packages on my mac at home and it works
> well.
>
> I am trying to install on windows 7 at work and it fails. PDFKit is
> trying to find the wkh package and it cannot. I have entered the full path
> to the exe for the environment variables and the error below is spit out.
>
> If I explicitly cd into the directory that has the executable the script
> works fine
>
>>>> import os
>>>> path='C:\\wkhtmltopdf\\bin\\'
>>>> os.chdir(path)
>>>> pdfkit.from_string('Hello!', 'out.pdf')
> Loading pages (1/6) #this works after cd into the exe directory
>
>
> Where can I specify the path to the executable?
>
> *************
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-
py3.3.eg
> g\pdfkit\api.py", line 66, in from_string
> File
> "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-
py3.3.eg
> g\pdfkit\pdfkit.py", line 39, in __init__
> File
> "C:\Applications\python_33_32_bit\lib\site-packages\pdfkit-0.4.1-
py3.3.eg
> g\pdfkit\configuration.py", line 27, in __init__
> OSError: No wkhtmltopdf executable found: "b''"
> If this file exists please check that this process can read it. Otherwise
> please
> install wkhtmltopdf -
> https://github.com/JazzCore/python-pdfkit/wiki/Installing
> -wkhtmltopdf
>
> **********************
Following the link in the traceback I find the installation instruction for
windows:
"""
Download the installer from the wkhtmltopdf downloads list and add folder
with wkhtmltopdf binary to PATH.
"""
This PATH has nothing to do with Python's sys.path which specifies where
Python looks for modules, and you have to set it according to the rules of
your OS, e. g.
http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
Once you have added "the directory you had to cd into" follwing the above
instructions your script should work in a newly opened shell window.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web