Command python setup.py egg_info failed with error code 2 in /home/coder/erpnext/frappe-bench/env/build/dropbox

Hi. I performed a erpnext installation on a freshly installed OS: CentOS 7 (Core) 64 bits

The issue I had was

  • git clone bench-repo OK
  • bench init frappe-bench resulted in some error due to dropbox
  • the dropbox error was due to setuptools version
  • however, the setuptools version is already the latest.

I followed the instructions:

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

For most part, the progress went fine:

[coder@localhost erpnext]$ git clone https://github.com/frappe/bench bench-repo
Cloning into 'bench-repo'...
remote: Counting objects: 1359, done.
remote: Total 1359 (delta 0), reused 0 (delta 0), pack-reused 1359
Receiving objects: 100% (1359/1359), 241.62 KiB | 176.00 KiB/s, done.
Resolving deltas: 100% (895/895), done.
[coder@localhost erpnext]$ sudo pip install -e bench-repo
Obtaining file:///home/coder/erpnext/bench-repo
Requirement already satisfied (use --upgrade to upgrade): Click in /usr/lib64/python2.7/site-packages (from bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): jinja2 in /usr/lib/python2.7/site-packages (from bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/lib/python2.7/site-packages (from bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python2.7/site-packages (from bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): honcho in /usr/lib/python2.7/site-packages (from bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): semantic-version in /usr/lib/python2.7/site-packages (from bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): GitPython==0.3.2.RC1 in /usr/lib/python2.7/site-packages (from bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): markupsafe in /usr/lib64/python2.7/site-packages (from jinja2->bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): gitdb>=0.5.1 in /usr/lib64/python2.7/site-packages (from GitPython==0.3.2.RC1->bench==0.92)
Requirement already satisfied (use --upgrade to upgrade): smmap>=0.8.5 in /usr/lib/python2.7/site-packages (from gitdb>=0.5.1->GitPython==0.3.2.RC1->bench==0.92)
Installing collected packages: bench
  Running setup.py develop for bench
Successfully installed bench-0.92

However, I ran into the following error when performing ‘bench init frappe-bench’ as shown below

[coder@localhost erpnext]$ bench init frappe-bench && cd frappe-bench
Already using interpreter /usr/bin/python
Cloning into 'frappe'...
remote: Counting objects: 78827, done.
remote: Compressing objects: 100% (176/176), done.
remote: Total 78827 (delta 80), reused 0 (delta 0), pack-reused 78651
Receiving objects: 100% (78827/78827), 38.05 MiB | 4.69 MiB/s, done.
Resolving deltas: 100% (57058/57058), done.
installing frappe
Command python setup.py egg_info failed with error code 2 in /home/coder/erpnext/frappe-bench/env/build/dropbox
Storing complete log in /home/coder/.pip/pip.log
Traceback (most recent call last):
  File "/usr/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/coder/erpnext/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/coder/erpnext/bench-repo/bench/cli.py", line 165, in init
    no_auto_update=no_auto_update, frappe_path=frappe_path, frappe_branch=frappe_branch)
  File "/home/coder/erpnext/bench-repo/bench/utils.py", line 71, in init
    get_app('frappe', frappe_path, branch=frappe_branch, bench=path, build_asset_files=False)
  File "/home/coder/erpnext/bench-repo/bench/app.py", line 54, in get_app
    install_app(app, bench=bench)
  File "/home/coder/erpnext/bench-repo/bench/app.py", line 78, in install_app
    find_links=find_links))
  File "/home/coder/erpnext/bench-repo/bench/utils.py", line 104, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe

To further troubleshoot the issue, I ran ‘frappe-bench/env/bin/pip install -e frappe-bench/apps/frappe’ and got the error ‘The required version of setuptools (>=3.1) is not available’ as shown below:

[coder@localhost erpnext]$ frappe-bench/env/bin/pip install -e frappe-bench/apps/frappe
Obtaining file:///home/coder/erpnext/frappe-bench/apps/frappe
  Running setup.py egg_info for package from file:///home/coder/erpnext/frappe-bench/apps/frappe
    
    warning: no files found matching '*.json'
    warning: no files found matching '*.dat' under directory 'frappe'
    warning: no files found matching '*.jpg' under directory 'frappe'
    warning: no files found matching '*.swf' under directory 'frappe'
    warning: no files found matching '*.ico' under directory 'frappe'
    warning: no previously-included files matching '*.pyc' found under directory '*'
Downloading/unpacking chardet (from frappe==6.4.6)
  Downloading chardet-2.3.0.tar.gz (164kB): 164kB downloaded
  Running setup.py egg_info for package chardet
    
    warning: no files found matching 'COPYING'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no files found matching '*.css' under directory 'docs'
    warning: no files found matching '*.png' under directory 'docs'
    warning: no files found matching '*.gif' under directory 'docs'
Downloading/unpacking cssmin (from frappe==6.4.6)
  Downloading cssmin-0.2.0.tar.gz
  Running setup.py egg_info for package cssmin
    
    warning: no previously-included files matching '.DS_Store' found anywhere in distribution
Downloading/unpacking dropbox (from frappe==6.4.6)
  Downloading dropbox-3.36.tar.gz (115kB): 115kB downloaded
  Running setup.py egg_info for package dropbox
    
    The required version of setuptools (>=3.1) is not available,
    and can't be installed while this script is running. Please
    install a more recent version first, using
    'easy_install -U setuptools'.
    
    (Currently using setuptools 0.9.8 (/home/coder/erpnext/frappe-bench/env/lib/python2.7/site-packages))
    Complete output from command python setup.py egg_info:
    
The required version of setuptools (>=3.1) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U setuptools'.
(Currently using setuptools 0.9.8 (/home/coder/erpnext/frappe-bench/env/lib/python2.7/site-packages))

However, when I performed ‘easy_install -U setuptools’, nothing was upgraded.

[coder@localhost erpnext]$ sudo easy_install -U setuptools
Searching for setuptools
Reading https://pypi.python.org/simple/setuptools/
Best match: setuptools 18.3.2
Processing setuptools-18.3.2-py2.7.egg
setuptools 18.3.2 is already the active version in easy-install.pth
Installing easy_install script to /usr/bin
Installing easy_install-2.7 script to /usr/bin
Using /usr/lib/python2.7/site-packages/setuptools-18.3.2-py2.7.egg
Processing dependencies for setuptools
Finished processing dependencies for setuptools

What should I do next?

@pdvyas Can you please check?

Can you try,

cd ~/frappe-bench
rm -rf env
bench setup env
./env/bin/pip install -e apps/frappe
1 Like

Thanks @rmehta and @pdvyas.

Summary
I’ve tried and ended with setuptools error as show below.

Output

[coder@localhost erpnext]$ cd frappe-bench/
[coder@localhost frappe-bench]$ rm -rf env
[coder@localhost frappe-bench]$ bench setup env
Already using interpreter /usr/bin/python
[coder@localhost frappe-bench]$ ./env/bin/pip install -e apps/frappe/
Obtaining file:///home/coder/erpnext/frappe-bench/apps/frappe
  Running setup.py egg_info for package from file:///home/coder/erpnext/frappe-bench/apps/frappe
    
    warning: no files found matching '*.json'
    warning: no files found matching '*.dat' under directory 'frappe'
    warning: no files found matching '*.jpg' under directory 'frappe'
    warning: no files found matching '*.swf' under directory 'frappe'
    warning: no files found matching '*.ico' under directory 'frappe'
    warning: no previously-included files matching '*.pyc' found under directory '*'
Downloading/unpacking chardet (from frappe==6.4.6)
  Downloading chardet-2.3.0.tar.gz (164kB): 164kB downloaded
  Running setup.py egg_info for package chardet
    
    warning: no files found matching 'COPYING'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no files found matching '*.css' under directory 'docs'
    warning: no files found matching '*.png' under directory 'docs'
    warning: no files found matching '*.gif' under directory 'docs'
Downloading/unpacking cssmin (from frappe==6.4.6)
  Downloading cssmin-0.2.0.tar.gz
  Running setup.py egg_info for package cssmin
    
    warning: no previously-included files matching '.DS_Store' found anywhere in distribution
Downloading/unpacking dropbox (from frappe==6.4.6)
  Downloading dropbox-3.36.tar.gz (115kB): 115kB downloaded
  Running setup.py egg_info for package dropbox
    
    The required version of setuptools (>=3.1) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U setuptools'.
    
    (Currently using setuptools 0.9.8 (/home/coder/erpnext/frappe-bench/env/lib/python2.7/site-packages))
    Complete output from command python setup.py egg_info:
    
The required version of setuptools (>=3.1) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U setuptools'.

(Currently using setuptools 0.9.8 (/home/coder/erpnext/frappe-bench/env/lib/python2.7/site-packages))
1 Like

Update

Hi, I’ve tried a working fix to successfully pass through installation of all items in requirements.txt
The steps are:

cd ~/frappe-bench
rm -rf env
bench setup env
./env/bin/pip install -U setuptools
./env/bin/pip install -e apps/frappe

This will upgrade setuptools from 0.9.8 to 18.3.2 as show below:

Downloading/unpacking setuptools from https://pypi.python.org/packages/source/s/setuptools/setuptools-18.3.2.tar.gz#md5=d30c969065bd384266e411c446a86623
  Downloading setuptools-18.3.2.tar.gz (626kB): 626kB downloaded
  Running setup.py egg_info for package setuptools
    
Installing collected packages: setuptools
  Found existing installation: setuptools 0.9.8
    Uninstalling setuptools:
      Successfully uninstalled setuptools
  Running setup.py install for setuptools
    
    Installing easy_install script to /home/coder/erpnext/frappe-bench/env/bin
    Installing easy_install-2.7 script to /home/coder/erpnext/frappe-bench/env/bin
Successfully installed setuptools

The rest of installation using ./env/bin/pip install -e apps/frappe/ went through without error

2 Likes