Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26308 > unrolled thread

docx/lxml

Started bycyrille.leroux@gmail.com
First post2012-07-31 06:36 -0700
Last post2012-07-31 08:51 -0700
Articles 7 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  docx/lxml cyrille.leroux@gmail.com - 2012-07-31 06:36 -0700
    Re: docx/lxml Pedro Kroger <kroger@pedrokroger.net> - 2012-07-31 11:00 -0300
      Re: docx/lxml Cyrille Leroux <cyrille.leroux@gmail.com> - 2012-07-31 08:01 -0700
      Re: docx/lxml Cyrille Leroux <cyrille.leroux@gmail.com> - 2012-07-31 08:01 -0700
        Re: docx/lxml Stefan Behnel <stefan_ml@behnel.de> - 2012-07-31 17:13 +0200
          Re: docx/lxml Cyrille Leroux <cyrille.leroux@gmail.com> - 2012-07-31 08:51 -0700
          Re: docx/lxml Cyrille Leroux <cyrille.leroux@gmail.com> - 2012-07-31 08:51 -0700

#26308 — docx/lxml

Fromcyrille.leroux@gmail.com
Date2012-07-31 06:36 -0700
Subjectdocx/lxml
Message-ID<40113c57-5978-45a2-b695-8917706fd268@googlegroups.com>
Hello,

I'm trying to use the docx package to generate documents containing some text and tables.

I don't want to install any module since I just want my coworkers to copy a directory and run a script, without installing tons of softwares (Just python2.7 which is already installed).

First, I downloaded docx package, copied the docx directory I found. Then, I added its path (sys.path.append())

But it complained it missed a lxml package. Ok, I downloaded it, copied the lxml directory.

This time, it wanted a etree.py file. I search and found it is generated during installation... But I don't want to install it ! I searched again, and found that anyway, even if I install it to get this file, it will need other libraries... At this point, I already lost too much time, so I quit. It's way too much work for what I have to do.


[My questions :]

- Do you know any *easy to use*, *easy to deploy* package to generate ".doc like" documents ?
- Do you have any suggestion to do it differently (maybe with native packages ?)

- As a python newby, I don't understand why you have to go through the pain of installing packages since they should be able to work with just the __init__.py files ? 

Regards,

Cyrille

[toc] | [next] | [standalone]


#26312

FromPedro Kroger <kroger@pedrokroger.net>
Date2012-07-31 11:00 -0300
Message-ID<mailman.2782.1343743230.4697.python-list@python.org>
In reply to#26308
On Jul 31, 2012, at 10:36 AM, cyrille.leroux@gmail.com wrote:

> - Do you know any *easy to use*, *easy to deploy* package to generate ".doc like" documents ?
> - Do you have any suggestion to do it differently (maybe with native packages ?)
> 
> - As a python newby, I don't understand why you have to go through the pain of installing packages since they should be able to work with just the __init__.py files ? 
> 
> Regards,
> 
> Cyrille

Hi,

May I suggest you use pip and, possibly, virtualenv?
pip makes it easy to install Python packages while virtualenv creates an isolated Python environment

For instance, I just installed docx and its dependencies with:

pip install docx lxml datutils PIL

And I did that inside a testing virtualenv, so I wouldn't mess up my Python setup.

pip and virtualenv make it really easy and painless to install Python packages.

Cheers,

Pedro
-----
http://pedrokroger.net
http://musicforgeeksandnerds.com

[toc] | [prev] | [next] | [standalone]


#26315

FromCyrille Leroux <cyrille.leroux@gmail.com>
Date2012-07-31 08:01 -0700
Message-ID<mailman.2786.1343746912.4697.python-list@python.org>
In reply to#26312
On Tuesday, July 31, 2012 4:00:25 PM UTC+2, Pedro Kroger wrote:
> On Jul 31, 2012, at 10:36 AM, Cyrille Leroux wrote:
> 
> 
> 
> > - Do you know any *easy to use*, *easy to deploy* package to generate ".doc like" documents ?
> 
> > - Do you have any suggestion to do it differently (maybe with native packages ?)
> 
> > 
> 
> > - As a python newby, I don't understand why you have to go through the pain of installing packages since they should be able to work with just the __init__.py files ? 
> 
> > 
> 
> > Regards,
> 
> > 
> 
> > Cyrille
> 
> 
> 
> Hi,
> 
> 
> 
> May I suggest you use pip and, possibly, virtualenv?
> 
> pip makes it easy to install Python packages while virtualenv creates an isolated Python environment
> 
> 
> 
> For instance, I just installed docx and its dependencies with:
> 
> 
> 
> pip install docx lxml datutils PIL
> 
> 
> 
> And I did that inside a testing virtualenv, so I wouldn't mess up my Python setup.
> 
> 
> 
> pip and virtualenv make it really easy and painless to install Python packages.
> 
> 
> 
> Cheers,
> 
> 
> 
> Pedro
> 
> -----
> 
> http://pedrokroger.net
> 
> http://musicforgeeksandnerds.com


Thank you for your quick reply Pedro.

I'm giving pip a try :


1/ Linux (debian lenny)
- (as root) sh setuptools-0.6c11-py2.7.egg (ok)
- (as root) cd pip-1.1 ; python setup.py install (ok)
- pip : ImportError : No module named pkg_resources
- damn, I guess it's going to be a pain, again
- ... then I remember that anyway, I cannot access internet from my session
- end of story for linux


2/ Back on Windows (7)

- setuptools-0.6c11.win32-py2.7.exe (ok)
- (cmd) easy_install.exe pip : AttributeError : 'NoneType' object has no attribute 'clone'

Well, I think I'm starting to feel less and less enthusiastic about python... I didn't suspect it would be so difficult to write a basic doc file :)

[toc] | [prev] | [next] | [standalone]


#26316

FromCyrille Leroux <cyrille.leroux@gmail.com>
Date2012-07-31 08:01 -0700
Message-ID<704bbd5d-38fd-4e8d-884b-d09197125c85@googlegroups.com>
In reply to#26312
On Tuesday, July 31, 2012 4:00:25 PM UTC+2, Pedro Kroger wrote:
> On Jul 31, 2012, at 10:36 AM, Cyrille Leroux wrote:
> 
> 
> 
> > - Do you know any *easy to use*, *easy to deploy* package to generate ".doc like" documents ?
> 
> > - Do you have any suggestion to do it differently (maybe with native packages ?)
> 
> > 
> 
> > - As a python newby, I don't understand why you have to go through the pain of installing packages since they should be able to work with just the __init__.py files ? 
> 
> > 
> 
> > Regards,
> 
> > 
> 
> > Cyrille
> 
> 
> 
> Hi,
> 
> 
> 
> May I suggest you use pip and, possibly, virtualenv?
> 
> pip makes it easy to install Python packages while virtualenv creates an isolated Python environment
> 
> 
> 
> For instance, I just installed docx and its dependencies with:
> 
> 
> 
> pip install docx lxml datutils PIL
> 
> 
> 
> And I did that inside a testing virtualenv, so I wouldn't mess up my Python setup.
> 
> 
> 
> pip and virtualenv make it really easy and painless to install Python packages.
> 
> 
> 
> Cheers,
> 
> 
> 
> Pedro
> 
> -----
> 
> http://pedrokroger.net
> 
> http://musicforgeeksandnerds.com


Thank you for your quick reply Pedro.

I'm giving pip a try :


1/ Linux (debian lenny)
- (as root) sh setuptools-0.6c11-py2.7.egg (ok)
- (as root) cd pip-1.1 ; python setup.py install (ok)
- pip : ImportError : No module named pkg_resources
- damn, I guess it's going to be a pain, again
- ... then I remember that anyway, I cannot access internet from my session
- end of story for linux


2/ Back on Windows (7)

- setuptools-0.6c11.win32-py2.7.exe (ok)
- (cmd) easy_install.exe pip : AttributeError : 'NoneType' object has no attribute 'clone'

Well, I think I'm starting to feel less and less enthusiastic about python... I didn't suspect it would be so difficult to write a basic doc file :)

[toc] | [prev] | [next] | [standalone]


#26318

FromStefan Behnel <stefan_ml@behnel.de>
Date2012-07-31 17:13 +0200
Message-ID<mailman.2787.1343747610.4697.python-list@python.org>
In reply to#26316
Cyrille Leroux, 31.07.2012 17:01:
> I'm giving pip a try :
> 
> 
> 1/ Linux (debian lenny)
> - (as root) sh setuptools-0.6c11-py2.7.egg (ok)
> - (as root) cd pip-1.1 ; python setup.py install (ok)
> - pip : ImportError : No module named pkg_resources
> - damn, I guess it's going to be a pain, again
> - ... then I remember that anyway, I cannot access internet from my session
> - end of story for linux
> 
> 
> 2/ Back on Windows (7)
> 
> - setuptools-0.6c11.win32-py2.7.exe (ok)
> - (cmd) easy_install.exe pip : AttributeError : 'NoneType' object has no attribute 'clone'
> 
> Well, I think I'm starting to feel less and less enthusiastic about python... I didn't suspect it would be so difficult to write a basic doc file :)

"pip" goes with "distribute", not "setuptools".

http://packages.python.org/distribute/

Stefan

[toc] | [prev] | [next] | [standalone]


#26320

FromCyrille Leroux <cyrille.leroux@gmail.com>
Date2012-07-31 08:51 -0700
Message-ID<5c0560ec-66ef-4be7-912a-ed648fe60af1@googlegroups.com>
In reply to#26318
On Tuesday, July 31, 2012 5:13:12 PM UTC+2, Stefan Behnel wrote:
> Cyrille Leroux, 31.07.2012 17:01:
> 
> > I'm giving pip a try :
> 
> > 
> 
> > 
> 
> > 1/ Linux (debian lenny)
> 
> > - (as root) sh setuptools-0.6c11-py2.7.egg (ok)
> 
> > - (as root) cd pip-1.1 ; python setup.py install (ok)
> 
> > - pip : ImportError : No module named pkg_resources
> 
> > - damn, I guess it's going to be a pain, again
> 
> > - ... then I remember that anyway, I cannot access internet from my session
> 
> > - end of story for linux
> 
> > 
> 
> > 
> 
> > 2/ Back on Windows (7)
> 
> > 
> 
> > - setuptools-0.6c11.win32-py2.7.exe (ok)
> 
> > - (cmd) easy_install.exe pip : AttributeError : 'NoneType' object has no attribute 'clone'
> 
> > 
> 
> > Well, I think I'm starting to feel less and less enthusiastic about python... I didn't suspect it would be so difficult to write a basic doc file :)
> 
> 
> 
> "pip" goes with "distribute", not "setuptools".
> 
> 
> 
> http://packages.python.org/distribute/
> 
> 
> 
> Stefan

Ok, I will try it next time then, thank you.


In the end, I found a way around. I generated an html file, then, converted it to a doc file.

[toc] | [prev] | [next] | [standalone]


#26321

FromCyrille Leroux <cyrille.leroux@gmail.com>
Date2012-07-31 08:51 -0700
Message-ID<mailman.2790.1343749867.4697.python-list@python.org>
In reply to#26318
On Tuesday, July 31, 2012 5:13:12 PM UTC+2, Stefan Behnel wrote:
> Cyrille Leroux, 31.07.2012 17:01:
> 
> > I'm giving pip a try :
> 
> > 
> 
> > 
> 
> > 1/ Linux (debian lenny)
> 
> > - (as root) sh setuptools-0.6c11-py2.7.egg (ok)
> 
> > - (as root) cd pip-1.1 ; python setup.py install (ok)
> 
> > - pip : ImportError : No module named pkg_resources
> 
> > - damn, I guess it's going to be a pain, again
> 
> > - ... then I remember that anyway, I cannot access internet from my session
> 
> > - end of story for linux
> 
> > 
> 
> > 
> 
> > 2/ Back on Windows (7)
> 
> > 
> 
> > - setuptools-0.6c11.win32-py2.7.exe (ok)
> 
> > - (cmd) easy_install.exe pip : AttributeError : 'NoneType' object has no attribute 'clone'
> 
> > 
> 
> > Well, I think I'm starting to feel less and less enthusiastic about python... I didn't suspect it would be so difficult to write a basic doc file :)
> 
> 
> 
> "pip" goes with "distribute", not "setuptools".
> 
> 
> 
> http://packages.python.org/distribute/
> 
> 
> 
> Stefan

Ok, I will try it next time then, thank you.


In the end, I found a way around. I generated an html file, then, converted it to a doc file.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web