Import command not working

asked 2016-06-01 05:59:18 -0500

nithin73 gravatar image

updated 2016-06-01 06:02:28 -0500

gvdhoorn gravatar image

This is the first part of my code:

#!/usr/bin/env python

import os
import sys
import signal
import rospy
import time

Even then I got the error saying that:

line 1:#!/usr/bin/env: no such file or directory
line 3: import command not found

how ever it is working normally when I run with Python Before running it I even did this

source ~/catkin_ws/devel/setup.bash
edit retag flag offensive close merge delete


Please format code and console output with the Preformatted Text button next time (it's the one with 101010 on it). Otherwise your code is unreadable / invisible.


gvdhoorn gravatar image gvdhoorn  ( 2016-06-01 06:03:31 -0500 )edit

What is the output of /usr/bin/env python, when you run that line in a terminal?

gvdhoorn gravatar image gvdhoorn  ( 2016-06-01 06:04:38 -0500 )edit

python 2.7.9

nithin73 gravatar image nithin73  ( 2016-06-01 07:01:26 -0500 )edit