Error while installing bench and frappe-bench

1,076 views
Skip to first unread message

Dhaval Patel

unread,
Jul 27, 2014, 10:42:37 AM7/27/14
to erpnext-dev...@googlegroups.com
Following instructions provided at : https://github.com/frappe/bench#setting-up-erpnext
I installed all the prerequisites one by one seperately and tried to install bench.
While installing bench (centos 6.5) I get the following error:


Installing collected packages: bench
  Running setup.py develop for bench

    file bench.py (for module bench) not found

Creating /usr/lib/python2.7/site-packages/bench.egg-link (link to .)
    Adding bench 0.1 to easy-install.pth file
    Installing bench script to /usr/bin

    Installed /home/frappe/bench-repo
Successfully installed bench
Cleaning up...


Since it still says bench successfully installed I went forward and run: bench init frappe-bench

I get the following error:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 357, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2394, in load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2108, in load
ImportError: No module named bench.cli

Was my bench installed succesfully? Do i need to run the "bench init frappe-bench" command as root or frappe. I did as frappe.

Pratik Vyas

unread,
Jul 27, 2014, 10:44:58 AM7/27/14
to erpnext-dev...@googlegroups.com
I am not able to reproduce this error all time (little random). The
fix for it is

```
pip uninstall bench
pip install -e /home/frappe/bench-repo
```
Basically install it again, and it runs fine.

>
> Was my bench installed succesfully? Do i need to run the "bench init
> frappe-bench" command as root or frappe. I did as frappe.
>

Nope, nothing happened. You'll have to init again and as frappe.
> --
> Note:
>
> If you are posting an issue,
>
> 1. ERPNext is a free and open source software and support is given on this
> forum by a team (https://frappe.io/webnotes). So please consider donating if
> you find this forum useful (https://frappe.io/buy). Even a small amount
> would be helpful.
> 2. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 3. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 4. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/43d2c96e-156a-403e-b5c3-de7ef09d965e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Pratik
erpnext

Dhaval Patel

unread,
Jul 27, 2014, 1:04:55 PM7/27/14
to erpnext-dev...@googlegroups.com
Pratik,

I uninstalled and installed bench several times but it gives me same error. 

file bench.py (for module bench) not found 

Where is this file located.? 


Pratik Vyas

unread,
Jul 27, 2014, 1:26:18 PM7/27/14
to erpnext-dev...@googlegroups.com
On Sun, Jul 27, 2014 at 10:34 PM, Dhaval Patel
<pateldh...@gmail.com> wrote:
> Pratik,
>
> I uninstalled and installed bench several times but it gives me same error.
>
> file bench.py (for module bench) not found
>
> Where is this file located.?
>

That is the problem. bench is package (dir with __init__.py file),
there is really no bench.py. The entry point is bench.cli

Can you try uninstall it and then installing it using the method below,

```
cd /home/frappe/bench-repo
python setup.py develop #as root
```


Thanks,
--
Pratik
erpnext

Dhaval Patel

unread,
Jul 28, 2014, 1:58:34 AM7/28/14
to erpnext-dev...@googlegroups.com
Pratik,

Thank you very much for your time. You guys are great.

I tried your options but missing file (bench.py) error was always there. But I went forward and init the frappe. Earlier my bench init error was due to permission issue (frappe user did not had permission), I looked in your old frappe-bench install scripts and I found out that we need to update sudoers file and provide frappe with admin rights (echo "erpnext ALL=(ALL) NOPASSWD: /usr/bin/supervisorctl restart frappe\:" > /etc/sudoers.d/erpnext), this line is missing in new install scripts. 

Now I do have frappe running but not sure if that error might create some functionality issues. I hope not.

Pratik Vyas

unread,
Jul 28, 2014, 2:14:48 AM7/28/14
to erpnext-dev...@googlegroups.com
Hi Dhaval,

On Mon, Jul 28, 2014 at 11:28 AM, Dhaval Patel
<pateldh...@gmail.com> wrote:
> Pratik,
>
> Thank you very much for your time. You guys are great.
>
> I tried your options but missing file (bench.py) error was always there. But
> I went forward and init the frappe.

Yes, that is a warning from distutils, you can ignore it.

> Earlier my bench init error was due to
> permission issue (frappe user did not had permission), I looked in your old
> frappe-bench install scripts and I found out that we need to update sudoers
> file and provide frappe with admin rights (echo "erpnext ALL=(ALL) NOPASSWD:
> /usr/bin/supervisorctl restart frappe\:" > /etc/sudoers.d/erpnext), this
> line is missing in new install scripts.

That is replaced by a new command in the bench, `bench setup sudoers`
but if you've added it manually, it's fine, just replace erpnext with
frappe

>
> Now I do have frappe running but not sure if that error might create some
> functionality issues. I hope not.
>

Nope, all seems to have run correctly.

Thanks,
--
Pratik
erpnext
Reply all
Reply to author
Forward
0 new messages