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 7567351
In Process

The Archive Base Latest Questions

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

I am trying to run gphoto2 from python but, with no succes. It just

  • 0

I am trying to run gphoto2 from python but, with no succes. It just returns command not found.
gphoto is installed correctly, as in, the commands work fine in Terminal.

p = subprocess.Popen(['gphoto2'], shell=True, stdout=subprocess.PIPE,
    stderr=subprocess.STDOUT, executable='/bin/bash')

for line in p.stdout.readlines():
    print line
p.wait()

/bin/bash: gphoto2: command not found

I know that there is something funny about the osx Terminal (app) but, my knowledge on osx is meager.

Any thoughts on this one?

EDIT

changed some of my code, other errors appear

p = subprocess.Popen(['gphoto2'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in p.stdout:
    print line


    raise child_exception
OSError: [Errno 2] No such file or directory

EDIT

using full path ‘/opt/local/bin/gphoto2’

but if someone care to explain which shell to use or how to log in and be able to have the same functionality..?

  • 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-30T14:38:42+00:00Added an answer on May 30, 2026 at 2:38 pm

    When using shell = True, the first argument to subprocess.Popen should be a string, not a list:

    p = subprocess.Popen('gphoto2', shell=True, ...)
    

    However, using shell = True should be avoided if possible since it can be a security risk (see the Warning).

    So instead use

    p = subprocess.Popen(['gphoto2'], ...)
    

    (When shell = False, or if the shell parameter is omitted, the first argument should be a list.)

    • 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 batch file from my java codes, but unfortunately I
Im trying to run a shell with cakephp but I'm not able to do
I am trying run a program from a qmake .pro file which modifies the
Trying to run the following command in php to run powershell command... the following
I am trying to run the VS 2008 SP1 installer , but it says
I'm trying to run a batch file, as another user, from my web app.
I'm trying to run a LINQ to SQL query that returns a result in
Trying to run a simple svn list svn+ssh://... from within jenkins on os X,
Trying to run the reportviewer with passing the parameter but receive error: Validation of
Im trying to run this code . Basically I want the https://admin:qwerty123@ '$dmp':7777/set_param?'$params command

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.