[Python] Use Python on Windows OS to convert Outlook Data File (.pst) to mbox

Discussão em 'Python' iniciado por Stack, Julho 3, 2025.

  1. Stack

    Stack Membro Participativo

    I'm having trouble figuring out how to convert an Outlook Data File (.pst file extension) to an mbox file using Python on Windows.

    On Mac, it was relatively straightforward - just install libpst and then use the following.

    def pst_to_mbox(pstfilename, outputfolder):
    subprocess.call(['readpst', '-o',
    outputfolder, '-r', pstfilename])


    However, on Windows, this does not work. When I try to run readpst at the command line with the appropriate outputfolder and pstfilename, I get the following error.

    'readpst' is not recognized as an internal or external command,
    operable program or batch file.


    After much Googling, I have yet to find a good source of instructions for installing libpst on Windows (doesn't seem like it's even possible). So how can I go about doing the conversion with Python on a Windows operating system?

    Continue reading...

Compartilhe esta Página