Installation error on mac (manually)

@darnpunk

Having also followed the steps you’ve pointed out above I was still not able to get it to install frappe.

However, after numerous trials & errors this is what I had done to end up with a working development on MacOS Sierra without having to do a clean install.

I’ve included steps from the beginning and anyone can pick up from wherever they are stuck. This is what worked for me and may or may not work for others, You really have to see what errors you are getting to get a MacOS installation successfully.

brew install python
brew install mariadb
brew install git
brew install nodejs
brew install nginx
brew install redis
brew install supervisor
brew install caskroom/cask/wkhtmltopdf
brew install mysql-connector-c
pip install supervisor

** Check version after install

To install MySQL-Python I had to unlink both mariadb and mariadb-connector-c so that it would install without any issues

brew unlink mariadb
brew unlink mariadb-connector-c
pip install MySQL-python
ln -s /usr/local/opt/mariadb-connector-c/bin/mariadb_config /usr/local/bin/mysql_config
pip install MySQL-python
pip list – Check MySQL-Python appears on list
brew link --overwrite mariadb

for some reason the installation of mysqlclient interfered with installing frappe so in my case I uninstalled it then reinstalled (may not be the case with others)

pip uninstall mysqlclient
bench init frappe-bench && cd frappe-bench
pip install mysqlclient

(Use this option if bench init frappe-bench did not install properly)
get-app GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)

brew services restart mariadb

npm install babel-core less chokidar babel-preset-es2015 babel-preset-es2016 babel-preset-es2017 babel-preset-babili
npm install express
npm install socket.io
npm install redis
npm install superagent

bench setup procfile
bench setup redis
brew services start supervisor

bench --site site1.local install-app erpnext
bench start

For reference following is what the current PIP installs are


ansible (2.0.2.0)
asn1crypto (0.22.0)
bench (4.1.0, /Users/user/Sites/erpnext/bench-repo)
certifi (2017.4.17)
cffi (1.10.0)
chardet (3.0.3)
click (6.7)
cryptography (1.9)
cssmin (0.2.0)
dropbox (7.3.1)
enum34 (1.1.6)
ez-setup (0.9)
gitdb (0.6.4)
GitPython (0.3.2rc1)
gunicorn (19.7.1)
honcho (1.0.1)
httplib2 (0.10.3)
idna (2.5)
ipaddress (1.0.18)
Jinja2 (2.9.6)
markdown2 (2.3.4)
MarkupSafe (1.0)
meld3 (1.0.2)
MySQL-python (1.2.5)
paramiko (2.1.2)
pip (9.0.1)
psutil (5.2.2)
pyasn1 (0.2.3)
pycparser (2.17)
pycrypto (2.6.1)
PyMySQL (0.7.11)
python-crontab (2.2.2)
python-dateutil (2.6.0)
PyYAML (3.12)
requests (2.17.3)
semantic-version (2.6.0)
setuptools (36.0.1)
six (1.10.0)
smmap (0.9.0)
supervisor (3.3.1)
urllib3 (1.21.1)
virtualenv (15.1.0)
wheel (0.29.0)

Brew Install List


boost 1.64.0_1
dnsmasq 2.76 2.77_1
gcc 7.1.0
gdbm 1.13
git 2.13.0
gmp 6.1.2
highlight 3.38
icu4c 58.2
isl 0.18
libmpc 1.0.3_1
lua 5.2.4_4
mariadb 10.2.6
mariadb-connector-c 2.2.2
mpfr 3.1.5
nginx 1.12.0_1
node 8.0.0_1
openssl 1.0.2l
openssl@1.1 1.1.0f
pcre 8.40
python 2.7.13
readline 7.0.3_1
redis 3.2.9
sqlite 3.19.2
supervisor 3.3.2
tomcat 8.5.15

Unfortunately at the moment setting up a new ERPNext developer machine does not work with the Easy Install script nor with the instruction on manual installation that I wrote here. At the moment frappe framework doesn’t work on a clean macOS.

I have tried the setup on macOS Sierra 10.12.6 now on 2 different machines multiple times with clean setups. I always get stuck at bench init frappe-bench with the mysqlclient error.

There are several ideas here on how to resolve it in different discussion posts none of which works and plenty of which lead in the wrong way of some scary sudo commands and deletions.

We need some attention from somebody to fix the easy install script and the instruction of how to manually turn your Mac into a developer machine.

My error:

Command "/Users/dominik/Dev/frappe-bench/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/j0/2myy0yqd6cl8ft548hc1zvbc0000gn/T/pip-build-Y5PCYq/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/j0/2myy0yqd6cl8ft548hc1zvbc0000gn/T/pip-HrXafX-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/dominik/Dev/frappe-bench/env/bin/../include/site/python2.7/mysqlclient" failed with error code 1 in /private/var/folders/j0/2myy0yqd6cl8ft548hc1zvbc0000gn/T/pip-build-Y5PCYq/mysqlclient/

@dominik Please post the output of

pip install mysqlclient==1.3.10

Hi @saurabh6790 I already shared by email but here it is again:

Collecting mysqlclient==1.3.10
  Using cached mysqlclient-1.3.10.tar.gz
Building wheels for collected packages: mysqlclient
  Running setup.py bdist_wheel for mysqlclient ... error
  Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/wn/97m5_mc91szfx1hcfdzyvfcw0000gn/T/pip-build-9WR8GR/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/wn/97m5_mc91szfx1hcfdzyvfcw0000gn/T/tmpz9azeJpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.12-x86_64-2.7
  copying _mysql_exceptions.py -> build/lib.macosx-10.12-x86_64-2.7
  creating build/lib.macosx-10.12-x86_64-2.7/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
  copying MySQLdb/compat.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
  copying MySQLdb/connections.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
  copying MySQLdb/converters.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
  copying MySQLdb/release.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
  copying MySQLdb/times.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
  creating build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
  running build_ext
  building '_mysql' extension
  creating build/temp.macosx-10.12-x86_64-2.7
  clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,3,10,'final',0) -D__version__=1.3.10 -I/usr/local/Cellar/mariadb/10.2.8/include/mysql -I/usr/local/Cellar/mariadb/10.2.8/include/mysql/.. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.12-x86_64-2.7/_mysql.o
  _mysql.c:29:10: fatal error: 'my_config.h' file not found
  #include "my_config.h"
           ^~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1

  ----------------------------------------
  Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient ... error
    Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/wn/97m5_mc91szfx1hcfdzyvfcw0000gn/T/pip-build-9WR8GR/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/wn/97m5_mc91szfx1hcfdzyvfcw0000gn/T/pip-JI3cJt-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.12-x86_64-2.7
    copying _mysql_exceptions.py -> build/lib.macosx-10.12-x86_64-2.7
    creating build/lib.macosx-10.12-x86_64-2.7/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
    copying MySQLdb/compat.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb
    creating build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.12-x86_64-2.7/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.macosx-10.12-x86_64-2.7
    clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,3,10,'final',0) -D__version__=1.3.10 -I/usr/local/Cellar/mariadb/10.2.8/include/mysql -I/usr/local/Cellar/mariadb/10.2.8/include/mysql/.. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.12-x86_64-2.7/_mysql.o
    _mysql.c:29:10: fatal error: 'my_config.h' file not found
    #include "my_config.h"
             ^~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/wn/97m5_mc91szfx1hcfdzyvfcw0000gn/T/pip-build-9WR8GR/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/wn/97m5_mc91szfx1hcfdzyvfcw0000gn/T/pip-JI3cJt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/wn/97m5_mc91szfx1hcfdzyvfcw0000gn/T/pip-build-9WR8GR/mysqlclient/