Error when running bench update (MacOS)

I am receiving errors below while doing an update:

bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull upstream master
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream master
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    Command “/Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/python2.7 -u -c “import setuptools, tokenize;file=‘/private/var/folders/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-build-0O00my/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/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-LsFNJn-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/…/include/site/python2.7/mysqlclient” failed with error code 1 in /private/var/folders/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-build-0O00my/mysqlclient/
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 11, in
    load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
    File “/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/cli.py”, line 40, in cli
    bench_command()
    File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
    return callback(*args, **kwargs)
    File “/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/commands/update.py”, line 62, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force, reset=reset)
    File “/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/commands/update.py”, line 82, in _update
    update_requirements(bench_path=bench_path)
    File “/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/utils.py”, line 399, in update_requirements
    install_requirements(pip, req_file)
    File “/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/utils.py”, line 435, in install_requirements
    exec_cmd(“{pip} install -q -r {req_file}”.format(pip=pip, req_file=req_file))
    File “/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/utils.py”, line 130, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: ./env/bin/pip install -q -r ./apps/frappe/requirements.txt

Seems related to mysql? But it was running ok. I can also do bench mysql.

Take a backup of ur db and try to reinstall mysql

run bench mysql and share screenshot

it’s an issue created by the new bench requirements
im pretty sure it’s also taking down socket.io if your not on v8

run this under bench ./env/bin/pip install -r ./apps/frappe/requirements.txt and let me know the exact error.

You can try following:
1 > sudo apt-get install libffi-dev

I ran that line and got this:

./env/bin/pip install -r ./apps/frappe/requirements.txt
Requirement already satisfied: chardet in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 1))
Requirement already satisfied: cssmin in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 2))
Requirement already satisfied: dropbox in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 3))
Requirement already satisfied: gunicorn in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 4))
Requirement already satisfied: httplib2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 5))
Requirement already satisfied: jinja2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 6))
Requirement already satisfied: markdown2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 7))
Requirement already satisfied: markupsafe in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 8))
Collecting mysqlclient==1.3.8 (from -r ./apps/frappe/requirements.txt (line 9))
  Using cached mysqlclient-1.3.8.tar.gz
Requirement already satisfied: python-geoip in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 10))
Requirement already satisfied: python-geoip-geolite2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 11))
Requirement already satisfied: python-dateutil in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 12))
Requirement already satisfied: pytz in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 13))
Requirement already satisfied: six in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 14))
Requirement already satisfied: termcolor in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 15))
Requirement already satisfied: werkzeug in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 16))
Requirement already satisfied: semantic_version in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 17))
Requirement already satisfied: rauth>=0.6.2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 18))
Requirement already satisfied: requests in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 19))
Requirement already satisfied: redis in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 20))
Requirement already satisfied: selenium in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 21))
Obtaining pdfkit from git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit (from -r ./apps/frappe/requirements.txt (line 22))
  Updating ./env/src/pdfkit clone
Requirement already satisfied: babel in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 23))
Requirement already satisfied: ipython in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: html2text in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 25))
Requirement already satisfied: email_reply_parser in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 26))
Requirement already satisfied: click in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 27))
Requirement already satisfied: num2words in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 28))
Requirement already satisfied: watchdog==0.8.0 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 29))
Requirement already satisfied: bleach in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 30))
Requirement already satisfied: bleach-whitelist in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 31))
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 32))
Requirement already satisfied: beautifulsoup4 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 33))
Requirement already satisfied: rq in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 34))
Requirement already satisfied: schedule in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 35))
Requirement already satisfied: cryptography in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 36))
Requirement already satisfied: zxcvbn in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 37))
Requirement already satisfied: psutil in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 38))
Requirement already satisfied: unittest-xml-reporting in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 39))
Requirement already satisfied: xlwt in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 40))
Requirement already satisfied: oauthlib in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 41))
Requirement already satisfied: PyJWT in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 42))
Requirement already satisfied: pypdf in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 43))
Requirement already satisfied: openpyxl in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 44))
Requirement already satisfied: urllib3 in ./env/lib/python2.7/site-packages (from dropbox->-r ./apps/frappe/requirements.txt (line 3))
Requirement already satisfied: typing>=3.5.2 in ./env/lib/python2.7/site-packages (from dropbox->-r ./apps/frappe/requirements.txt (line 3))
Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: pickleshare in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: simplegeneric>0.8 in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: setuptools>=18.5 in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: decorator in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: pexpect; sys_platform != "win32" in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: pygments in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: traitlets>=4.2 in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: appnope; sys_platform == "darwin" in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: pathlib2; python_version == "2.7" or python_version == "3.3" in ./env/lib/python2.7/site-packages (from ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: PyYAML>=3.10 in ./env/lib/python2.7/site-packages (from watchdog==0.8.0->-r ./apps/frappe/requirements.txt (line 29))
Requirement already satisfied: pathtools>=0.1.1 in ./env/lib/python2.7/site-packages (from watchdog==0.8.0->-r ./apps/frappe/requirements.txt (line 29))
Requirement already satisfied: argh>=0.24.1 in ./env/lib/python2.7/site-packages (from watchdog==0.8.0->-r ./apps/frappe/requirements.txt (line 29))
Requirement already satisfied: html5lib>=0.99999999 in ./env/lib/python2.7/site-packages (from bleach->-r ./apps/frappe/requirements.txt (line 30))
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow->-r ./apps/frappe/requirements.txt (line 32))
Requirement already satisfied: idna>=2.1 in ./env/lib/python2.7/site-packages (from cryptography->-r ./apps/frappe/requirements.txt (line 36))
Requirement already satisfied: enum34 in ./env/lib/python2.7/site-packages (from cryptography->-r ./apps/frappe/requirements.txt (line 36))
Requirement already satisfied: ipaddress in ./env/lib/python2.7/site-packages (from cryptography->-r ./apps/frappe/requirements.txt (line 36))
Requirement already satisfied: packaging in ./env/lib/python2.7/site-packages (from cryptography->-r ./apps/frappe/requirements.txt (line 36))
Requirement already satisfied: cffi>=1.4.1 in ./env/lib/python2.7/site-packages (from cryptography->-r ./apps/frappe/requirements.txt (line 36))
Requirement already satisfied: asn1crypto>=0.21.0 in ./env/lib/python2.7/site-packages (from cryptography->-r ./apps/frappe/requirements.txt (line 36))
Requirement already satisfied: et-xmlfile in ./env/lib/python2.7/site-packages (from openpyxl->-r ./apps/frappe/requirements.txt (line 44))
Requirement already satisfied: jdcal in ./env/lib/python2.7/site-packages (from openpyxl->-r ./apps/frappe/requirements.txt (line 44))
Requirement already satisfied: appdirs>=1.4.0 in ./env/lib/python2.7/site-packages (from setuptools>=18.5->ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: wcwidth in ./env/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: ptyprocess>=0.5 in ./env/lib/python2.7/site-packages (from pexpect; sys_platform != "win32"->ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: ipython-genutils in ./env/lib/python2.7/site-packages (from traitlets>=4.2->ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: scandir; python_version < "3.5" in ./env/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython->-r ./apps/frappe/requirements.txt (line 24))
Requirement already satisfied: webencodings in ./env/lib/python2.7/site-packages (from html5lib>=0.99999999->bleach->-r ./apps/frappe/requirements.txt (line 30))
Requirement already satisfied: pyparsing in ./env/lib/python2.7/site-packages (from packaging->cryptography->-r ./apps/frappe/requirements.txt (line 36))
Requirement already satisfied: pycparser in ./env/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography->-r ./apps/frappe/requirements.txt (line 36))
Building wheels for collected packages: mysqlclient
  Running setup.py bdist_wheel for mysqlclient ... error
  Complete output from command /Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-build-52TzAb/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/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/tmp0uCzzGpip-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/converters.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/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/CR.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/ER.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
  copying MySQLdb/constants/CLIENT.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 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,3,8,'final',1) -D__version__=1.3.8 -I/usr/local/Cellar/mariadb/10.1.22/include/mysql -I/usr/local/Cellar/mariadb/10.1.22/include/mysql/.. -I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.12-x86_64-2.7/_mysql.o
  clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk build/temp.macosx-10.12-x86_64-2.7/_mysql.o -L/usr/local/Cellar/mariadb/10.1.22/lib -lmysqlclient -lz -lssl -lcrypto -o build/lib.macosx-10.12-x86_64-2.7/_mysql.so
  ld: library not found for -lssl
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  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, pdfkit
  Running setup.py install for mysqlclient ... error
    Complete output from command /Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-build-52TzAb/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/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-MQjiz2-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/../include/site/python2.7/mysqlclient:
    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/converters.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/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/CR.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/ER.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
    copying MySQLdb/constants/CLIENT.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 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,3,8,'final',1) -D__version__=1.3.8 -I/usr/local/Cellar/mariadb/10.1.22/include/mysql -I/usr/local/Cellar/mariadb/10.1.22/include/mysql/.. -I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.12-x86_64-2.7/_mysql.o
    clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk build/temp.macosx-10.12-x86_64-2.7/_mysql.o -L/usr/local/Cellar/mariadb/10.1.22/lib -lmysqlclient -lz -lssl -lcrypto -o build/lib.macosx-10.12-x86_64-2.7/_mysql.so
    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'clang' failed with exit status 1
    
    ----------------------------------------
Command "/Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-build-52TzAb/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/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-MQjiz2-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/../include/site/python2.7/mysqlclient" failed with error code 1 in /private/var/folders/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-build-52TzAb/mysqlclient/

I believe this is because you don’t have xcode or xcode tools installed. Once you have xcode, you can install xcode tools with

try following:
xcode-select --install
or
try to reinstall mysql

I am still stuck at this issue but I can’t proceed as after uninstalling mariadb, I cannot install it anymore. I am back to another issue which I posted here - Installation error on mac (manually) - #19 by darnpunk

Any help is greatly appreciated!

I uninstalled mariadb and use mysql instead. Running bench update seems ok now.

You can use the following commands if you want to use the mariadb instead.

brew unlink mariadb

brew install mariadb-connector-c
ln -s /usr/local/opt/mariadb-connector-c/bin/mariadb_config /usr/local/bin/mysql_config

pip install mysqlclient

rm /usr/local/bin/mysql_config
brew unlink mariadb-connector-c
brew link mariadb

I have tried that but it doesn’t work. In fact I tried to reinstall everything from scratch and I encountered another error:

bench init frappe-bench --frappe-branch master 
INFO:bench.utils:virtualenv -q env -p /usr/local/opt/python/bin/python2.7
Already using interpreter /usr/local/opt/python/bin/python2.7
INFO:bench.utils:./env/bin/pip -q install --upgrade pip
INFO:bench.utils:./env/bin/pip -q install wheel
INFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git --branch master  --origin upstream
Cloning into 'frappe'...
remote: Counting objects: 130552, done.
remote: Compressing objects: 100% (92/92), done.
remote: Total 130552 (delta 35), reused 28 (delta 8), pack-reused 130452
Receiving objects: 100% (130552/130552), 100.65 MiB | 4.38 MiB/s, done.
Resolving deltas: 100% (98494/98494), done.
Checking out files: 100% (2090/2090), done.
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir
Command "/Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-build-ActAem/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/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-KzL8_u-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/env/bin/../include/site/python2.7/mysqlclient" failed with error code 1 in /private/var/folders/p6/yyn74c_d3cb3yppcz1cv_85w0000gn/T/pip-build-ActAem/mysqlclient/
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/commands/make.py", line 19, in init
    verbose=verbose, clone_from=clone_from)
  File "/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/utils.py", line 56, in init
    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
  File "/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/app.py", line 76, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/app.py", line 107, in install_app
    find_links=find_links))
  File "/Users/arsyad/Documents/Arsyad/work/python/frappe/bench-repo/bench/utils.py", line 130, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir

Is this something to do with mysqlclient? Previously, I don’t remember having to install when using MariaDB. Reinstalling mysqlclient or MySQL-python doesn’t help. I also tried to use MariaDB back but no go.

Yes, most of the time this error comes because of the mysqlclient. You can run the following command to know exactly why the error is coming.
frappe-bench/env/bin/pip install -e frappe-bench/apps/frappe

I tried running that command but I don’t see any errors. Here’s the output:

frappe-bench/env/bin/pip install -e frappe-bench/apps/frappe
Obtaining file:///Users/arsyad/Documents/Arsyad/work/python/frappe/frappe-bench/apps/frappe
Requirement already satisfied: chardet in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Requirement already satisfied: cssmin in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Requirement already satisfied: dropbox==7.3.1 in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Requirement already satisfied: gunicorn in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Requirement already satisfied: httplib2 in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Requirement already satisfied: jinja2 in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Requirement already satisfied: markdown2 in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Requirement already satisfied: markupsafe in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Collecting mysqlclient==1.3.10 (from frappe==8.1.2)
Collecting python-geoip (from frappe==8.1.2)
  Using cached python_geoip-1.2-py27-none-any.whl
Collecting python-geoip-geolite2 (from frappe==8.1.2)
  Using cached python_geoip_geolite2-2015.0303-py2-none-any.whl
Collecting python-dateutil (from frappe==8.1.2)
  Using cached python_dateutil-2.6.0-py2.py3-none-any.whl
Collecting pytz (from frappe==8.1.2)
  Using cached pytz-2017.2-py2.py3-none-any.whl
Requirement already satisfied: six in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Collecting termcolor (from frappe==8.1.2)
Collecting werkzeug (from frappe==8.1.2)
  Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting semantic_version (from frappe==8.1.2)
Collecting rauth>=0.6.2 (from frappe==8.1.2)
  Using cached rauth-0.7.3-py2-none-any.whl
Requirement already satisfied: requests in ./frappe-bench/env/lib/python2.7/site-packages (from frappe==8.1.2)
Collecting redis (from frappe==8.1.2)
  Using cached redis-2.10.5-py2.py3-none-any.whl
Collecting selenium (from frappe==8.1.2)
  Using cached selenium-3.4.3-py2.py3-none-any.whl
Requirement already satisfied: pdfkit in ./frappe-bench/env/src/pdfkit (from frappe==8.1.2)
Collecting babel (from frappe==8.1.2)
  Using cached Babel-2.4.0-py2.py3-none-any.whl
Collecting ipython (from frappe==8.1.2)
  Using cached ipython-5.4.1-py2-none-any.whl
Collecting html2text (from frappe==8.1.2)
Collecting email_reply_parser (from frappe==8.1.2)
Collecting click (from frappe==8.1.2)
  Using cached click-6.7-py2.py3-none-any.whl
Collecting num2words (from frappe==8.1.2)
Collecting watchdog==0.8.0 (from frappe==8.1.2)
Collecting bleach (from frappe==8.1.2)
  Using cached bleach-2.0.0-py2.py3-none-any.whl
Collecting bleach-whitelist (from frappe==8.1.2)
Collecting Pillow (from frappe==8.1.2)
  Using cached Pillow-4.1.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting beautifulsoup4 (from frappe==8.1.2)
  Using cached beautifulsoup4-4.6.0-py2-none-any.whl
Collecting rq (from frappe==8.1.2)
  Using cached rq-0.8.0-py2.py3-none-any.whl
Collecting schedule (from frappe==8.1.2)
  Using cached schedule-0.4.3-py2.py3-none-any.whl
Collecting cryptography (from frappe==8.1.2)
  Using cached cryptography-1.9-cp27-cp27m-macosx_10_6_intel.whl
Collecting zxcvbn (from frappe==8.1.2)
Collecting psutil (from frappe==8.1.2)
Collecting unittest-xml-reporting (from frappe==8.1.2)
  Using cached unittest_xml_reporting-2.1.0-py2.py3-none-any.whl
Collecting xlwt (from frappe==8.1.2)
  Using cached xlwt-1.2.0-py2.py3-none-any.whl
Collecting oauthlib (from frappe==8.1.2)
Collecting PyJWT (from frappe==8.1.2)
  Using cached PyJWT-1.5.2-py2.py3-none-any.whl
Collecting pypdf (from frappe==8.1.2)
Collecting openpyxl (from frappe==8.1.2)
Requirement already satisfied: urllib3 in ./frappe-bench/env/lib/python2.7/site-packages (from dropbox==7.3.1->frappe==8.1.2)
Requirement already satisfied: certifi>=2017.4.17 in ./frappe-bench/env/lib/python2.7/site-packages (from requests->frappe==8.1.2)
Requirement already satisfied: idna<2.6,>=2.5 in ./frappe-bench/env/lib/python2.7/site-packages (from requests->frappe==8.1.2)
Requirement already satisfied: setuptools>=18.5 in ./frappe-bench/env/lib/python2.7/site-packages (from ipython->frappe==8.1.2)
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from ipython->frappe==8.1.2)
  Using cached backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Collecting pickleshare (from ipython->frappe==8.1.2)
  Using cached pickleshare-0.7.4-py2.py3-none-any.whl
Collecting simplegeneric>0.8 (from ipython->frappe==8.1.2)
Collecting prompt-toolkit<2.0.0,>=1.0.4 (from ipython->frappe==8.1.2)
  Using cached prompt_toolkit-1.0.14-py2-none-any.whl
Collecting decorator (from ipython->frappe==8.1.2)
  Using cached decorator-4.0.11-py2.py3-none-any.whl
Collecting pexpect; sys_platform != "win32" (from ipython->frappe==8.1.2)
  Using cached pexpect-4.2.1-py2.py3-none-any.whl
Collecting pygments (from ipython->frappe==8.1.2)
  Using cached Pygments-2.2.0-py2.py3-none-any.whl
Collecting traitlets>=4.2 (from ipython->frappe==8.1.2)
  Using cached traitlets-4.3.2-py2.py3-none-any.whl
Collecting appnope; sys_platform == "darwin" (from ipython->frappe==8.1.2)
  Using cached appnope-0.1.0-py2.py3-none-any.whl
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython->frappe==8.1.2)
  Using cached pathlib2-2.3.0-py2.py3-none-any.whl
Collecting PyYAML>=3.10 (from watchdog==0.8.0->frappe==8.1.2)
Collecting pathtools>=0.1.1 (from watchdog==0.8.0->frappe==8.1.2)
Collecting argh>=0.24.1 (from watchdog==0.8.0->frappe==8.1.2)
  Using cached argh-0.26.2-py2.py3-none-any.whl
Collecting html5lib>=0.99999999 (from bleach->frappe==8.1.2)
  Using cached html5lib-0.999999999-py2.py3-none-any.whl
Collecting olefile (from Pillow->frappe==8.1.2)
Collecting enum34 (from cryptography->frappe==8.1.2)
  Using cached enum34-1.1.6-py2-none-any.whl
Collecting ipaddress (from cryptography->frappe==8.1.2)
  Using cached ipaddress-1.0.18-py2-none-any.whl
Collecting cffi>=1.7 (from cryptography->frappe==8.1.2)
  Using cached cffi-1.10.0-cp27-cp27m-macosx_10_6_intel.whl
Collecting asn1crypto>=0.21.0 (from cryptography->frappe==8.1.2)
  Using cached asn1crypto-0.22.0-py2.py3-none-any.whl
Collecting et-xmlfile (from openpyxl->frappe==8.1.2)
Collecting jdcal (from openpyxl->frappe==8.1.2)
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.4->ipython->frappe==8.1.2)
  Using cached wcwidth-0.1.7-py2.py3-none-any.whl
Collecting ptyprocess>=0.5 (from pexpect; sys_platform != "win32"->ipython->frappe==8.1.2)
  Using cached ptyprocess-0.5.2-py2.py3-none-any.whl
Collecting ipython-genutils (from traitlets>=4.2->ipython->frappe==8.1.2)
  Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting scandir; python_version < "3.5" (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython->frappe==8.1.2)
Collecting webencodings (from html5lib>=0.99999999->bleach->frappe==8.1.2)
  Using cached webencodings-0.5.1-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.7->cryptography->frappe==8.1.2)
Installing collected packages: mysqlclient, python-geoip, python-geoip-geolite2, python-dateutil, pytz, termcolor, werkzeug, semantic-version, rauth, redis, selenium, babel, backports.shutil-get-terminal-size, scandir, pathlib2, pickleshare, simplegeneric, wcwidth, prompt-toolkit, decorator, ptyprocess, pexpect, pygments, ipython-genutils, enum34, traitlets, appnope, ipython, html2text, email-reply-parser, click, num2words, PyYAML, pathtools, argh, watchdog, webencodings, html5lib, bleach, bleach-whitelist, olefile, Pillow, beautifulsoup4, rq, schedule, ipaddress, pycparser, cffi, asn1crypto, cryptography, zxcvbn, psutil, unittest-xml-reporting, xlwt, oauthlib, PyJWT, pypdf, et-xmlfile, jdcal, openpyxl, frappe
  Running setup.py develop for frappe
Successfully installed Pillow-4.1.1 PyJWT-1.5.2 PyYAML-3.12 appnope-0.1.0 argh-0.26.2 asn1crypto-0.22.0 babel-2.4.0 backports.shutil-get-terminal-size-1.0.0 beautifulsoup4-4.6.0 bleach-2.0.0 bleach-whitelist-0.0.8 cffi-1.10.0 click-6.7 cryptography-1.9 decorator-4.0.11 email-reply-parser-0.5.9 enum34-1.1.6 et-xmlfile-1.0.1 frappe html2text-2016.9.19 html5lib-0.999999999 ipaddress-1.0.18 ipython-5.4.1 ipython-genutils-0.2.0 jdcal-1.3 mysqlclient-1.3.10 num2words-0.5.4 oauthlib-2.0.2 olefile-0.44 openpyxl-2.4.8 pathlib2-2.3.0 pathtools-0.1.2 pexpect-4.2.1 pickleshare-0.7.4 prompt-toolkit-1.0.14 psutil-5.2.2 ptyprocess-0.5.2 pycparser-2.17 pygments-2.2.0 pypdf-1.13 python-dateutil-2.6.0 python-geoip-1.2 python-geoip-geolite2-2015.303 pytz-2017.2 rauth-0.7.3 redis-2.10.5 rq-0.8.0 scandir-1.5 schedule-0.4.3 selenium-3.4.3 semantic-version-2.6.0 simplegeneric-0.8.1 termcolor-1.1.0 traitlets-4.3.2 unittest-xml-reporting-2.1.0 watchdog-0.8.0 wcwidth-0.1.7 webencodings-0.5.1 werkzeug-0.12.2 xlwt-1.2.0 zxcvbn-1.0

Then your bench should work properly. One possibility is that as we removed the argument --no-cache-dir so some dependencies got satisfied from the cache which is causing some problem earlier. Either your bench is installed properly or there will be error if you use the following command
frappe-bench/env/bin/pip install -e frappe-bench/apps/frappe --no-cache-dir

I think that is my problem, upon installing bench i get this warning:

The directory ‘/Users/joshreeder/Library/Caches/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
The directory ‘/Users/joshreeder/Library/Caches/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.

After this I get the same errors as @darnpunk above at the next to install. What is wrong that is causing the cache permissions error?

Does this path actually exist or need to to not get this error?

Actually, we have just removed mysql-python and started using mysqlclient in place of that. Could you please update the frappe repo and try once again.

Ok I found a workaround for at least myself and anyone else on mac running into this problem currently.

If when you run this command:

bench init frappe-bench --frappe-branch master

and it fails, then there maybe a issue with pip and --no-cache-dir.

To fix this we will change the source of bench-repo/bench/app.py line 98 define install_app > make no_cache=True.

Save then rerun this command first:

sudo pip install -e bench-repo

And then…

bench init frappe-bench --frappe-branch master

This should get you all the way to the Maria DB issue…

If mariadb gives errors related to library not found then run these commands:

brew unlink mariadb brew install mariadb-connector-c ln -s /usr/local/opt/mariadb-connector-c/bin/mariadb_config /usr/local/bin/mysql_config pip install mysqlclient rm /usr/local/bin/mysql_config brew unlink mariadb-connector-c brew link mariadb

Later if you get past setup and there are issues with the wizard. We made a file named ‘sample’ and put it into the frappe-bench/sites folder with the following code:

args = { "language":"English (United States)", "country":"India", "timezone":"Asia/Kolkata", "currency":"INR", "full_name":"Revant", "email":"r@r.com", "password":"r", "domain":"Services", "company_name":"R", "company_abbr":"R", "company_tagline":"R", "bank_account":"R", "fy_start_date":"2017-04-01", "fy_end_date":"2018-03-31", "user_sales_1":1, "user_purchaser_1":1, "user_accountant_1":1, "user_sales_2":1, "user_purchaser_2":1, "user_accountant_2":1, "user_sales_3":1, "user_purchaser_3":1, "user_accountant_3":1, "user_sales_4":1, "user_purchaser_4":1, "user_accountant_4":1, "customer_1":"A1", # "supplier_1":"S1", "item_1":"I1", "item_group_1":"Products", "item_uom_1":"Unit", "is_sales_item_1":1, "is_purchase_item_1":0, "item_group_2":"Products", "item_uom_2":"Unit", "is_sales_item_2":0, "is_purchase_item_2":0, "item_group_3":"Products", "item_uom_3":"Unit", "is_sales_item_3":0, "is_purchase_item_3":0, "item_group_4":"Products", "item_uom_4":"Unit", "is_sales_item_4":0, "is_purchase_item_4":0, "item_group_5":"Products", "item_uom_5":"Unit", "is_sales_item_5":0, "is_purchase_item_5":0, "add_sample_data":0, "setup_website":0 } from frappe.desk.page.setup_wizard.setup_wizard import setup_complete setup_complete(args)

and then we opened a new terminal window while bench is still running and executed:

bench console

execfile('sample')

This will change the values in the malfunctioned setup wizard and allow you run erpnext.

I have not installed mysql-python so doubt that is a problem for me.