pkg_resources.DistributionNotFound: The 'bench==4.1.0' distribution was not found and is required by the application

Hello
i have just installed bench-repo on python 2.7.11
after successfully installed packages
“followed the tips here GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
whenever i execute bench this error shows up
pkg_resources.DistributionNotFound: The 'bench==4.1.0' distribution was not found and is required by the application

the full error
$ bench Traceback (most recent call last): File "/usr/local/bin/bench", line 5, in <module> from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3138, in <module> @_call_aside File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3124, in _call_aside f(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3151, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 661, in _build_master ws.require(__requires__) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 962, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 849, in resolve

it’s already installed on my system but still showing the error
it’s my first time to install Frappe
thank you

This often happens if you run

pip install -e bench-repo

instead of the preferred

sudo pip install -e bench-repo

1 Like

i did so
i got that result
but still the same error
`installing collected packages: GitPython, bench
Found existing installation: GitPython 1.0.1
Not uninstalling GitPython at /usr/lib/python2.7/dist-packages, owned by OS
Running setup.py develop for bench

    warning: no files found matching '*.json' under directory 'bench'
    Creating /usr/local/lib/python2.7/dist-packages/bench.egg-link (link to .)
    bench 4.1.0 is already the active version in easy-install.pth
    Installing bench script to /usr/local/bin
    
    Installed /root/bench-repo
Successfully installed GitPython bench
Cleaning up...`

If this is where the install ended up, it implies that you installed as user “root” - this is not advised. rather create a user called frappe, give the user sudo rights, and install as user frappe using sudo on certain commands

That’s True
i just changed my OS and did so
first installed the dependencies
then created a user called it frappe
then i gave it sudo rights
then i followed the rest of the instructions
thank you for caring