Frappe-bench installation error in Ubuntu 16.04

I followed below steps:
/ErpNext$ git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo
/ErpNext/bench-repo$ sudo python setup.py install
/ErpNext$ bench init frappe-bench

INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
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 --origin upstream
Cloning into ‘frappe’…
remote: Counting objects: 125078, done.
remote: Compressing objects: 100% (164/164), done.
remote: Total 125078 (delta 68), reused 0 (delta 0), pack-reused 124914
Receiving objects: 100% (125078/125078), 95.41 MiB | 311.00 KiB/s, done.
Resolving deltas: 100% (93885/93885), done.
Checking connectivity… done.
installing 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 /tmp/pip-build-04a8wc/mysql-python/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==4.1.0’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python2.7/dist-packages/bench-4.1.0-py2.7.egg/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/bench-4.1.0-py2.7.egg/bench/commands/make.py”, line 19, in init
verbose=verbose, clone_from=clone_from)
File “/usr/local/lib/python2.7/dist-packages/bench-4.1.0-py2.7.egg/bench/utils.py”, line 56, in init
get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
File “/usr/local/lib/python2.7/dist-packages/bench-4.1.0-py2.7.egg/bench/app.py”, line 76, in get_app
install_app(app=app_name, bench_path=bench_path, verbose=verbose)
File “/usr/local/lib/python2.7/dist-packages/bench-4.1.0-py2.7.egg/bench/app.py”, line 107, in install_app
find_links=find_links))
File “/usr/local/lib/python2.7/dist-packages/bench-4.1.0-py2.7.egg/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

And i also tried GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps steps but same issue i am not able to install.
can any know solution how to fix it ?

@yogendrasinh

Try and follow these steps, they have worked for the majority of people.

1. sudo apt-get update 2. sudo apt-get upgrade 3. sudo adduser frappe 4. sudo usermod -aG sudo frappe 5. sudo nano /etc/resolv.conf 6. sudo apt-get install python-minimal && python -V # was 2.7.12+ 7. wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py 8. sudo python install.py --production

@saidsl

Tried all steps but last steps gives error.
sudo python install.py --production

Ign:17 Index of /chris-lea/node.js/ubuntu xenial/main DEP-11 64x64 Icons
Fetched 306 kB in 14s (20.8 kB/s)
Reading package lists… Done
W: The repository ‘Index of /chris-lea/node.js/ubuntu xenial Release’ does not have a Release file.
N: Data from such a repository can’t be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Traceback (most recent call last):
File “install.py”, line 351, in
install_bench(args)
File “install.py”, line 21, in install_bench
‘sudo yum install -y epel-release redhat-lsb-core git python-setuptools python-devel openssl-devel libffi-devel’
File “install.py”, line 219, in run_os_command
returncode = subprocess.check_call(command, shell=True)
File “/usr/lib/python2.7/subprocess.py”, line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘sudo apt-get update’ returned non-zero exit status 100

Then after i update using this command sudo apt-get update
and tried to install libraries using

sudo yum install -y epel-release redhat-lsb-core git python-setuptools python-devel openssl-devel libffi-devel

ErpNext$ sudo yum install -y epel-release redhat-lsb-core git python-setuptools python-devel openssl-devel libffi-devel

There are no enabled repos.
Run “yum repolist all” to see the repos you have.
You can enable repos with yum-config-manager --enable

ErpNext$ yum repolist all
repolist: 0

but i am not able to install it.

A few things

  1. Best to start your install with a clean Ubuntu Image, generally there are no issue going that route.
  2. Not sure why you’re using yum for ubuntu when apt-get work better even though you can use yum.
  3. You need to add the repos if you are going to use yum
  4. By using/starting with a clean Ubuntu install you don’t need to install the redhat libraries, I think its just complicating matters.

A few questions

  1. Where are you installing this? On a VM? Local Machine? or Cloud Instances?
  2. If its VM or Cloud, much easier to start from scratch and go through the steps in the previous post…

thanks to replaying for me.
i am installing this into my local machine.
now i am try to install with clean Ubuntu 16.04.

Thanks for replaying me :slight_smile:

followed suggested steps in clean Ubuntu 16.04
i still getting the error :confused:
then i followed below mentioned steps to installation

$ git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo
$ sudo pip install -e bench-repo
$ bench init frappe-bench
$ cd frappe-bench/
frappe-bench$ bench new-app meeting

frappe-bench$ bench new-site meeting.dev

MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 26, in new_site
verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 57, in _new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/installer.py”, line 35, in install_db
create_database_and_user(force, verbose)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/installer.py”, line 54, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 543, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/database.py”, line 107, in sql
self.connect()
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/database.py”, line 53, in connect
use_unicode=True, charset=‘utf8mb4’)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, “Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”)

can anybody help me about this ?

@yogendrasinh Looks like you opted for a manual install and that can be tricky with regards to the dependencies that need to be installed and how they install. Basically, the error you are getting indicates that Python is not connecting to MariaDB MySQL or can’t find it. Common issue with manually installing dependencies.

Did you try the easy install options as follows:

sudo apt-get update
sudo apt-get upgrade
sudo adduser frappe
sudo usermod -aG sudo frappe
sudo nano /etc/resolv.conf (change DNS to 8.8.8.8 and 8.8.4.4)
sudo apt-get install python-minimal && python -V # was 2.7.12+
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --production or --develop 

This is done also on a clean Ubuntu install. You should not have any issues.

hi,
@yogendrasinh
check the mysql error log
or restart the mysql and try it.

Thanks.

Thanks for replaying for me :slight_smile:
finally i created new app name “test_y1” and new site name “test_y1.dev” using below commands.
but i still getting error when i install it into site new site name “test_y1.dev” :confused:

$ bench new-app test_y1
$ bench new-site test_y1.dev
$ bench --site test_y1.dev install-app test_y1
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 153, in install_app
_install_app(app, verbose=context.verbose)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/installer.py”, line 103, in install_app
frappe.clear_cache()
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/init.py”, line 484, in clear_cache
for fn in get_hooks(“clear_cache”):
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/init.py”, line 800, in get_hooks
hooks = _dict(cache().get_value(“app_hooks”, load_app_hooks))
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 70, in get_value
val = generator()
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/init.py”, line 778, in load_app_hooks
for app in [app_name] if app_name else get_installed_apps(sort=True):
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/init.py”, line 742, in get_installed_apps
installed = json.loads(db.get_global(“installed_apps”) or “[]”)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/database.py”, line 692, in get_global
return self.get_default(key, user)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/database.py”, line 704, in get_default
d = self.get_defaults(key, parent)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/database.py”, line 710, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/defaults.py”, line 72, in get_defaults
globald = get_defaults_for()
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/defaults.py”, line 180, in get_defaults_for
where parent = %s order by creation"“”, (parent,), as_dict=1)
File “/home/frappe/ErpNext/frappe-bench/apps/frappe/frappe/database.py”, line 138, in sql
self._cursor.execute(query, values)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/ErpNext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, “Table ‘bc0536b7e1cc2013.tabDefaultValue’ doesn’t exist”)

can you please suggest me what can i do to fix this issue ?

thanks to replaying for me :slight_smile:
I followed Below steps and finally successfully setup frappe and erpnext in my local machine. :smile:

$ mkdir ErpNext
$ cd ErpNext
$ mkdir ErpNext
$ cd ErpNext
:~/ErpNext$ git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo
:~/ErpNext:$ cd bench-repo
:~/ErpNext/bench-repo$ sudo python setup.py install
OR sudo pip install -e bench-repo
:~/ErpNext/bench-repo$ cd …
:~/ErpNext$bench init frappe-bench --frappe-branch master && cd frappe-bench
:~/ErpNext/frappe-bench$bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) --branch master
:~/ErpNext/frappe-bench$bench new-site erpnext.dev
:~/ErpNext/frappe-bench$bench --site erpnext.dev install-app erpnext
:~/ErpNext/frappe-bench$bench start
GO on browser and open url:
http://0.0.0.01 : 8000 Or
http://your system ip : 8000

Thank to everyone who replayed me.