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

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
Installed pydev plugin in eclipse Mars
Configured Python interpreter (Given the virtual env python path here. i.e {PATH_TO_VIRTUAL_ENV}/bin/python)
Setup odoo source
Specified the new python interpreter on the project properties -> python interpretor
Created a new Run Configuration to run the source with the custom setup file and with the new interpretor
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)

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.

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

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

Related

Cygwin terminal is only recognizing `pip3 install` rather than `pip2 install`

I need to install the python future module to compile a code using ./waf command, and I'm doing this using the Cygwin 64 terminal. However, due to incompatibility issues I keep getting future module not found though it is already installed. I'm trying to re-install the module using pip2 install command, and the following error occurred:
Gover#LAPTOP-OV3886CH /cygdrive/d/ardupilot
$ pip2 install future
-bash: pip2: command not found
However, I can install the future module using pip3 install , but this is still not compatible with the ./waf command. Why is pip2 install not working?
Install python27-pip and python27packages
see package contents on
https://cygwin.com/packages/x86_64/python27-pip/python27-pip-20.3.3-2

AWS EC2 : sudo: apt-get: command not found error

I have installed Amazon Linux 2 AMI (HVM), SSD Volume Type second number of os in list (AWS console) in my instance.
It connect to putty successfully.
Now I want to install node in my server.
For that I go to /var folder. Then I run this command.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
And then I got error this.
## Populating apt-get cache...
+ apt-get update
bash: apt-get: command not found
Error executing command, exiting
To fixed this I have fire follow commands.
1) apt-get update
2) sudo apt-get update
3) yum update
4) sudo yum update
Still I have same issue. Anyone can help me.
Install node version manager (nvm) by typing the following at the command line.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
Use nvm to install Node.js because nvm can install multiple versions of Node.js and allow you to switch between them.
Activate nvm by typing the following at the command line.
. ~/.nvm/nvm.sh
Use nvm to install the version of Node.js you intend to use by typing the following at the command line.
nvm install 4.4.5
Installing Node.js also installs the Node Package Manager (npm) so you can install additional modules as needed.
Test that Node.js is installed and running correctly by typing the following at the command line.
node -e "console.log('Running Node.js ' + process.version)"
This should display the following message that confirms the installed version of Node.js running.
Running Node.js v4.4.5
More Info : https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

Jfrog-CLI installation isn't working

I'm running it on Ubuntu.
when I try to run: npm install -g jfrog-cli-go
I get:
And when I try the other option of running it using curl, it gives the feeling like it succeeded but when I try to run
> jfrog
it doesn't recognize the command curl -fL https://getcli.jfrog.io | sh
I get:
the jfrog-cli version that I'm using is: 1.17.1
Can anyone tell me what's the problem here?
npm:
For npm in Ubuntu please use --unsafe-perm=true flag:
sudo npm install -g jfrog-cli-go --unsafe-perm=true.
Please see the npm package documentation for more info.
curl: Curl will download jfrog cli to your current working directory. After this, you can either run it locally by running ./jfrog or moving it to Ubuntu's execution path, e.g. sudo mv ./jfrog /usr/local/bin/

pytables installation failed

I do:
sudo pip install --upgrade tables
I get:
/usr/bin/ld: cannot find -lhdf5
collect2: ld returned 1 exit status
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
Complete output from command python setup.py egg_info:
/usr/bin/ld: cannot find -lhdf5
however:
$ echo $HDF5_DIR
/opt/hdf5/
$ ls /opt/hdf5/
bin include lib share
$ ls /opt/hdf5/lib/
libhdf5.a libhdf5_hl.la libhdf5_hl.so.8 libhdf5.la libhdf5.so libhdf5.so.8.0.1
libhdf5_hl.a libhdf5_hl.so libhdf5_hl.so.8.0.1 libhdf5.settings libhdf5.so.8
What's wrong? How to debug? I already tried to set HDF5_DIR to /opt/ or to /opt/hdf5/lib.
I also had the same error on Debian sid trying to work in a local virtualenv. To work around it I did:
apt-get build-dep python-tables
HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ && pip install tables
... now it's working.
I was able to fix this easily in OSX with virtual environments using the following code:
$ brew install hdf5
$ pyvenv test
$ workon myvenv # to get pytables working within the virtual environment myvenv
$ pip install numpy numexpr cython
$ pip install tables
(taken from andreabedini post in https://github.com/PyTables/PyTables/issues/385)
I'm having a similar problem, but I'm using the leading edge not the pip release (see Aside).
I also tried pointing to the library itself
export HDF5_DIR=/usr/lib/libhdf5.so.6
but it did not work.
Aside: You can try the leading edge of PyTables if you think your bug may have been addressed recently:
sudo pip install git+https://github.com/PyTables/PyTables
.
The build (that was caused by pip install...) seemed to progress further after I installed the dev version of the hdf5 library (libhdf5-openmpi-dev). The build still failed for other reasons, but it's another direction you could try.
Perhaps you can install the stable wheel file for your os for pytables from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pytables
Use this command to check for which file to download
path/to/pythonX.Y -m pip debug --verbose
And this command to install the wheel file
pip install C:/some-dir/some-file.whl
I tried everything without success. The only way I could I achieved was using nehalecky's answer I got here:
https://github.com/PyTables/PyTables/issues/219
In a nutshell, you should do these 2 commands, correcting the path, of course:
sudo python3 setup.py build_ext --inplace --hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial/
sudo python3 setup.py install --hdf5=/usr/lib/x86_64-linux-gnu/hdf5/serial/
Hope it helps!

Why does Grunt not add itself to the shell?

I have a problem installing grunt. All the documentation, and blog post tutorials, say that running:
npm install -g grunt
will then allow you to run grunt commands from the terminal.
I have a situation where grunt appears to install with no errors, but typing the command grunt in the terminal still gives:
-bash: grunt: command not found
What could I be doing wrong? And where could I find grunt to add it to my BASH profile manually?
Since Grunt version 0.4 (which was released 1 or 2 weeks ago) you need to install the grunt command line tool globally (if needed, use sudo before the command):
npm install -g grunt-cli
In your project location you then install the latest grunt version:
npm install grunt --save-dev
Option --save-dev will save the npm config in your package.json file, which makes it easier to install or reinstall the dependencies (using just npm install).
Try running the install with the verbose flag:
npm install -g grunt --verbose
You can see where it is being installed (something like /usr/local/share/npm/bin/grunt). Then check your path:
echo $PATH
If the path does not contain the install bin location, modify the path in your bash profile to include the location of the bin directory, then try grunt again in a fresh terminal.
UPDATE: Grunt 0.4 altered installation process. For 0.4 installs, see answer from asgoth below.
It seems that grunt in the current version 0.4.0 does not install a bin command. The last 0.3.x version is 0.3.17, which supports a bin command. To run grunt from the command line, you will want to install the grunt command line grunt-cli:
npm install -g grunt-cli --verbose
I had installed node using Homebrew and this was my solution:
set config for -g (GLOBAL) install directory directory: npm config
set prefix /Users/YOURNAME/.node/
make sure to edit PATH: sudo nano ~/.profile
add to path: export PATH=“/Users/YOURNAME/.node/bin:”$PATH
then update source: source ~/.profile
Following these steps will allow any packages installed using npm install -g somePKG to be placed in the correct location regardless of your current working directory. And by updating your $PATH correctly command line functions will work.
Information based on:
Fixing npm permissions - bit.ly/1CmIyqx

Resources