MacOs Error setting up developer machine

Hi guys!
I’m new with all the world of ERPNext. I’m coming from the “java world” , but im pretty excited with the “python world” and ERPNext.
OK, my goal now is to setting up a developer enviroment in my mac. Then, I want to deploy ERPNext in a virtual machine Debian with ISPConfig and virtual host installed (Apache, mysql, etc). I understand that ERPNext works better in a clean system and with nginx and mariadb, but I can’t change my infrastructure by now. But, deployment it’s for another post. Let’s go with my problem now.

I follow this link to setting up my mac for develop: Turning a Mac into a Frappe Framework Developer Machine · frappe/bench Wiki · GitHub .
Everything comes ok, but when I’m trying to run
bench init frappe-bench --frappe-branch master
I get this error :

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: 125324, done. remote: Compressing objects: 100% (30/30), done. remote: Total 125324 (delta 6), reused 0 (delta 0), pack-reused 125294 Receiving objects: 100% (125324/125324), 95.38 MiB | 10.46 MiB/s, done. Resolving deltas: 100% (94123/94123), 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 "python setup.py egg_info" failed with error code 1 in /private/var/folders/xf/6lhhj3h56379gmxwqp0_p2qr0000gn/T/pip-build-JiAODU/mysql-python/ Traceback (most recent call last): File "/usr/local/bin/bench", line 11, in <module> load_entry_point('bench', 'console_scripts', 'bench')() File "/Users/anibal/PythonDev/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/anibal/PythonDev/bench-repo/bench/commands/make.py", line 19, in init verbose=verbose, clone_from=clone_from) File "/Users/anibal/PythonDev/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/anibal/PythonDev/bench-repo/bench/app.py", line 76, in get_app install_app(app=app_name, bench_path=bench_path, verbose=verbose) File "/Users/anibal/PythonDev/bench-repo/bench/app.py", line 107, in install_app find_links=find_links)) File "/Users/anibal/PythonDev/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

I searched about the same problems, like

And I do the same that the post said… But I get the same error at the end …

`➜ frappe-bench rm -rf env
➜ frappe-bench ls
apps config logs sites
➜ frappe-bench bench setup env
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
➜ frappe-bench ./env/bin/pip install -e apps/frappe
Obtaining file:///Users/anibal/PythonDev/frappe-bench/apps/frappe
Collecting chardet (from frappe==8.0.18)
Downloading chardet-3.0.2-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 2.6MB/s
Collecting cssmin (from frappe==8.0.18)
Downloading cssmin-0.2.0.tar.gz
Collecting dropbox (from frappe==8.0.18)
Downloading dropbox-7.2.1-py2-none-any.whl (302kB)
100% |████████████████████████████████| 307kB 3.1MB/s
Collecting gunicorn (from frappe==8.0.18)
Downloading gunicorn-19.7.1-py2.py3-none-any.whl (111kB)
100% |████████████████████████████████| 112kB 7.4MB/s
Collecting httplib2 (from frappe==8.0.18)
Downloading httplib2-0.10.3.tar.gz (204kB)
100% |████████████████████████████████| 204kB 4.0MB/s
Collecting jinja2 (from frappe==8.0.18)
Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB)
100% |████████████████████████████████| 348kB 4.0MB/s
Collecting markdown2 (from frappe==8.0.18)
Downloading markdown2-2.3.3.zip (156kB)
100% |████████████████████████████████| 163kB 5.7MB/s
Collecting markupsafe (from frappe==8.0.18)
Downloading MarkupSafe-1.0.tar.gz
Collecting mysql-python==1.2.5 (from frappe==8.0.18)
Downloading MySQL-python-1.2.5.zip (108kB)
100% |████████████████████████████████| 112kB 5.7MB/s
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File “”, line 1, in
File “/private/var/folders/xf/6lhhj3h56379gmxwqp0_p2qr0000gn/T/pip-build-kRX45B/mysql-python/setup.py”, line 17, in
metadata, options = get_config()
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

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /private/var/folders/xf/6lhhj3h56379gmxwqp0_p2qr0000gn/T/pip-build-kRX45B/mysql-python/
➜ frappe-bench`

What can I do?
Off course sorry if I made a obviously question. :frowning: :slight_smile:

Best

have you tried easy install?

Nop … Because everything I read it says is better the link that I used…
Anyway, I saw that the easy install don’t contain much differences with the other link

I think maybe my problem is that I’m trying to use mysql … I have installed MySQL 5.7 in my Mac and I want to use this one … Maybe there’re a change I can do’it in setup files to use MySQL?

I think it would really be best if you install in clean os. Try dual boot

Maybe is the best, but not possible :slight_smile: . Probably I do it using a Debian or Mint in a VirtualMachine, but I really want to integrate all in my mac.
There’s no way to fix this issuee? Or maybe tell me something that I can search for fix this …

Best

@anibal.duardo

You’re facing the same issue I encountered while trying to install on Debian Stretch, which is Python not connecting to MySQL and to resolve it I installed the following first.

brew install libmysqlclient-dev and/or brew install libmariadbclient-dev / brew install python-mysqldb (This resolves the issue of Python not connecting to MariaDB MySQL)
brew install libssl-dev
pip install --upgrade setuptools
pip install MySQL-python --no-use-wheel (Wheel does not have a MySQL-python module yet, so it will error if the -no-use-wheel is not flagged) 

Once you complete the installs reboot your Mac.

By the way, I used hombrew to manage my installs and that just made everything much easier. I also used the same script you used and was able to install successfully on macos Sierra.

One other point I would strongly suggest is to use MariaDB as recommended and not MySQL. This makes a big difference.

Hope this helps

@saidsl First at all, Thank you from your response.

OK. I’m a good listener, so I uninstalled MySQL 5.7, clean it up everything, and install MariaDB (brew install mariadb) . And then I run the command mysql_secure_installation . After that I check the connection to mariadb via MySQLWorkbench and everything appears ok.

libmysqlclient-dev , libmariadbclient-dev , libssl-dev , python-mysqldb didn’t exist in my homebrew, what I’m doing wrong? As I saw, that libraries name belong to apt from debian, maybe they appear with other name in brew.

I already do the install of ‘Caskroom/cask/mysql-connector-python’ and runs ok.

Then I do the ‘pip install --upgrade setuptools’ and after this I do the ‘pip install MySQL-python --no-use-wheel’
Off course, as you says, I restarted my mac.
Then I do the bench init frappe-bench --frappe-branch master again … But first I deleted the folder frappe-bench.
Ok, after run this command I get the message …

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 GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --branch master --origin upstream
Cloning into ‘frappe’…
remote: Counting objects: 125397, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 125397 (delta 6), reused 0 (delta 0), pack-reused 125367
Receiving objects: 100% (125397/125397), 95.39 MiB | 10.40 MiB/s, done.
Resolving deltas: 100% (94182/94182), 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/anibal/PythonDev/frappe-bench/env/bin/python2.7 -u -c “import setuptools, tokenize;file=‘/private/var/folders/xf/6lhhj3h56379gmxwqp0_p2qr0000gn/T/pip-build-8hGrQL/mysql-python/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/xf/6lhhj3h56379gmxwqp0_p2qr0000gn/T/pip-ecdRc5-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/anibal/PythonDev/frappe-bench/env/bin/…/include/site/python2.7/mysql-python” failed with error code 1 in /private/var/folders/xf/6lhhj3h56379gmxwqp0_p2qr0000gn/T/pip-build-8hGrQL/mysql-python/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/Users/anibal/PythonDev/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/anibal/PythonDev/bench-repo/bench/commands/make.py”, line 19, in init
verbose=verbose, clone_from=clone_from)
File “/Users/anibal/PythonDev/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/anibal/PythonDev/bench-repo/bench/app.py”, line 76, in get_app
install_app(app=app_name, bench_path=bench_path, verbose=verbose)
File “/Users/anibal/PythonDev/bench-repo/bench/app.py”, line 107, in install_app
find_links=find_links))
File “/Users/anibal/PythonDev/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

Any advice?

Thanks again.

Welcome @anibal.duardo

A few things to check

  1. Test if you can do bench mysql in frappe-bench if you don’t connect to the mysql means python & mysql are not connecting
  2. To install MySQL-python on the Mac you need to do this:
    brew install mysql-connector-c Then install with pip install mysql-python
  3. Not sure if you have installed it but you will need supervisor as well and best you install before beginning Frappe/ERPNext Install you can use sudo pip install supervisor
  4. Restart the Mac
  5. Commence install again

@saidsl
I do everything you said … and more :joy: … uninstall mariadb mysqlpython (from pip and brew) and then started again … but at the end , the error is the same …

I don’t know what more can I do … I’m trying searching more on the forums and the web … but nothing works … Obviously, or I made a mistake or some libraries are not linked(?) good or anything like that …
I want to try a little more … Otherwise, I’ll make a fresh installing of my mac :rage:

I hope you or someone else have any idea! I can’t really imagining that the only way to start developing ERPNext is doing a fresh & clean install of the system … (besides off course of using de vbox for dev) …

Best

@anibal.duardo

Considering that I have ERPNext working on macOS Sierra, following is the list of of installed Python package, compare with your list by doing pip list

And the I have the installation @ /Users/user/Sites/erpnext/bench-repo

ansible (2.0.2.0)
bench (4.1.0,)
cffi (1.9.1)
chardet (2.3.0)
click (6.6)
cryptography (1.7.1)
cssmin (0.2.0)
Cython (0.25.2)
dropbox (7.1.1)
enum34 (1.1.6)
gitdb (0.6.4)
GitPython (0.3.2rc1)
gunicorn (19.6.0)
honcho (0.7.1)
httplib2 (0.9.2)
idna (2.2)
ipaddress (1.0.17)
Jinja2 (2.8)
jnius (1.1.dev0)
markdown2 (2.3.2)
MarkupSafe (0.23)
meld3 (1.0.2)
MySQL-python (1.2.5)
paramiko (2.1.1)
pip (9.0.1)
psutil (5.0.1)
pyasn1 (0.1.9)
pycparser (2.17)
pycrypto (2.6.1)
python-crontab (2.1.1)
python-dateutil (2.6.0)
python-geoip (1.2)
python-geoip-geolite2 (2015.303)
pytz (2016.10)
PyYAML (3.12)
rauth (0.7.2)
redis (2.10.5)
requests (2.12.4)
selenium (3.0.2)
semantic-version (2.6.0)
setuptools (32.2.0)
six (1.10.0)
smmap (0.9.0)
supervisor (3.3.1)
termcolor (1.1.0)
typing (3.5.3.0)
urllib3 (1.19.1)
virtualenv (15.1.0)
Werkzeug (0.11.15)
wheel (0.29.0) 

And this is the Homebrew installations/packages

boost 1.62.0
dnsmasq 2.76
gdbm 1.12
git 2.11.0
goaccess 1.1.1
highlight 3.33
lua 5.2.4_4
mariadb 10.1.20
mongodb 3.4.2
mycli 1.8.1
node 7.3.0
openssl 1.0.2j 1.0.2k
python 2.7.13
readline 7.0.1
redis 3.2.6
sqlite 3.15.2

Homebrew’s config:

HOMEBREW_VERSION: 1.1.11
ORIGIN: https://github.com/Homebrew/brew
HEAD: 394f9fa0aaa5854aa52bc589708a079665dcf462
Last commit: 7 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: f91407ec4df5f9193bdf404cbfc38cd11133d41e
Core tap last commit: 4 weeks ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: dual-core 64-bit penryn
Homebrew Ruby: 2.0.0-p648
Clang: 8.1 build 802
Git: 2.11.0 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_111, 1.6.0_65-b14-468
macOS: 10.12.4-x86_64
Xcode: N/A
CLT: 8.3.0.0.1.1490382677
X11: N/A

Nothing work!!!
At the end the winner is… fresh install of my mac os :rage:
OK. Now I got installed Frappe & ERPNext in my mac for developing …

Thank you for your kindness help!
Any advice about how I can continue meeting ERPNext & starting some modifications?

I really want to deploy on Apache & MySQL in a ISPConfig System with multiple domains, but I think is a long walk and a lot of work, don’t you think?

Best

@anibal.duardo

You’re welcome

Actually, not really. It really depends how you want to work/develop/use ERPNext

  1. If you only want to develop than yes, using a Mac makes sense.
  2. If you wish to go into a production environment, I would suggest getting a cloud server (They are cheap theses days) and setting up an Ubuntu or whichever nix flavour you prefer.
  3. Setting up multiple domains on one installation is not an issue either.

However, if I understand you correctly by ISPConfig System does that mean shared server? I don’t think that would be the right environment/setup for ERPNext.

Regards

@saidsl
oh oh. Ok I think I understand.
Yes, that ISPConfig (Debian on a VPS Server) have a multiple domains . I mantain several VPS servers , all with Debian … So there’s no problem to have a VPS dedicated for an ERPNext installation, but if I can avoid that , because the issues to admin several servers, I think is better … Don’t you think?

Maybe , as you say , the right way is have it a VPS for multiple domain or ERPNext’s … My idea is migrate another ERP that multiple customers use today …

Best

Yes, I agree, maintaining several servers is a bit of a pain, but I think the advantages of far out weighs the disadvantages.

Yes, that would be the better option to take and as I mentioned before, long term wise you would be better off.

And since you can do multi tenant on one installation of Frappe/ERPNext and provided you have a well configured server, you should be able to manage just the one ERPNext Installation.

There are many ways to configure the servers as aware, you just need to establish what your long usage is going to be like and architect accordingly.

Regards