-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] node-gyp error: ImportError: No module named parser #684
Comments
Hello, https://github.com/nodejs/node-gyp#installation |
Thanks @lovell. I do have python 2.7.3 installed and in usr/local/lib I also see Python 3.5. When I run python --version I get 2.7.3 I saw that node-gyp doesn't support python 3 but I am not really using python for my development at the moment so no virtual environments or anything like that. I also noticed that on the EC2 I started from scratch and I did succeed in installing Sharp I have python 2.7.6 installed and a python 3.4 directory in /usr/local/lib. i also tried to run "npm install --python=python2.7 sharp" and I get the same error |
If the (This is a problem relating to the Python setup on one specific machine so I'm probably not going to be much help.) |
Thanks @lovell I fixed it. Apparently I had another python installed from a while ago and when I upgraded to 16.04 they collided. I removed the old one, and now I am only using the one the OS installed. Works great! Thanks |
I am trying to install Sharp and I keep getting node-gyp error. I tried to find solutions online but nothing works. I started a clean instance on EC2 to check and installed the same node and npm that I have on my computer and it worked there. Can you please let me know what's the problem
I am running ubuntu 16.04
npm install sharp
npm WARN prefer global node-gyp@3.5.0 should be installed with -g
sharp@0.17.1 install /home/test/Documents/proj/node_modules/sharp
node-gyp rebuild
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 13, in
import gyp
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 8, in
import gyp.input
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 5, in
from compiler.ast import Const
File "/usr/lib/python2.7/compiler/init.py", line 29, in
from compiler.transformer import parse, parseFile
File "/usr/lib/python2.7/compiler/transformer.py", line 29, in
import parser
ImportError: No module named parser
gyp ERR! configure error
gyp ERR! stack Error:
gyp
failed with exit code: 1gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 4.4.0-57-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/test/Documents/proj/node_modules/sharp
gyp ERR! node -v v5.11.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
Thanks!
The text was updated successfully, but these errors were encountered: