Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7547597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:29:38+00:00 2026-05-30T09:29:38+00:00

I am trying to run an existing python code, and having issues with it.

  • 0

I am trying to run an existing python code, and having issues with it.

This program required npm program installed and which is installed at C:\Program Files\nodejs\npm in my computer. When I run the following code, as a part of the whole program, it throws errors.

def popen_results(args):
   proc = subprocess.Popen(args, stdout=subprocess.PIPE)
   return proc.communicate()[0]

def installed():
   """docstring for npm_installed"""
   return popen_results(["which", "npm"]).strip()

This is the complete stack of the error thrown–

Checking for node and dependencies
Traceback (most recent call last):
  File "deploy\deploy.py", line 344, in <module>
    main()
  File "deploy\deploy.py", line 287, in main
    if not check_deps():
  File "deploy\deploy.py", line 201, in check_deps
    return npm.check_dependencies()
  File "C:\Documents and Settings\Sunil\workspace\khan\src\deploy\npm.py", line
38, in check_dependencies
    if not installed():
  File "C:\Documents and Settings\Sunil\workspace\khan\src\deploy\npm.py", line
13, in installed
    return popen_results(["which", "npm"]).strip()
  File "C:\Documents and Settings\Sunil\workspace\khan\src\deploy\npm.py", line
8, in popen_results
    proc = subprocess.Popen(args, stdout=subprocess.PIPE)
  File "C:\python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "C:\python25\lib\subprocess.py", line 822, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:29:39+00:00Added an answer on May 30, 2026 at 9:29 am

    I agree with martineau, it is unable to find which. The script may have been written with the assumption it was going to be run in a unix environment which would most likely have the “which” command available and in the default PATH. Since it looks like you’re running this on Windows, I don’t think it’s going to work.

    It looks like there is some alternatives to which on Windows though, discussed here: Is there an equivalent to which on Windows?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying run a program from a qmake .pro file which modifies the
I am trying to migrate my existing code to using Enum and I run
Trying to run my program in FreeBSD OS, I have the following results: $
I'm trying to run some reports and having to deal with the whole issue
I am trying to run the code from the following link http://jqueryui.com/demos/dialog/#modal-form Why doesn't
I'm trying to setup ipython.el in emacs23. I've successfully installed it (after putting python-mode.el
I am trying to run an existing old mac os targeted application. When I
I'm trying to run this query: SELECT Destaque.destaque, Noticia.id, Noticia.antetitulo, Noticia.titulo, Noticia.lead, Noticia.legenda, Noticia.publicacao,
am trying to add a file to an existing archive using the following code.
I am modifying an existing app.And there is an issue trying to run ADT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.