Error while installing bench and frappe-bench

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.



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-forum+un…@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.

On Sun, Jul 27, 2014 at 8:12 PM, Dhaval Patel pa...@gmail.com wrote:

Following instructions provided at :
GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
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
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

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-forum+un...@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

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.? 




On Sunday, July 27, 2014 8:14:58 PM UTC+5:30, Pratik Vyas wrote:
On Sun, Jul 27, 2014 at 8:12 PM, Dhaval Patel <pa...@gmail.com> wrote:
> 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

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-forum+un...@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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/7d089ec4-14e7-4fa1-8d9a-3f55ec0ec790%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.

On Sun, Jul 27, 2014 at 10:34 PM, Dhaval Patel
pa...@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

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.


On Sunday, July 27, 2014 10:56:18 PM UTC+5:30, Pratik Vyas wrote:
On Sun, Jul 27, 2014 at 10:34 PM, Dhaval Patel
<pa...@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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1d7e4eed-f320-4cd8-8993-22f9eac033df%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.

Hi Dhaval,

On Mon, Jul 28, 2014 at 11:28 AM, Dhaval Patel
pa...@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