Home > Enterprise >  Installing OOXML library fails
Installing OOXML library fails

Time:12-07

I am trying to install OOXML with Python 3.10 using pip install ooxml

First of all, I did create a new virtual environment (after installing virtualenv), then activated it with env\Scripts\activate but I am getting this error:

(env) PS C:\Users\ahmad\Desktop\XML-DOCX> pip install ooxml                                 
Collecting ooxml
  Using cached ooxml-0.2.1.tar.gz (4.3 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: ooxml
  Building wheel for ooxml (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\ahmad\Desktop\XML-DOCX\env\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"'; __file__='"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\ahmad\AppData\Local\Temp\pip-wheel-cw6u77ak'
       cwd: C:\Users\ahmad\AppData\Local\Temp\pip-install-r6q4bs_b\ooxml_5b43566139ba4321a491b2ef7c9bdf16\
  Complete output (26 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\ooxml
  copying ooxml\ooxmlbase.py -> build\lib\ooxml
  copying ooxml\spreadsheet.py -> build\lib\ooxml
  copying ooxml\__init__.py -> build\lib\ooxml
  C:\Users\ahmad\Desktop\XML-DOCX\env\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    warnings.warn(
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\ooxml
  copying build\lib\ooxml\ooxmlbase.py -> build\bdist.win-amd64\wheel\.\ooxml
  copying build\lib\ooxml\spreadsheet.py -> build\bdist.win-amd64\wheel\.\ooxml
  copying build\lib\ooxml\__init__.py -> build\bdist.win-amd64\wheel\.\ooxml
  running install_data
  creating build\bdist.win-amd64\wheel\ooxml-0.2.1.data
  creating build\bdist.win-amd64\wheel\ooxml-0.2.1.data\data
  creating build\bdist.win-amd64\wheel\ooxml-0.2.1.data\data\ooxml
  creating build\bdist.win-amd64\wheel\ooxml-0.2.1.data\data\ooxml\ooxml-templates
  error: can't copy 'ooxml\ooxml-templates\workbook.xlsx': doesn't exist or not a regular file
  ----------------------------------------
  ERROR: Failed building wheel for ooxml
  Running setup.py clean for ooxml
Failed to build ooxml
Installing collected packages: ooxml
    Running setup.py install for ooxml ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\ahmad\Desktop\XML-DOCX\env\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"'; __file__='"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ahmad\AppData\Local\Temp\pip-record-44ixgoxr\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\ahmad\Desktop\XML-DOCX\env\include\site\python3.10\ooxml'
         cwd: C:\Users\ahmad\AppData\Local\Temp\pip-install-r6q4bs_b\ooxml_5b43566139ba4321a491b2ef7c9bdf16\
    Complete output (16 lines):
    running install
    C:\Users\ahmad\Desktop\XML-DOCX\env\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\ooxml
    copying ooxml\ooxmlbase.py -> build\lib\ooxml
    copying ooxml\spreadsheet.py -> build\lib\ooxml
    copying ooxml\__init__.py -> build\lib\ooxml
    running install_lib
    running install_data
    creating C:\Users\ahmad\Desktop\XML-DOCX\env\ooxml
    creating C:\Users\ahmad\Desktop\XML-DOCX\env\ooxml\ooxml-templates
    error: can't copy 'ooxml\ooxml-templates\workbook.xlsx': doesn't exist or not a regular file
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\ahmad\Desktop\XML-DOCX\env\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"'; __file__='"'"'C:\\Users\\ahmad\\AppData\\Local\\Temp\\pip-install-r6q4bs_b\\ooxml_5b43566139ba4321a491b2ef7c9bdf16\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ahmad\AppData\Local\Temp\pip-record-44ixgoxr\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\ahmad\Desktop\XML-DOCX\env\include\site\python3.10\ooxml' Check the logs for full command output.

I could not locate logs to determine where the installation is failing, any help?

CodePudding user response:

The subdirectory ooxml\ooxml-templates\ is missing from ooxml-0.2.1.tar.gz. This is a bug in the distribution package.

Try to install from the Github repository:

pip install git https://github.com/wensheng/PyOOXML.git
  • Related