Getting error while creating a new bench directory

iron@iron-pc:~$ bench init frappe-bench && cd frappe-bench
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 6, in
from pkg_resources import load_entry_point
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3036, in
@_call_aside
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3020, in _call_aside
f(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3049, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 654, in _build_master
ws.require(requires)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 968, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘MarkupSafe>=0.23’ distribution was not found and is required by jinja2

Hello @gaurab
I think you missing this command
pip install -e bench-repo

Thanks

Thanks sagar for your reply. I did not miss that command.

share the output of
bench --help

Thanks

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 6, in
from pkg_resources import load_entry_point
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3036, in
@_call_aside
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3020, in _call_aside
f(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 3049, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 654, in _build_master
ws.require(requires)
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 968, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘MarkupSafe>=0.23’ distribution was not found and is required by jinja2

pip install markupsafe
or
sudo pip install markupsafe

what i did i renamed the directory bench-repo and rerun all the commands. it seems to be working now. Here is the output of the command. Has it run successfully?
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: 126568, done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 126568 (delta 21), reused 0 (delta 0), pack-reused 126499
Receiving objects: 100% (126568/126568), 95.71 MiB | 2.73 MiB/s, done.
Resolving deltas: 100% (95119/95119), done.
Checking connectivity… done.
(‘installing’, u’frappe’)
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe --no-cache-dir
/home/iron/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/home/iron/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see Advanced Usage - urllib3 2.0.0a2 documentation.
InsecurePlatformWarning
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-ZuJ6Cv/mysql-python/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/iron/bench-repo/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 “/home/iron/bench-repo/bench/commands/make.py”, line 19, in init
verbose=verbose, clone_from=clone_from)
File “/home/iron/bench-repo/bench/utils.py”, line 56, in init
get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
File “/home/iron/bench-repo/bench/app.py”, line 76, in get_app
install_app(app=app_name, bench_path=bench_path, verbose=verbose)
File “/home/iron/bench-repo/bench/app.py”, line 107, in install_app
find_links=find_links))
File “/home/iron/bench-repo/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

please check mysql not install properly.
if you are use fresh system for installation to install all prerequisite

.

no it is installed properly. I install MariaDB. See below

iron@iron-pc:~$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 42
Server version: 5.5.55-MariaDB-1~trusty mariadb.org binary distribution

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

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

MariaDB [(none)]>

should i use mysql db instead of mariadb? Please suggest. Also, which python version should i use? As i am getting following warning

INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe --no-cache-dir
/home/iron/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.

1 Like