{"id":26559,"date":"2022-05-11T20:59:38","date_gmt":"2022-05-11T15:29:38","guid":{"rendered":"https:\/\/python-programs.com\/?p=26559"},"modified":"2022-05-11T20:59:38","modified_gmt":"2022-05-11T15:29:38","slug":"how-to-install-openpyxl-library-in-python","status":"publish","type":"post","link":"https:\/\/python-programs.com\/how-to-install-openpyxl-library-in-python\/","title":{"rendered":"How to Install openpyxl Library in Python?"},"content":{"rendered":"

openpyxl Library in Python:<\/strong><\/p>\n

Openpyxl is a Python library for reading and writing Excel files with the xlsx, xlsm, xltx, and xltm extensions. It comes with a number of different modules that allow you to work with Excel files without having to use any third-party software.<\/p>\n

Let us use the Python package manager pip<\/strong> to install the openpyxl module here. The pip package manager supports in the installation and management of additional Python packages that are not included in the standard library.<\/p>\n

Installation:<\/strong><\/p>\n

\n
pip\u00a0install\u00a0package_name<\/pre>\n<\/div>\n

Output:<\/strong><\/p>\n

Collecting package_name\r\nDownloading package_name-0.1.tar.gz (782 bytes)\r\nBuilding wheels for collected packages: package-name\r\nBuilding wheel for package-name (setup.py) ... done\r\nCreated wheel for package-name: filename=package_name-0.1-py3-none-any.whl size=1254 \r\nsha256=5704546ee196cfea91be74986fddb721d38e9f6063d138b8e1eb00d6f7b3699b\r\nStored in directory: \/root\/.cache\/pip\/wheels\/aa\/56\/2f\/2bf8ec875b1c71660b2692b4aab073132abc\r\n78ac076140489b\r\nSuccessfully built package-name\r\nInstalling collected packages: package-name\r\nSuccessfully installed package-name-0.1<\/pre>\n

Installation of openpyxl in windows<\/h2>\n

Open the command prompt and type the below command for the installation of the openpyxl package.<\/p>\n

pip install openpyxl<\/pre>\n

Output:<\/strong><\/p>\n

Collecting openpyxl\r\nDownloading openpyxl-3.0.9-py2.py3-none-any.whl (242 kB)\r\n|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 242 kB 1.6 MB\/s\r\nCollecting et-xmlfile\r\nDownloading et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB)\r\nInstalling collected packages: et-xmlfile, openpyxl\r\nSuccessfully installed et-xmlfile-1.1.0 openpyxl-3.0.9<\/pre>\n

\"Installation
\nThe openpyxl package is installed successfully on your Windows system<\/p>\n

Another Way to Install openpyxl Library in Windows<\/h3>\n

We can install the openpyxl package using the pip<\/strong>\u00a0package manager; however, if the above technique fails to install the package, we may still install the package manually from the official website on Windows.<\/p>\n

Steps to be followed:<\/strong><\/p>\n

    \n
  1. To install the Mahotas package, go to the official website (https:\/\/pypi.org\/project\/openpyxl\/<\/a>)<\/li>\n
  2. Navigate to the Download Files option and click on the openpyxl openpyxl.x.x.x.tar.gz<\/strong> file link to download the openpyxl package. (The version number of the package is denoted by x.x.x here)<\/li>\n
  3. \"Installation<\/li>\n
  4. Go to the Downloads folder and extract the openpyxl TAR file there.<\/li>\n
  5. The package should be extracted to the Python folder which is on the C:\\ disk.<\/li>\n
  6. Set the path to the extracted openpyxl package file in the CMD<\/strong>\u00a0terminal to modify the directory.<\/li>\n
  7. Finally, for package installation, run the setup file contained within the openpyxl package file.<\/li>\n
  8. \n
    py setup.py install<\/pre>\n<\/li>\n<\/ol>\n

    Output:<\/strong><\/p>\n

    \"installing<\/p>\n

    Installation of\u00a0 functools32 Library in Linux<\/h3>\n

    We may also use the pip package manager to install the openpyxl package on a Linux system.<\/p>\n

    Steps to be followed:<\/strong><\/p>\n