docx/lxml

Discussion in 'Python' started by cyrille.leroux@gmail.com, Jul 31, 2012.

  1. Guest

    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 adirectory 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 thelxml 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, andfound 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 ".doclike" 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 painof installing packages since they should be able to work with just the __init__.py files ?

    Regards,

    Cyrille
     
    , Jul 31, 2012
    #1
    1. Advertising

  2. Pedro Kroger Guest

    On Jul 31, 2012, at 10:36 AM, 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
     
    Pedro Kroger, Jul 31, 2012
    #2
    1. Advertising

  3. 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 :)
     
    Cyrille Leroux, Jul 31, 2012
    #3
  4. 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 :)
     
    Cyrille Leroux, Jul 31, 2012
    #4
  5. 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
     
    Stefan Behnel, Jul 31, 2012
    #5
  6. 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.
     
    Cyrille Leroux, Jul 31, 2012
    #6
  7. 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.
     
    Cyrille Leroux, Jul 31, 2012
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roel
    Replies:
    1
    Views:
    4,462
    Mark Rae
    Feb 27, 2007
  2. Replies:
    4
    Views:
    1,506
    Rad [Visual C# MVP]
    Oct 24, 2007
  3. David Thielen
    Replies:
    3
    Views:
    78,999
    David Thielen
    May 27, 2008
  4. Madison

    DOCX MIME Type

    Madison, Aug 5, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    2,094
    Madison
    Aug 6, 2008
  5. SUNNY
    Replies:
    3
    Views:
    871
    Cowboy \(Gregory A. Beamer\)
    Aug 8, 2008
Loading...

Share This Page