Ask Your Question
0

"ImportError: No module named ..." $PYTHONPATH problem with ansible?

asked 2019-05-24 17:18:07 -0500

mbfg gravatar image

updated 2019-05-25 15:47:20 -0500

I'm trying to get a piece of research software from github up and running on a lab computer for my professor. Flydra is a multi-camera tracking system used to detect multiple airborne insects or small animals. The required OS for Flydra is Ubuntu 16.04, which I haven't frequently used before but am semi-competent with. For instance, I was able to fix the low resolution problem by manually installing the Nvidia driver, and another failed-login issue upon startup from the grub menu. Flydra is installed using the ansible tool, something that I am completely unfamiliar with how it works. Below is the entire setup process I've gone through for Flydra, as I am not sure what step or how the issue is caused with the $PYTHONPATH.

----------------------------------------------------------------------------------

  • The following commands use ansible to download the code from github, and gives the following output.
  1. 'sudo apt-get install git ansible'
  2. 'cd ~/'
  3. 'git clone https://github.com/strawlab/strawlab-...
  4. 'cd strawlab-ansible-roles/'
  5. 'sudo ansible-playbook -i "localhost," -c local playbook.yml'

*Note in order for the ansible package to install correctly and avoid a localhost not found error, I had to reenable the security update settings in System Settings -> Software & Updates -> Updates -> Install updates from -> Important security updates, Recommended updates, Unsupported updates.


PLAY *************************

TASK [setup] ********************* ok: [localhost]

TASK [ros-kinetic : get ROS apt signing key] *********** ok: [localhost]

TASK [ros-kinetic : use ROS Ubuntu repository] *********** ok: [localhost]

TASK [ros-kinetic : use ROS Ubuntu source repository] ******** ok: [localhost]

TASK [ros-kinetic : install ROS kinetic packages] ********** ok: [localhost]

TASK [strawlab-public-debs : get strawlab apt signing key] ******* ok: [localhost]

TASK [strawlab-public-debs : get strawlab public apt repo] ******* ok: [localhost]

TASK [ros-kinetic-freemovr-engine : Ensure rosdep sources dir exists] ** ok: [localhost]

TASK [ros-kinetic-freemovr-engine : Ensure strawlab rosdep URL is included into rosdep sources] * ok: [localhost]

TASK [ros-kinetic-freemovr-engine : Ensure freemovr-engine-kinetic.rosinstall is available] * ok: [localhost]

TASK [ros-kinetic-freemovr-engine : install sudo command] ****** ok: [localhost]

TASK [ros-kinetic-freemovr-engine : install wstool command] ****** ok: [localhost]

TASK [ros-kinetic-freemovr-engine : Ensure workspace installer dir exists] * ok: [localhost]

TASK [ros-kinetic-freemovr-engine : copy installer script] ******* ok: [localhost]

TASK [ros-kinetic-freemovr-engine : apt] ************* ok: [localhost]

TASK [ros-kinetic-freemovr-engine : apt] ************* ok: [localhost]

TASK [ros-kinetic-freemovr-engine : apt] ************* ok: [localhost]

TASK [ros-kinetic-freemovr-engine : apt] ************* ok: [localhost]

TASK [ros-kinetic-freemovr-engine : apt] ************* ok: [localhost]

TASK [ros-kinetic-freemovr-engine : apt] ************* ok: [localhost]

TASK [ros-kinetic-freemovr-engine : apt] ************* ok: [localhost]

TASK [ros-kinetic-flydra : install flydra package] ********* ok: [localhost]

TASK [ros-kinetic-flydra : Ensure rosdep sources dir exists] ***** ok: [localhost]

TASK [ros-kinetic-flydra : Ensure strawlab rosdep URL is included into rosdep sources] * ok: [localhost]

TASK [ros-kinetic-flydra : Ensure flydra-kinetic.rosinstall is available] ** ok: [localhost]

TASK [ros-kinetic-flydra : install sudo command] ********* ok: [localhost]

TASK [ros-kinetic-flydra : install wstool command] ********* ok: [localhost]

TASK [ros-kinetic-flydra : install rosinstall command] ******* ok: [localhost]

TASK [ros-kinetic-flydra : Ensure workspace installer dir exists] **** ok: [localhost]

TASK [ros-kinetic-flydra : copy installer script] ********** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-flydra : apt] **************** ok: [localhost]

TASK [ros-kinetic-freemovr : put "vr" function into bashrc] ****** ok: [localhost]

TASK [ros-kinetic-freemovr : Ensure freemovr-kinetic.rosinstall is available] ** ok: [localhost ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-05-24 21:42:01 -0500

ahendrix gravatar image

The trouble you're having is that sudo doesn't forward the environment variables that are used by ROS. I suggest you try to run this program as your user instead.

All of the environment variable setup should happen automatically when you source the setup.bash for your catkin workspace. In this case, it looks like that's done by running source ~/ros/flydra-kinetic/devel/setup.bash

I took a brief look at flydra's github page, but I wasn't able to find the directions that you're following, so I'm not sure what the original intent of them was. If you can provide a link to the instructions that you're following, that would help me and anyone else reading this question understand what is supposed to be happening and maybe help you along.

edit flag offensive delete link more

Comments

The instructions for flydra installation are linked on the main page under "Installation" with a link called 'our Ansible playbooks'. The link leads to https://github.com/strawlab/strawlab-... . My instructions are slightly modified but essentially the same as what is shown on their page. I thought it would be important to describe the installation process for replication purposes, or clues to what could be causing the problem.

I think you are onto something with the sudo suggestion. Running 'python camnode' doesn't throw the same ImportError, which atleast implies that the sudo was causing problems. I'll continue to investigate and see if that fixes the problem fully.

mbfg gravatar imagembfg ( 2019-05-25 15:40:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-05-24 17:17:04 -0500

Seen: 152 times

Last updated: May 25