0

I'm trying to install nodejs packages with command npm install but error appears:

Error:command failed c:\... Python\PYTHON. EXE - C import sys; "%s %s %s" % sys. Vwrsion_info
File <string>, Line 1
Syntax error invalid syntax

I have python3 installed. Maybe Python is needed? Any help? enter image description here

6
  • which OS? type this command which python (or) where python Commented Mar 4, 2019 at 11:22
  • Windows 7 64bit Commented Mar 4, 2019 at 11:23
  • type where python in cmd Commented Mar 4, 2019 at 11:23
  • if it's installed in the path ... above line should work Commented Mar 4, 2019 at 11:24
  • Yes it works and gives right path Commented Mar 4, 2019 at 11:25

1 Answer 1

1

Add python to the windows path. You probably have python install for the current user rather than in the program files where it is looking for it.

search for "path" in the windows start menu and Click Environment Variables...

Select PATH in the System variables section Click Edit Add Python's path to the end of the list (the paths are separated by semicolons). For example:

C:\Windows;C:\Windows\System32;C:\Python3.7...

You can find the path to the python exe by right clicking the shortcut and looking at the link address. You should add the python base folder and python\Scripts folder to the path

Sign up to request clarification or add additional context in comments.

2 Comments

It's installed in directory 'Program files (x86).
OW. The actual error is the print error. It's a python2.7 package not a python3 one. install python 2. print statements require brackets in python 3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.