Since python allows you to use either single or double quotes, if your string contains double quotes then use single quotes. os.system(' LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i "input_file.so -f /home/pi/stream -n pic.jpg" -o "output_http.so -w /usr/local/www" ') Thanks brother, you da man