Skip to content

Chris' Laboratory

chrislee.kr – Personal blog as bookshelves

Menu
  • Home
  • Github
  • Contact Me
Menu

EnvironmentError: mysql_config not found

Posted on 09/05/201429/08/2020 by Chris Lee
Read Time:3 Minute, 55 Second

I am using Mac OS X 10.9, MAMP 1.9 (MySQL 5.1.44), Python 2.7.5.

Got this error when I change database configuration in settings.py.

I felt this issue can make me painful, so I start logging what happened and how I fixed.

Do not follow below steps. Just go straightly bottom of article and read last part.

  File "setup_posix.py", line 43, in get_config

    libs = mysql_config("libs_r")

  File "setup_posix.py", line 25, in mysql_config

    raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

Searched google and found a problem. According this article, it might be missing the MySQLdb module. So I need to install it. To install MySQLdb module, I found another article that explains how to install.

Step 1: Open shell and execute below

export PATH=/usr/local/mysql/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

However, since I am using MAMP database, I had to set up differently as below:

export PATH=/Applications/MAMP/Library/bin:$PATH
export DYLD_LIBRARY_PATH=/Applications/MAMP/Library/lib/mysql

Step 2: Execute below

sudo pip install MySQL-python

However, I got the error as below:

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

According to this article, the error is causing by some Python compile issue.

So, execute below

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

And -mno-fused-madd error is gone; however, I faced another error (f**k)

cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -arch x86_64 -arch i386 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/Applications/MAMP/Library/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -fno-omit-frame-pointer -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL

_mysql.c:44:10: fatal error: 'my_config.h' file not found

#include "my_config.h"

         ^

1 error generated.

error: command 'cc' failed with exit status 1

OK, according to this article, MAMP’s version of MySQL does not contain the dev headers. Therefore, I should download headers and integrate with MAMP.

At this point, I planned to give up. However, I found this resource, which looks very relevant with this problem. (I couldn’t open original webpage; thus, the link is cached from Google)

New Step 1 Start: install XCode.

I already have XCode installed. Thus, skip this step.

Step 2: Install CMake

Open http://www.cmake.org/cmake/resources/software.html and download Mac OS X dmg file.

Install CMake.

Step 3: Stop MAMP completely

Done

Step 4: Download MySQL header

Open http://sourceforge.net/projects/mamp/files/mamp/ and find your MAMP version.

In your MAMP version folder, you can find MAMP_components_{version}.dmg. In my case, MAMP_components_1.9.dmg

Once finish download, mount and find mysql-{version}.tar.gz in MAMP_src folder. And extract tar archive.

cd /tmp
cp /Volumes/MAMP_components_1.9/MAMP_src/mysql-5.1.44.tar.gz .
tar xzvf mysql-5.1.44.tar.gz
cd mysql-5.1.44

Run CMake with MySQL 5.1.44.

cmake . -DMYSQL_UNIX_ADDR=/Applications/MAMP/tmp/mysql/mysql.sock -DCMAKE_INSTALL_PREFIX=/Applications/MAMP/Library

Then you will get this error.

-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:24 (INCLUDE):
  include could not find load file:

    win/configure.data


-- Detected 64-bit platform.
build CSV as static library
build HEAP as static library
build MYISAM as static library
build MYISAMMRG as static library
build ARCHIVE as DLL
build BLACKHOLE as DLL
build EXAMPLE as DLL
build FEDERATED as DLL
build INNOBASE as DLL
build INNODB_PLUGIN as DLL
-- Configuring incomplete, errors occurred!

Now, run below command and do following replace:

nano CMakeLists.txt

And find win/configure.data line, and comment out as below.

# INCLUDE(win/configure.data)

Then run below command

cmake . -DMYSQL_UNIX_ADDR=/Applications/MAMP/tmp/mysql/mysql.sock -DCMAKE_INSTALL_PREFIX=/Applications/MAMP/Library

And I got other errors. Damn… Give up this solution.

Tried to find out another solution.

I followed below. Now don’t have energy to write steps. Just go to his article and follow the step.

http://tom.londondroids.com/2012/05/setting-up-django-with-mamp-on-mac-os-x-lion-in-steps/

 

 

Share

Facebook
Twitter
LinkedIn
Email

Related

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Categories

  • Databases (11)
    • MongoDB (4)
    • MS-SQL (1)
    • MySQL (6)
  • E-Commerce (8)
    • Magento (8)
  • Finance (2)
  • Frameworks (84)
    • Adobe Flex (1)
    • Angular (ngx) (3)
    • Codeigniter (6)
    • CSS (5)
    • Django (2)
    • Javascript (13)
    • Node.js (6)
    • PHP (17)
    • React Native (4)
    • React.js (1)
    • Sencha Touch (4)
    • Terraform (1)
    • Vue.js (1)
    • WordPress (4)
    • Yii2 (3)
  • General Documents (15)
  • Marketing (3)
  • Mobile Development (33)
    • Android (20)
    • iPhone (13)
  • Platforms (21)
    • Arduino (2)
    • Docker (5)
    • Google App Engine (5)
    • Raspberry Pi (5)
    • Samsung Smart TV (4)
  • Security (17)
  • Server (31)
    • Linux (13)
  • Tools (14)
    • SVN (7)
  • Uncategorized (2)

Search

Recent Posts

  • Bootstrapping Kubernetes cluster with kubeadm
  • Taint all resources in the one module
  • Alpine – Plugin caching_sha2_password could not be loaded
  • npm link with peerDependencies
  • How to setup Gitlab runner with KVM enabled

Recent Comments

  • Obayed on Binance Auto Trading Bot – Buy low/Sell high with stop loss limit/Trade multiple coins
  • Ari on How to install memcache.so/memcached.so for MAMP Pro (Mac)
  • Mida ali on Binance Auto Trading Bot – Buy low/Sell high with stop loss limit/Trade multiple coins
  • Chris Lee on How to install memcache.so/memcached.so for MAMP Pro (Mac)
  • Chris Lee on Setting Up A VPN Server On OSX 10.6

Tags

1 ajax amazon android android-addpart browser chrislee-kr codeigniter codeigniter-tcpdf com-apple-net-racoon CSS CSS history hack delpaigmail-com entity-addpart-double exception-printing-is-disabled-by-default-for-security-reasons ext-plugins-listpagingplugin ext-plugins-listpagingplugin-example f iphone javascript jquery-defaultchecked jquery-samsung-smart-tv listpagingplugin mac magento-exception-printing-is-disabled-by-default-for-security-reasons magento-sample-data-exception-printing-is-disabled-by-default-for-security-reasons nu-vot null-core-errors-confignotfound-config-mk9engine-ini php samsung-smart-tv-jquery samsung-smart-tv-sdk-ajax samsung-smart-tv-sdk-jquery samsung-tv-sdk samsung-tv-sdk-jquery samsung tv sencha-smart-tv sencha-touch-list-paging smart-tv-jquery sqlite subversion svn tcedook tcpdf-codeigniter uilinebreakmodecharacterwrap-is-deprecated unknown-column-link-area

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2023 Chris' Laboratory | Powered by Minimalist Blog WordPress Theme