{"id":52265,"date":"2026-11-01T10:50:48","date_gmt":"2026-11-01T10:50:48","guid":{"rendered":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/"},"modified":"2026-11-01T10:50:48","modified_gmt":"2026-11-01T10:50:48","slug":"installing-libraries","status":"publish","type":"siratek_tutorial","link":"https:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/","title":{"rendered":"Installing and Managing Libraries"},"content":{"rendered":"<body><p><\/p>\n<h2>What this covers<\/h2>\n<p>What a library is, the two ways to install one, and how to avoid the version problems that make a sketch work on one computer and fail on another.<\/p>\n<p>You will need this before the DHT11, every display, and most modules that talk over I2C or SPI.<\/p>\n<h2>Before you begin<\/h2>\n<p>The Arduino IDE open, and an internet connection for the first method below.<\/p>\n<h2>What a library actually is<\/h2>\n<p>A library is somebody else\u2019s code, written once so that you do not have to write it again.<\/p>\n<p>Take the DHT11 temperature sensor. It communicates over a single wire using a timing pattern where the difference between a one and a zero is a few microseconds of pulse width. Reading it correctly means handling that timing exactly. You could write it. It would take an evening, and the result would be code you then have to maintain.<\/p>\n<p>Instead, <code>#include &lt;DHT.h&gt;<\/code> at the top of a sketch brings in a tested implementation, and you call <code>dht.readTemperature()<\/code>. The hard part is still happening, just not in your file.<\/p>\n<p>This is why a module with a complicated protocol is often easier to use than a simple one, and why the question \u201cis there a library for this\u201d is usually worth asking first.<\/p>\n<figure class=\"siratek-tutorial-figure\"><img decoding=\"async\" src=\"http:\/\/siratek.net\/wp-content\/uploads\/2026\/11\/installing-libraries-where-libraries-live.svg\" alt=\"Three sources of libraries, the sketchbook libraries folder they land in, and the include line that finds them\" loading=\"lazy\"><figcaption>However it arrives, it lands in the same folder, and the include line is resolved against it.<\/figcaption><\/figure>\n<h2>Installing from the Library Manager<\/h2>\n<p>This is the normal route and handles almost everything.<\/p>\n<ol>\n<li>Open <strong>Tools &gt; Manage Libraries<\/strong>, or click the books icon in the left sidebar of IDE 2.x.<\/li>\n<li>Type the library name into the search box.<\/li>\n<li>Check the author before installing. Several libraries often share a similar name, and the documentation you are following means a specific one.<\/li>\n<li>Click <strong>Install<\/strong>.<\/li>\n<li>If the IDE offers to install dependencies as well, accept.<\/li>\n<\/ol>\n<h3>Dependencies<\/h3>\n<p>Some libraries need other libraries. Adafruit\u2019s sensor libraries, for instance, generally need <strong>Adafruit Unified Sensor<\/strong> installed alongside them.<\/p>\n<p>Newer IDE versions offer to handle this for you. If yours does not, or you decline, the sketch will fail to compile with an error naming a file it cannot find. That error message is telling you exactly which library is missing.<\/p>\n<h2>Installing from a ZIP file<\/h2>\n<p>Some libraries are not in the Library Manager, usually because they live only on GitHub.<\/p>\n<ol>\n<li>Download the repository as a ZIP. Do not unzip it.<\/li>\n<li>In the IDE, choose <strong>Sketch &gt; Include Library &gt; Add .ZIP Library<\/strong>.<\/li>\n<li>Select the file you downloaded.<\/li>\n<li>Restart the IDE if the library does not appear under <strong>File &gt; Examples<\/strong>.<\/li>\n<\/ol>\n<p>Before installing anything this way, check the licence in the repository. Siratek\u2019s <a href=\"http:\/\/..\/governance\/source-and-licensing.md\">sourcing rules<\/a> require the repository URL, licence, version and test result to be recorded for any library used in a published tutorial.<\/p>\n<h2>Finding the examples<\/h2>\n<p>Every well-made library ships with example sketches, and they are more reliable than most documentation because they are maintained alongside the code.<\/p>\n<p><strong>File &gt; Examples<\/strong>, then scroll past the built-in examples to the section for installed libraries. Opening the example for a new module and running it unmodified is the fastest way to find out whether your wiring is right, because it removes your code from the question entirely.<\/p>\n<h2>Versions, and why they matter<\/h2>\n<p>Libraries change. Functions get renamed, arguments get added, behaviour gets corrected. A sketch written against one version can fail against the next.<\/p>\n<p>This is the most common reason a tutorial that worked last year does not work today, and it is rarely diagnosed correctly, because the error appears in your sketch rather than in the library that changed underneath it.<\/p>\n<p>Two habits prevent most of the pain.<\/p>\n<ul>\n<li><strong>Record the version you used.<\/strong> The Library Manager shows it next to each installed library. Every Siratek tutorial has a <code>library<\/code> field in its front matter for exactly this.<\/li>\n<li><strong>Do not update a library in the middle of a working project.<\/strong> Finish, then update, then test again.<\/li>\n<\/ul>\n<p>The Library Manager lets you select an older version from the dropdown beside a library and install that specific one, which is how you return to a known-good state.<\/p>\n<h2>Where libraries live<\/h2>\n<p>Installed libraries go in a <code>libraries<\/code> folder inside your Arduino sketchbook directory. You can see the path at <strong>File &gt; Preferences<\/strong>, under \u201cSketchbook location\u201d.<\/p>\n<p>Knowing this is useful for two things: removing a library the IDE will not uninstall cleanly, by deleting its folder with the IDE closed, and checking whether you have accidentally installed two versions of the same library, which produces compile errors that make no sense otherwise.<\/p>\n<h2>Check yourself<\/h2>\n<ol>\n<li>A sketch fails to compile with <code>No such file or directory<\/code> naming a header. What is wrong?<\/li>\n<li>You follow a tutorial exactly and it fails. Where would you look first?<\/li>\n<li>Why install a library\u2019s example sketch before writing your own?<\/li>\n<li>Where would you record which version you used?<\/li>\n<\/ol>\n<h2>Troubleshooting<\/h2>\n<table>\n<thead>\n<tr>\n<th>Symptom<\/th>\n<th>Likely cause<\/th>\n<th>Check or fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>No such file or directory<\/code><\/td>\n<td>Library not installed<\/td>\n<td>Install it, matching the author named in the tutorial<\/td>\n<\/tr>\n<tr>\n<td>Installed, still not found<\/td>\n<td>IDE needs restarting<\/td>\n<td>Close and reopen the IDE<\/td>\n<\/tr>\n<tr>\n<td>A dependency is missing<\/td>\n<td>Not installed alongside<\/td>\n<td>Install the library it names, then recompile<\/td>\n<\/tr>\n<tr>\n<td>Compiles for Uno, fails for ESP32<\/td>\n<td>Library does not support that board<\/td>\n<td>Check the library\u2019s supported architectures<\/td>\n<\/tr>\n<tr>\n<td>Errors that make no sense<\/td>\n<td>Two versions installed<\/td>\n<td>Look in the sketchbook <code>libraries<\/code> folder for duplicates<\/td>\n<\/tr>\n<tr>\n<td>Worked before, fails now<\/td>\n<td>Library updated<\/td>\n<td>Install the version the tutorial names<\/td>\n<\/tr>\n<tr>\n<td>Example sketch missing<\/td>\n<td>Library has none, or needs a restart<\/td>\n<td>Restart, then check <strong>File &gt; Examples<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Next steps<\/h2>\n<ul>\n<li><strong>Easier first:<\/strong> <em>Getting Started with Arduino Uno<\/em>.<\/li>\n<li><strong>Next:<\/strong> <em>Read Temperature and Humidity with DHT11<\/em>, the first tutorial here that needs a library.<\/li>\n<li><strong>Later:<\/strong> <em>Pinning Library Versions<\/em>, once you are maintaining projects over time.<\/li>\n<\/ul>\n<h2>Sources and attribution<\/h2>\n<p>All text in this tutorial is original Siratek work.<\/p>\n<ul>\n<li>Arduino IDE 2 documentation, for the Library Manager and ZIP installation routes.<\/li>\n<\/ul>\n<p>Library names are given as pointers to their official sources. No third-party library code, tutorial text, diagrams or photographs has been reproduced here.<\/p>\n<p><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>What a library is, the two ways to install one, and how to avoid the version problems that make a sketch work on one computer and fail on another.<\/p>\n","protected":false},"featured_media":0,"template":"","siratek_tutorial_level":[],"class_list":["post-52265","siratek_tutorial","type-siratek_tutorial","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Installing and Managing Libraries - siratek<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing and Managing Libraries - siratek\" \/>\n<meta property=\"og:description\" content=\"What a library is, the two ways to install one, and how to avoid the version problems that make a sketch work on one computer and fail on another.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/\" \/>\n<meta property=\"og:site_name\" content=\"siratek\" \/>\n<meta property=\"og:image\" content=\"http:\/\/siratek.net\/wp-content\/uploads\/2026\/11\/installing-libraries-where-libraries-live.svg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/installing-libraries\\\/\",\"url\":\"http:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/installing-libraries\\\/\",\"name\":\"Installing and Managing Libraries - siratek\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/siratek.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/installing-libraries\\\/#primaryimage\"},\"image\":{\"@id\":\"http:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/installing-libraries\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/siratek.net\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/installing-libraries-where-libraries-live.svg\",\"datePublished\":\"2026-11-01T10:50:48+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/installing-libraries\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/installing-libraries\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/installing-libraries\\\/#primaryimage\",\"url\":\"https:\\\/\\\/siratek.net\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/installing-libraries-where-libraries-live.svg\",\"contentUrl\":\"https:\\\/\\\/siratek.net\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/installing-libraries-where-libraries-live.svg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/installing-libraries\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/siratek.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/siratek.net\\\/index.php\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Installing and Managing Libraries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/siratek.net\\\/#website\",\"url\":\"https:\\\/\\\/siratek.net\\\/\",\"name\":\"siratek\",\"description\":\"Your Best Electronic Retail Shop\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/siratek.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installing and Managing Libraries - siratek","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/","og_locale":"en_US","og_type":"article","og_title":"Installing and Managing Libraries - siratek","og_description":"What a library is, the two ways to install one, and how to avoid the version problems that make a sketch work on one computer and fail on another.","og_url":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/","og_site_name":"siratek","og_image":[{"url":"http:\/\/siratek.net\/wp-content\/uploads\/2026\/11\/installing-libraries-where-libraries-live.svg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/","url":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/","name":"Installing and Managing Libraries - siratek","isPartOf":{"@id":"https:\/\/siratek.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/#primaryimage"},"image":{"@id":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/#primaryimage"},"thumbnailUrl":"http:\/\/siratek.net\/wp-content\/uploads\/2026\/11\/installing-libraries-where-libraries-live.svg","datePublished":"2026-11-01T10:50:48+00:00","breadcrumb":{"@id":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/#primaryimage","url":"https:\/\/siratek.net\/wp-content\/uploads\/2026\/11\/installing-libraries-where-libraries-live.svg","contentUrl":"https:\/\/siratek.net\/wp-content\/uploads\/2026\/11\/installing-libraries-where-libraries-live.svg"},{"@type":"BreadcrumbList","@id":"http:\/\/siratek.net\/index.php\/tutorials\/installing-libraries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/siratek.net\/"},{"@type":"ListItem","position":2,"name":"Tutorials","item":"https:\/\/siratek.net\/index.php\/tutorials\/"},{"@type":"ListItem","position":3,"name":"Installing and Managing Libraries"}]},{"@type":"WebSite","@id":"https:\/\/siratek.net\/#website","url":"https:\/\/siratek.net\/","name":"siratek","description":"Your Best Electronic Retail Shop","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/siratek.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/siratek.net\/index.php\/wp-json\/wp\/v2\/siratek_tutorial\/52265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/siratek.net\/index.php\/wp-json\/wp\/v2\/siratek_tutorial"}],"about":[{"href":"https:\/\/siratek.net\/index.php\/wp-json\/wp\/v2\/types\/siratek_tutorial"}],"version-history":[{"count":0,"href":"https:\/\/siratek.net\/index.php\/wp-json\/wp\/v2\/siratek_tutorial\/52265\/revisions"}],"wp:attachment":[{"href":"https:\/\/siratek.net\/index.php\/wp-json\/wp\/v2\/media?parent=52265"}],"wp:term":[{"taxonomy":"siratek_tutorial_level","embeddable":true,"href":"https:\/\/siratek.net\/index.php\/wp-json\/wp\/v2\/siratek_tutorial_level?post=52265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}