Vivek
Vivek

Reputation: 3613

Could not execute command lessc' while running odoo (any version) in eclipse mac

After a thorough analysis of 'Could not execute command lessc' i've successfully ran odoo (any version) on my command line with python virtual env. Am doing this to run odoo in command line

$ . {PATH_TO_VIRTUAL_ENV}/bin/activate (Running the script in the current shell)
$ cd {PATH_TO_ODOO_SOURCE}
$ ./odoo.py -c setup.cfg

And the above runs with proper UI.

Now when trying to run the same from eclipse throws me 'Could not execute command lessc'. I did the below to run code from eclipse

Kindly throw me light on places where i miss. Also i've gone through links on setting up python virtual env in eclipse. They all say the same thing still this lessc dependency is somehow not linked. Please comment if you require more info to identify the error. Thanks for your help! :)

FYI am using mac.

Update

For Shikhar (based on his answer) enter image description here

Upvotes: 1

Views: 3040

Answers (3)

The solution:

  • sudo apt-get install node-clean-css
  • sudo apt-get install node-less

may work for Global system installation but if you are working within a virtualenv you may try this.

If somebody had the issue inside PyCharm wich was my case and nothing else works...

I leave my solution here:

First: I tried to check if node and npm exist inside my virtualenv: node -v and npm -v, not any of them... Second: I was using virtualenv, also when I ask inside my virtualenv with: which lessc . I didn't receive any response neither, so... I keep googling and found this post: How to install lessc and nodejs in a Python virtualenv?

In any case this was what I did on my virtualenv and the problem was solved:

  • MYVIRTUALENV/bin/activate # switch to my Python virtualenv first
  • pip3.7 install nodeenv # install nodeenv nodeenv was installed, in case you are using python 2.x use pip instead pip3
  • nodeenv --python-virtualenv # Use current python virtualenv
  • npm install -g less # install lessc in the virtualenv
  • npm install -g less-plugin-clean-css # also install this less-plugin...

then if I check with node -v and npm -v I get a proper response... also get good response on: which lessc

After that no more nightmare with lessc execution in pycharm

Upvotes: 0

Sunny Sheth
Sunny Sheth

Reputation: 1

try this

sudo apt-get install node-clean-css
sudo apt-get install node-less

Upvotes: 0

Shikhar S
Shikhar S

Reputation: 319

This problem is related to your bad configuration of Nodejs and less on system.

Use commands below to resolve this -

wget -qO- https://deb.nodesource.com/setup | sudo bash -

then

brew install node

and finally

sudo npm install -g less less-plugin-clean-css

This will resolve the lessc command issue.

Upvotes: 0

Related Questions