Error when calling bench update

frappe@raspberrypi:~/frappe/frappe-bench $ bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up to date.
INFO:bench.utils:./env/bin/pip install Pillow
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (5.4.1)
Backing up sites...
/home/frappe/frappe/frappe-bench/env/bin/python: Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe')

if I try to manually add it:

~/frappe $ sudo pip install -e bench-repo
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Obtaining file:///home/frappe/frappe/bench-repo
Requirement already satisfied: Click in /usr/lib/python3/dist-packages (from bench==4.1.0) (7.0)
Requirement already satisfied: GitPython==2.1.11 in /usr/local/lib/python3.7/site-packages (from bench==4.1.0) (2.1.11)
Requirement already satisfied: honcho in /usr/local/lib/python3.7/site-packages (from bench==4.1.0) (1.0.1)
Requirement already satisfied: jinja2 in /usr/lib/python3/dist-packages (from bench==4.1.0) (2.10)
Requirement already satisfied: python-crontab in /usr/local/lib/python3.7/site-packages (from bench==4.1.0) (2.3.8)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from bench==4.1.0) (2.21.0)
Requirement already satisfied: semantic_version in /usr/local/lib/python3.7/site-packages (from bench==4.1.0) (2.6.0)
Requirement already satisfied: virtualenv in /usr/local/lib/python3.7/site-packages (from bench==4.1.0) (16.7.2)
Requirement already satisfied: gitdb2>=2.0.0 in /usr/local/lib/python3.7/site-packages (from GitPython==2.1.11->bench==4.1.0) (2.0.5)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.7/site-packages (from python-crontab->bench==4.1.0) (2.8.0)
Requirement already satisfied: smmap2>=2.0.0 in /usr/local/lib/python3.7/site-packages (from gitdb2>=2.0.0->GitPython==2.1.11->bench==4.1.0) (2.0.5)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil->python-crontab->bench==4.1.0) (1.12.0)
Installing collected packages: bench
  Running setup.py develop for bench
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/frappe/frappe/bench-repo/setup.py'"'"'; __file__='"'"'/home/frappe/frappe/bench-repo/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
         cwd: /home/frappe/frappe/bench-repo/
    Complete output (30 lines):
    running develop
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/frappe/frappe/bench-repo/setup.py", line 27, in <module>
        ''',
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 984, in run_command
        cmd_obj.ensure_finalized()
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 56, in finalize_options
        easy_install.finalize_options(self)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 312, in finalize_options
        'install_lib', ('install_dir', 'install_dir')
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 287, in set_undefined_options
        src_cmd_obj.ensure_finalized()
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 18, in finalize_options
        self.set_undefined_options('install',('install_layout','install_layout'))
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 290, in set_undefined_options
        setattr(self, dst_option, getattr(src_cmd_obj, src_option))
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 103, in __getattr__
        raise AttributeError(attr)
    AttributeError: install_layout
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/frappe/frappe/bench-repo/setup.py'"'"'; __file__='"'"'/home/frappe/frappe/bench-repo/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 Check the logs for full command output.

How do I solve this? Thank yoU!

sudo pip install --upgrade setuptools worked for the second part. Not for the original problem

This was fixed by:

/env/bin/pip install -q  -e ./apps/frappe
2 Likes

./env/bin/pip3 install -e apps/frappe/

run above command to get resolved.