Frappe_docker Getting started OSError: setuptools pip wheel failed with error code 1

I am new to Frappe and ERPNext

Trying to get started via docker. I followed the instruction here to the letter.

On the terminal inside the container created, I run the the following:

bench init --skip-redis-config-generation --frappe-branch version-12 frappe-bench

and the following was the output

WARN: Command not being executed in bench directory
$ /home/frappe/.local/bin/virtualenv -q env -p python3
Already using interpreter /usr/bin/python3
Traceback (most recent call last):
  File "/home/frappe/.local/bin/virtualenv", line 10, in <module>
    sys.exit(main())
  File "/home/frappe/.local/lib/python3.7/site-packages/virtualenv.py", line 831, in main
    symlink=options.symlink,
  File "/home/frappe/.local/lib/python3.7/site-packages/virtualenv.py", line 1123, in create_environment
    install_wheel(to_install, py_executable, search_dirs, download=download)
  File "/home/frappe/.local/lib/python3.7/site-packages/virtualenv.py", line 973, in install_wheel
    _install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
  File "/home/frappe/.local/lib/python3.7/site-packages/virtualenv.py", line 1060, in _install_wheel_with_search_dir
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)
  File "/home/frappe/.local/lib/python3.7/site-packages/virtualenv.py", line 924, in call_subprocess
    raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command /workspace/developme...ench/env/bin/python3 - setuptools pip wheel failed with error code 1
INFO:bench.app:Getting app frappe
$ git clone https://github.com/frappe/frappe.git --branch version-12 --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 2611, done.
remote: Counting objects: 100% (2611/2611), done.
remote: Compressing objects: 100% (2416/2416), done.
remote: Total 2611 (delta 352), reused 995 (delta 145), pack-reused 0
Receiving objects: 100% (2611/2611), 12.39 MiB | 1.74 MiB/s, done.
Resolving deltas: 100% (352/352), done.
Checking out files: 100% (2512/2512), done.
INFO:bench.app:installing frappe
$ frappe-bench/env/bin/pip install -q -U -e frappe-bench/apps/frappe 
[Errno 2] No such file or directory: 'frappe-bench/env/bin/pip': 'frappe-bench/env/bin/pip'
ERROR: There was a problem while creating frappe-bench
Do you want to rollback these changes? [Y/n]: 

I have also tried running it as root. However bench command was not found for root.

Kindly assist.

Which OS are you using?

I tried to bootstrap development environment now with frappe/bench:latest image.

It worked as expected.

frappe@b5669f5ff05a:/workspace/development$ bench init --skip-redis-config-generation --frappe-branch version-12 frappe-bench
WARN: Command not being executed in bench directory
$ /home/frappe/.local/bin/virtualenv -q env -p python3
Already using interpreter /usr/bin/python3
INFO:bench.app:Getting app frappe
$ git clone https://github.com/frappe/frappe.git --branch version-12 --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 2611, done.
remote: Counting objects: 100% (2611/2611), done.
remote: Compressing objects: 100% (2442/2442), done.
remote: Total 2611 (delta 349), reused 932 (delta 119), pack-reused 0
Receiving objects: 100% (2611/2611), 12.39 MiB | 2.02 MiB/s, done.
Resolving deltas: 100% (349/349), done.
INFO:bench.app:installing frappe
$ frappe-bench/env/bin/pip install -q -U -e frappe-bench/apps/frappe 
ERROR: frontmatter 3.0.5 has requirement PyYAML==3.13, but you'll have pyyaml 5.1 which is incompatible.
Updating node packages...

Installing node dependencies for frappe
$ yarn install
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
warning " > bootstrap@4.3.1" has unmet peer dependency "popper.js@^1.14.7".
[4/4] Building fresh packages...
Done in 106.38s.
$ bench build
yarn run v1.22.4
$ FRAPPE_ENV=production node rollup/build.js
Production mode
✔ Built js/moment-bundle.min.js
✔ Built js/libs.min.js

Building frappe assets...

✔ Built js/checkout.min.js
✔ Built js/dialog.min.js
✔ Built js/modules.min.js
✔ Built js/social.min.js
✔ Built js/list.min.js
✔ Built js/web_form.min.js
✔ Built js/chat.js
✔ Built css/frappe-rtl.css
✔ Built css/printview.css
✔ Built css/form.min.css
✔ Built css/list.min.css
✔ Built css/report.min.css
✔ Built css/module.min.css
✔ Built frappe/css/email.css
✔ Built js/desk.min.js
✔ Built js/barcode_scanner.min.js
✔ Built css/frappe-chat-web.css
✔ Built js/frappe-web.min.js
✔ Built js/frappe-recorder.min.js
✔ Built js/bootstrap-4-web.min.js
✔ Built css/web_form.css
✔ Built css/desk.min.css
✔ Built css/frappe-web-b4.css
✔ Built js/control.min.js
✔ Built js/form.min.js
✔ Built js/data_import_tools.min.js
✔ Built js/report.min.js
✨  Done in 32.888s
Done in 33.83s.
INFO:bench.utils:setting up backups
no crontab for frappe
SUCCESS: Bench frappe-bench initialized
frappe@b5669f5ff05a:/workspace/development$ cd frappe-bench/
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ bench set-mariadb-host mariadb
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ bench set-redis-cache-host redis-cache:6379
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ bench set-redis-queue-host redis-queue:6379
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ bench set-redis-socketio-host redis-socketio:6379
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ sed -i '/redis/d' ./Procfile
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ bench new-site v12default.localhost
MySQL root password: 

Installing frappe...
Updating DocTypes for frappe        : [========================================]
Updating country info               : [========================================]
Set Administrator password: 
Re-enter Administrator password: 
*** Scheduler is disabled ***
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ bench get-app erpnext --branch version-12
INFO:bench.app:Getting app erpnext
$ git clone https://github.com/frappe/erpnext --branch version-12 --depth 1 --origin upstream
Cloning into 'erpnext'...
remote: Enumerating objects: 6065, done.
remote: Counting objects: 100% (6065/6065), done.
remote: Compressing objects: 100% (4911/4911), done.
remote: Total 6065 (delta 1733), reused 2697 (delta 1029), pack-reused 0
Receiving objects: 100% (6065/6065), 17.60 MiB | 1.45 MiB/s, done.
Resolving deltas: 100% (1733/1733), done.
INFO:bench.app:installing erpnext
$ ./env/bin/pip install -q -U -e ./apps/erpnext 
$ bench build --app erpnext
yarn run v1.22.4
$ FRAPPE_ENV=production node rollup/build.js --app erpnext
Production mode
✔ Built js/moment-bundle.min.js
✔ Built js/libs.min.js

Building erpnext assets...

✔ Built js/erpnext-web.min.js
✔ Built css/marketplace.css
✔ Built css/erpnext.css
✔ Built js/item-dashboard.min.js
✔ Built js/erpnext.min.js
✔ Built css/erpnext-web.css
✔ Built js/marketplace.min.js
✨  Done in 12.045s
Done in 12.86s.
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ mysql -uroot -p123 -hmariadb
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.3.22-MariaDB-1:10.3.22+maria~bionic mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> UPDATE mysql.user SET Host = '%' where User = '_d09073cd6ca8e11f'; FLUSH PRIVILEGES;
Query OK, 1 row affected (0.001 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> SET PASSWORD FOR '_d09073cd6ca8e11f'@'%' = PASSWORD('nqvaTE8dNluzpYp5'); FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)

Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON `_d09073cd6ca8e11f`.* TO '_d09073cd6ca8e11f'@'%'; FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)

Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> EXIT;
Bye
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ bench --site v12default.localhost install-app erpnext 

Installing erpnext...
Updating DocTypes for erpnext       : [========================================]
Updating customizations for Address
frappe@b5669f5ff05a:/workspace/development/frappe-bench$ 

Thanks for responding @revant_one

My host OS is Windows 10 Pro Version 1809

However since I’m following this guide, I run the commands in the terminal of the docker container that came with the repo

It is a Debian GNU/Linux 10 (buster)

Are you using the same OS?

I’m using Linux.

I’m using it through vscode devcontainers.

Windows: Docker Desktop 2.0+ on Windows 10 Pro/Enterprise. (Docker Toolbox is not supported. Windows container images are not supported.)

This is exactly the steps I took. I use Vscode Devcontainers. I’m able to log into the workspace and development folder in that container, however bench init fails.

:sob:

Try to pull latest image?

docker pull frappe/bench:latest

@revant_one. I tried this process again. This time it worked. Got the same results as you. Can confirm that this currently works.

Thanks for the help