2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-09 16:36:25 +00:00
CLI to manage Multi-tenant deployments for Frappe apps
Go to file
Javier Wong b9b38d4c35 Installation fails for PDFKit - no module named six
Get the following error when installing:

`./env/bin/pip install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
Obtaining pdfkit from git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
  Updating ./env/src/pdfkit clone
Installing collected packages: pdfkit
  Running setup.py develop for pdfkit
    Complete output from command /home/strella/frappe-bench/env/bin/python -c "import setuptools, tokenize;__file__='/home/strella/frappe-bench/env/src/pdfkit/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/strella/frappe-bench/env/src/pdfkit/setup.py", line 51, in <module>
        'Topic :: Utilities'
      File "/usr/lib/python2.7/distutils/core.py", line 137, in setup
        ok = dist.parse_command_line()
      File "/home/strella/frappe-bench/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 363, in parse_command_line
        result = _Distribution.parse_command_line(self)
      File "/usr/lib/python2.7/distutils/dist.py", line 467, in parse_command_line
        args = self._parse_command_opts(parser, args)
      File "/home/strella/frappe-bench/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 674, in _parse_command_opts
        nargs = _Distribution._parse_command_opts(self, parser, args)
      File "/usr/lib/python2.7/distutils/dist.py", line 523, in _parse_command_opts
        cmd_class = self.get_command_class(command)
      File "/home/strella/frappe-bench/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 495, in get_command_class
        self.cmdclass[command] = cmdclass = ep.load()
      File "/home/strella/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2303, in load
        return self.resolve()
      File "/home/strella/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2309, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/home/strella/frappe-bench/env/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 11, in <module>
        from setuptools.command.easy_install import easy_install
      File "/home/strella/frappe-bench/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in <module>
        from setuptools.py27compat import rmtree_safe
      File "/home/strella/frappe-bench/env/local/lib/python2.7/site-packages/setuptools/py27compat.py", line 7, in <module>
        import six
    ImportError: No module named six`
2017-06-16 08:46:56 +08:00
bench Installation fails for PDFKit - no module named six 2017-06-16 08:46:56 +08:00
install_scripts Update setup_frappe.sh 2016-06-25 00:12:28 +08:00
playbooks [hotfix] get wkhtmltopdf from frappe/wkhtmltopdf repo, setup npm dependencies in bench init (#428) 2017-06-09 15:28:04 +05:30
vm [hotfix] get wkhtmltopdf from frappe/wkhtmltopdf repo, setup npm dependencies in bench init (#428) 2017-06-09 15:28:04 +05:30
.gitignore add git ignore 2014-07-15 11:18:26 +05:30
.travis.yml [fix] installer and travis 2016-06-28 13:22:58 +05:30
completion.sh rename completion script 2015-04-03 18:20:05 +05:30
LICENSE.md Create LICENSE.md 2014-07-09 15:55:27 +05:30
MANIFEST.in Fix setup.py 2015-12-22 11:59:41 -08:00
README.md Develop (#400) 2017-05-19 16:25:51 +05:30
requirements.txt [Minor] Add rate limiting for bench 2016-07-28 17:55:08 +05:30
setup.py [fix] release script 2016-06-09 15:39:54 +05:30

Bench

Build Status

The bench is a command-line utility that helps you to install apps, manage multiple sites and update Frappe / ERPNext apps on */nix (CentOS 6, Debian 7, Ubuntu, etc) for development and production. Bench will also create nginx and supervisor config files, setup backups and much more.

If you are using on a VPS make sure it has >= 1Gb of RAM or has swap setup properly.

To do this install, you must have basic information on how Linux works and should be able to use the command-line. If you are looking easier ways to get started and evaluate ERPNext, download the Virtual Machine or take a free trial on erpnext.com.

If you have questions, please ask them on the forum.

Installation

Manual Install

To manually install frappe/erpnext here are the steps

1. Install Pre-requisites

  • Python 2.7
  • MariaDB 10+
  • Nginx (for production)
  • Nodejs
  • Redis
  • cron (crontab is required)
  • wkhtmltopdf with patched Qt (for pdf generation)

2. Install Bench

Install bench as a non root user,

git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo

Note: Please do not remove the bench directory the above commands will create

Basic Usage

  • Create a new bench

    The init command will create a bench directory with frappe framework installed. It will be setup for periodic backups and auto updates once a day.

      bench init frappe-bench && cd frappe-bench
    
  • Add a site

    Frappe apps are run by frappe sites and you will have to create at least one site. The new-site command allows you to do that.

      bench new-site site1.local
    
  • Add apps

    The get-app command gets remote frappe apps from a remote git repository and installs them. Example: erpnext

      bench get-app erpnext https://github.com/frappe/erpnext
    
  • Install apps

    To install an app on your new site, use the bench install-app command.

      bench --site site1.local install-app erpnext
    
  • Start bench

    To start using the bench, use the bench start command

      bench start
    

    To login to Frappe / ERPNext, open your browser and go to [your-external-ip]:8000, probably localhost:8000

    The default username is "Administrator" and password is what you set when you created the new site.


Easy Install

  • This is an opinionated setup so it is best to setup on a blank server.
  • Works on Ubuntu 14.04 to 16.04, CentOS 7+, Debian 7 to 8 and MacOS X.
  • You may have to install Python 2.7 (eg on Ubuntu 16.04+) by running apt-get install python-minimal
  • This script will install the pre-requisites, install bench and setup an ERPNext site
  • Passwords for Frappe Administrator and MariaDB (root) will be asked
  • You can then login as Administrator with the Administrator password
  • If you find any problems, post them on the forum: https://discuss.erpnext.com

Open your Terminal and enter:

1. Download the install script

For Linux:

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

For Mac OSX:

Install X Code (from App store) and HomeBrew (http://brew.sh/) first

brew install python
brew install git

Download the Script

curl "https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py" -o install.py

2. Run the install script

If you are on a fresh server and logged in as root, use --user flag to create a user and install using that user

python install.py --develop --user frappe

For developer setup:

sudo python install.py --develop

For production:

sudo python install.py --production

What will this script do?

  • Install all the pre-requisites
  • Install the command line bench
  • Create a new bench (a folder that will contain your entire frappe/erpnext setup)
  • Create a new site on the bench

How do I start ERPNext

  1. For development: Go to your bench folder (frappe-bench by default) and start the bench with bench start
  2. For production: Your process will be setup and managed by nginx and supervisor. Setup Production

Help

For bench help, you can type

bench --help

Updating

To manually update the bench, run bench update to update all the apps, run patches, build JS and CSS files and restart supervisor (if configured to).

You can also run the parts of the bench selectively.

bench update --pull will only pull changes in the apps

bench update --patch will only run database migrations in the apps

bench update --build will only build JS and CSS files for the bench

bench update --bench will only update the bench utility (this project)

bench update --requirements will only update dependencies (python packages) for the apps installed

Guides

Resources