{"id":134964,"date":"2023-09-26T19:11:47","date_gmt":"2023-09-26T19:11:47","guid":{"rendered":"https:\/\/blog.finxter.com\/?p=457130"},"modified":"2023-09-26T19:11:47","modified_gmt":"2023-09-26T19:11:47","slug":"how-to-install-xlrd-in-python","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2023\/09\/26\/how-to-install-xlrd-in-python\/","title":{"rendered":"How to Install xlrd in Python?"},"content":{"rendered":"\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-top\" data-payload='{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;457130&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;top&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;2&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;5\\\/5 - (2 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;How to Install xlrd in Python?&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n<div class=\"kksr-stars\">\n<div class=\"kksr-stars-inactive\">\n<div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"kksr-stars-active\" style=\"width: 142.5px;\">\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<div class=\"kksr-star\" style=\"padding-right: 5px\">\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/div>\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\"> 5\/5 &#8211; (2 votes) <\/div>\n<\/p><\/div>\n<p>The Python <code>xlrd<\/code> library reads data and formatting information from Excel files in the historical <code>.xls<\/code> format. Note that it won&#8217;t read anything other than <code>.xls<\/code> files. <\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install xlrd<\/pre>\n<p>The Python <strong><code>xlrd<\/code> <\/strong>library is among the top 100 Python libraries, with more than <strong>17,375,582<\/strong> downloads. This article will show you everything you need to install this in your Python environment.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f517.png\" alt=\"\ud83d\udd17\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <a title=\"https:\/\/pypi.org\/project\/xlrd\" href=\"https:\/\/pypi.org\/project\/xlrd\" target=\"_blank\" rel=\"noreferrer noopener\">Library Link<\/a><br \/><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f517.png\" alt=\"\ud83d\udd17\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <a href=\"https:\/\/www.python-excel.org\/\">Other Excel Python Libraries<\/a><\/p>\n<p>Alternatively, you may use any of the following commands to install <code>xlrd<\/code>, depending on your concrete environment. One is likely to work!<\/p>\n<pre class=\"wp-block-preformatted\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>If you have only one version of Python installed:<\/em>\n<code><strong>pip install xlrd<\/strong><\/code> <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>If you have Python 3 (and, possibly, other versions) installed:<\/em>\n<code><strong>pip3 install xlrd<\/strong><\/code> <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>If you don't have PIP or it doesn't work<\/em>\n<code><strong>python -m pip install xlrd\npython3 -m pip install xlrd<\/strong><\/code> <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>If you have Linux and you need to fix permissions (any one):<\/em>\n<code><strong>sudo pip3 install xlrd\npip3 install xlrd <\/strong>--<strong>user<\/strong><\/code> <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>If you have Linux with apt<\/em>\n<code><strong>sudo apt install xlrd<\/strong><\/code> <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>If you have Windows and you have set up the <code>py<\/code> alias<\/em>\n<code><strong>py -m pip install xlrd<\/strong><\/code> <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>If you have Anaconda<\/em>\n<code><strong>conda install -c anaconda xlrd<\/strong><\/code> <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f4a1.png\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <em>If you have Jupyter Notebook<\/em>\n<code><strong>!pip install xlrd<\/strong><\/code>\n<code><strong>!pip3 install xlrd<\/strong><\/code><\/pre>\n<p>Let&#8217;s dive into the installation guides for the different operating systems and environments!<\/p>\n<h2 class=\"wp-block-heading\">How to Install xlrd on Windows?<\/h2>\n<ol>\n<li>Type <code>\"cmd\"<\/code> in the search bar and hit <code>Enter<\/code> to open the command line.<\/li>\n<li>Type &#8220;<code>pip install xlrd<\/code>&#8221; (without quotes) in the command line and hit <code>Enter<\/code> again. This installs xlrd for your default Python installation.<\/li>\n<li>The previous command may not work if you have both Python versions 2 and 3 on your computer. In this case, try <code>\"pip3 install xlrd\"<\/code> or &#8220;<code>python -m pip install xlrd<\/code>&#8220;.<\/li>\n<li>Wait for the installation to terminate successfully. It is now installed on your Windows machine.<\/li>\n<\/ol>\n<p>Here&#8217;s how to open the command line on a (German) Windows machine:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" fetchpriority=\"high\" width=\"986\" height=\"852\" src=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2021\/09\/image-96.png\" alt=\"Open CMD in Windows\" class=\"wp-image-35703\" srcset=\"https:\/\/blog.finxter.com\/wp-content\/uploads\/2021\/09\/image-96.png 986w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2021\/09\/image-96-300x259.png 300w, https:\/\/blog.finxter.com\/wp-content\/uploads\/2021\/09\/image-96-768x664.png 768w\" sizes=\"(max-width: 986px) 100vw, 986px\" \/><\/figure>\n<p>First, try the following command to install <strong>xlrd<\/strong> on your system:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install xlrd<\/pre>\n<p>Second, if this leads to an error message, try this command to install <strong>xlrd<\/strong> on your system:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip3 install xlrd<\/pre>\n<p>Third, if both do not work, use the following long-form command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python -m pip install xlrd<\/pre>\n<p>The difference between <code>pip<\/code> and <code>pip3<\/code> is that <code>pip3<\/code> is an updated version of <code>pip<\/code> for Python <a href=\"https:\/\/blog.finxter.com\/how-to-check-your-python-version\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"HOW TO CHECK YOUR PYTHON VERSION\">version <\/a>3. Depending on what&#8217;s first in the <code>PATH<\/code> variable, <code>pip<\/code> will refer to your Python 2 or Python 3 installation&#8212;and you cannot know which without checking the environment variables. To resolve this uncertainty, you can use <code>pip3<\/code>, which will always refer to your default Python 3 installation.<\/p>\n<h2 class=\"wp-block-heading\">How to Install xlrd on Linux?<\/h2>\n<p>You can install xlrd on Linux in four steps:<\/p>\n<ol>\n<li>Open your Linux terminal or shell<\/li>\n<li>Type &#8220;<code>pip install xlrd<\/code>&#8221; (without quotes), hit Enter.<\/li>\n<li>If it doesn&#8217;t work, try <code>\"pip3 install xlrd\"<\/code> or &#8220;<code>python -m pip install xlrd<\/code>&#8220;.<\/li>\n<li>Wait for the installation to terminate successfully. <\/li>\n<\/ol>\n<p>The package is now installed on your Linux operating system.<\/p>\n<h2 class=\"wp-block-heading\">How to Install xlrd on macOS?<\/h2>\n<p>Similarly, you can install xlrd on macOS in four steps:<\/p>\n<ol>\n<li>Open your macOS terminal.<\/li>\n<li>Type &#8220;<code>pip install xlrd<\/code>&#8221; without quotes and hit <code>Enter<\/code>.<\/li>\n<li>If it doesn&#8217;t work, try <code>\"pip3 install xlrd\"<\/code> or &#8220;<code>python -m pip install xlrd<\/code>&#8220;.<\/li>\n<li>Wait for the installation to terminate successfully. <\/li>\n<\/ol>\n<p>The package is now installed on your macOS.<\/p>\n<h2 class=\"wp-block-heading\">How to Install xlrd in PyCharm?<\/h2>\n<p>Given a <a href=\"https:\/\/blog.finxter.com\/pycharm-a-simple-illustrated-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">PyCharm <\/a>project. How to install the xlrd library in your project within a <a href=\"https:\/\/blog.finxter.com\/python-virtual-environments-with-venv-a-step-by-step-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">virtual environment<\/a> or globally? Here\u2019s a <a href=\"https:\/\/blog.finxter.com\/how-to-install-a-library-on-pycharm\/\" target=\"_blank\" rel=\"noreferrer noopener\">solution <\/a>that always works:<\/p>\n<ul>\n<li>Open <code><strong>File &gt; Settings &gt; Project<\/strong><\/code> from the PyCharm menu.<\/li>\n<li>Select your current project.<\/li>\n<li>Click the <code><strong>Python Interpreter<\/strong><\/code> tab within your project tab.<\/li>\n<li>Click the small <code><strong>+<\/strong><\/code> symbol to add a new library to the project.<\/li>\n<li>Now type in the library to be installed, in your example <code>\"xlrd\"<\/code> without quotes, and click <code><strong>Install Package<\/strong><\/code>.<\/li>\n<li>Wait for the installation to terminate and close all pop-ups.<\/li>\n<\/ul>\n<p>Here\u2019s the general package installation process as a short animated video\u2014it works analogously for xlrd if you type in <em>&#8220;xlrd&#8221;<\/em> in the search field instead:<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/media.giphy.com\/media\/VQoZIvOyP23tVvQlW0\/source.gif\" alt=\"\"\/><\/figure>\n<p>Make sure to select only <em>&#8220;xlrd&#8221; <\/em>because there may be other packages that are not required but also contain the same term (<em>false positives<\/em>):<\/p>\n<h2 class=\"wp-block-heading\">How to Install xlrd in a Jupyter Notebook?<\/h2>\n<p>To install any package in a Jupyter notebook, you can prefix the <code>!pip install my_package<\/code> statement with the exclamation mark <code>\"!\"<\/code>. This works for the xlrd library too:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">!pip install my_package<\/pre>\n<p>This automatically installs the xlrd library when the cell is first executed.<\/p>\n<h2 class=\"wp-block-heading\">How to Resolve ModuleNotFoundError: No module named &#8216;xlrd&#8217;?<\/h2>\n<p>Say you try to import the xlrd package into your Python script without installing it first:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import xlrd\n# ... ModuleNotFoundError: No module named 'xlrd'<\/pre>\n<p>Because you haven&#8217;t installed the package, Python raises a <code>ModuleNotFoundError: No module named 'xlrd'<\/code>. <\/p>\n<p>To fix the error, install the xlrd library using &#8220;<code>pip install xlrd<\/code>&#8221; or &#8220;<code>pip3 install xlrd<\/code>&#8221; in your operating system&#8217;s shell or terminal first. <\/p>\n<p>See above for the different ways to install xlrd in your environment. Also check out my detailed article:<\/p>\n<p class=\"has-base-2-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f517.png\" alt=\"\ud83d\udd17\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Recommended<\/strong>: <a href=\"https:\/\/blog.finxter.com\/fixed-modulenotfounderror-no-module-named-xlrd\/\">[Fixed] ModuleNotFoundError: No module named \u2018xlrd\u2019<\/a><\/p>\n<h2 class=\"wp-block-heading\">Improve Your Python Skills<\/h2>\n<p>If you want to keep improving your Python skills and learn about new and exciting technologies such as Blockchain development, machine learning, and data science, check out the Finxter <a href=\"https:\/\/blog.finxter.com\/email-academy\/\" title=\"Email Academy\" target=\"_blank\" rel=\"noreferrer noopener\">free email academy<\/a> with cheat sheets, regular tutorials, and programming puzzles.<\/p>\n<p>Join us, it&#8217;s fun! <img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/1f642.png\" alt=\"\ud83d\ude42\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n<p class=\"has-base-2-background-color has-background\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/14.0.0\/72x72\/2705.png\" alt=\"\u2705\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> <strong>Recommended<\/strong>: <a href=\"https:\/\/blog.finxter.com\/python-excel-basic-worksheet-operations\/\">Python Excel \u2013 Basic Worksheet Operations<\/a><\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.finxter.com\/how-to-install-xlrd-in-python\/\">How to Install xlrd in Python?<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.finxter.com\">Be on the Right Side of Change<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>5\/5 &#8211; (2 votes) The Python xlrd library reads data and formatting information from Excel files in the historical .xls format. Note that it won&#8217;t read anything other than .xls files. pip install xlrd The Python xlrd library is among the top 100 Python libraries, with more than 17,375,582 downloads. This article will show you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[857],"tags":[73,468,528],"class_list":["post-134964","post","type-post","status-publish","format-standard","hentry","category-python-tut","tag-programming","tag-python","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/134964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=134964"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/134964\/revisions"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=134964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=134964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=134964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}