{"id":1290,"date":"2018-06-23T13:00:28","date_gmt":"2018-06-23T12:00:28","guid":{"rendered":"http:\/\/chewett.co.uk\/blog\/?p=1290"},"modified":"2018-06-28T21:00:37","modified_gmt":"2018-06-28T20:00:37","slug":"fixing-no-module-named-mysqldb-in-fedora-28","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/1290\/fixing-no-module-named-mysqldb-in-fedora-28\/","title":{"rendered":"Fixing No module named MySQLdb in Fedora 28"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1294\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/1290\/fixing-no-module-named-mysqldb-in-fedora-28\/fixing_mysqldb_not_installed_fedora\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_not_installed_fedora.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fixing_mysqldb_not_installed_fedora\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_not_installed_fedora.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_not_installed_fedora.jpg?fit=678%2C254&amp;ssl=1\" class=\"size-full wp-image-1294 aligncenter\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_not_installed_fedora.jpg?resize=678%2C254\" alt=\"\" width=\"678\" height=\"254\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_not_installed_fedora.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_not_installed_fedora.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_not_installed_fedora.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_not_installed_fedora.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/p>\n<p>Today I write about how you can fix the python error &#8220;No module named MySQLdb&#8221; in Fedora 28<\/p>\n<p><!--more--><\/p>\n<h2>Why this error occurs<\/h2>\n<p>This can occur when you try and run a python script that imports the module MySQLdb.<\/p>\n<p>If this is not properly installed it will then display the error &#8220;No module named MySQLdb&#8221;. To resolve this you need to install the module.<\/p>\n<h2>Installing MySQLdb for python 2 on Fedora 28<\/h2>\n<p>On Fedora 28 you can install MySQLdb by entering the following command:<\/p>\n<pre>sudo dnf install\u00a0python2-mysql<\/pre>\n<p>This will install the libraries needed for\u00a0MySQLdb and configure\u00a0MySQLdb for python2.<\/p>\n<p><em>Note: MySQLdb is not available for <\/em>python<em> 3. If you want to use this in <\/em>python<em> 3 you will have to look for another MySQL connector library.<\/em><\/p>\n<p>Once this is installed you will be able to run your python 2 scripts which import this module.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I write about how you can fix the python error &#8220;No module named MySQLdb&#8221; in Fedora 28<\/p>\n","protected":false},"author":1,"featured_media":1293,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Last week I wrote about Fixing No module named #MySQLdb in #Fedora 28 #python2","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[41,274,278,184,279],"class_list":["post-1290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fixes","tag-fedora","tag-fedora-28","tag-mysqldb","tag-python","tag-python-2"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_mysqldb_python2_fedora28.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-kO","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":997,"url":"https:\/\/chewett.co.uk\/blog\/997\/installing-dropbox-fedora-27-xfce\/","url_meta":{"origin":1290,"position":0},"title":"Installing Dropbox on Fedora 27 XFCE","author":"Chewett","date":"February 7, 2018","format":false,"excerpt":"This blog post describes how you can install Dropbox on Fedora 27 XFCE. Installing pre-requisite packages Before we can install Dropbox we need to install a number of pre-requisite packages. The full command to install the required packages is: sudo\u00a0dnf\u00a0install\u00a0libgnome\u00a0nautilus-extensions python-gpgme The first two packages, libgnome\u00a0and\u00a0nautilus-extensions, are required by the\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":907,"url":"https:\/\/chewett.co.uk\/blog\/907\/fixing-importerror-no-module-named-winrandom\/","url_meta":{"origin":1290,"position":1},"title":"Fixing ImportError: No module named &#8216;winrandom&#8217;","author":"Chewett","date":"December 13, 2017","format":false,"excerpt":"This post describes how you can fix the python error No module named 'winrandom'. This is typically found when you are using the pyCrypto or\u00a0coinbase python module. What is the No module named 'winrandom' error This python error may occur whenever you try and use a module that requires the\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/12\/python_fix_winrandom_error.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/12\/python_fix_winrandom_error.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/12\/python_fix_winrandom_error.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/12\/python_fix_winrandom_error.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1321,"url":"https:\/\/chewett.co.uk\/blog\/1321\/how-to-install-the-official-mysql-community-server-on-fedora-28\/","url_meta":{"origin":1290,"position":2},"title":"How to Install the official MySQL community server on Fedora 28","author":"Chewett","date":"July 25, 2018","format":false,"excerpt":"Today I talk about how you can install the official\u00a0MySQL community server on Fedora 28. Why you cant just use DNF to install mysql-server In the last couple versions of Fedora the default MySQL\u00a0distribution was changed to mariadb. While this is, for the most part, a drop in replacement this\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/07\/installing_offical_mysql.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/07\/installing_offical_mysql.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/07\/installing_offical_mysql.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/07\/installing_offical_mysql.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1281,"url":"https:\/\/chewett.co.uk\/blog\/1281\/how-to-install-redmine-on-fedora-28\/","url_meta":{"origin":1290,"position":3},"title":"How to Install Redmine on Fedora 28","author":"Chewett","date":"July 4, 2018","format":false,"excerpt":"In this post I talk about the additional steps needed to install Redmine on Fedora 28. Pre-installation\u00a0steps required for Fedora 28 To install Redmine\u00a0on Fedora 28 you will need to install a number of packages first. These are required for the\u00a0ruby gem files to be compiled and installed. To quickly\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/installing_redmine_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/installing_redmine_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/installing_redmine_on_fedora.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/installing_redmine_on_fedora.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":343,"url":"https:\/\/chewett.co.uk\/blog\/343\/raspberrypivcgencmd-python-library-access-raspberry-pi-vcgencmd-command\/","url_meta":{"origin":1290,"position":4},"title":"RaspberryPiVcgencmd A python library to access Raspberry Pi vcgencmd command","author":"Chewett","date":"May 31, 2017","format":false,"excerpt":"To access some of the lower level aspects of the Raspberry Pi's config you can use the built in command vcgencmd. This is a useful on the command line but to easily access it in a program you need to parse the output. I am planning to use this command\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/vcgencmd.png?fit=628%2C288&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/vcgencmd.png?fit=628%2C288&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/vcgencmd.png?fit=628%2C288&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1283,"url":"https:\/\/chewett.co.uk\/blog\/1283\/fixing-failed-to-build-nokogiri-1-8-3-gem-fedora-28\/","url_meta":{"origin":1290,"position":5},"title":"Fixing Failed to build nokogiri 1.8.3 gem Fedora 28","author":"Chewett","date":"June 27, 2018","format":false,"excerpt":"Today I talk about how I fixed \"Failed to build nokogiri\u00a01.8.3\" on Fedora 28. Whats the issue with nokogiri 1.8.3 on Fedora 28? At the moment any ruby applications that requires nokogiri\u00a01.8.3 in the Gemfile will fail to build. This is due to an issue with the libraries packaged in\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/06\/fixing_failed_to_build_nokogiri_fedora.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=1290"}],"version-history":[{"count":5,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1290\/revisions"}],"predecessor-version":[{"id":1298,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1290\/revisions\/1298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/1293"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=1290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=1290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=1290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}