Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Error #1

Closed
BrownKyle opened this issue Jun 22, 2015 · 9 comments
Closed

Import Error #1

BrownKyle opened this issue Jun 22, 2015 · 9 comments

Comments

@BrownKyle
Copy link

I'm trying to test you simulator, in vagrant. After following your instructions I am unable to run api start PrecisionLand.py it gets an error importing the files from the Common folder.

api start PrecisionLand.py
GUIDED> Exception in APIThread-4: No module named Common
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/droneapi/module/api.py", line 325, in run
    self.fn()
  File "/usr/local/lib/python2.7/dist-packages/droneapi/module/api.py", line 605, in <lambda>
    APIThread(self, lambda: execfile(args[1], g), args[1])
  File "PrecisionLand.py", line 9, in <module>
    from Common import VN_config
ImportError: No module named Common
@djnugent
Copy link
Owner

This is problem with your PATH variable. I just updated the readme.md with the appropriate export statements. Try those and report back

@BrownKyle
Copy link
Author

I'm still getting the same error, would I have to make these available to /ardupilot/ArduCopter as that is where they are run from and not /home/ ?

@djnugent
Copy link
Owner

run echo $PATH and echo $PYTHONPATH and let me know what you get

@BrownKyle
Copy link
Author

Hey,

I get this:
vagrant@vagrant-ubuntu-trusty-32:~$ echo $PATH
/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vagrant/src/jsbsim/src:/home/vagrant/src/ardupilot/Tools/autotest:/home/vagrant/ardupilot/Tools/autotest:/home/vagrant/visnav:/home/vagrant/visnav/Common:/home/vagrant/visnav/PrecisionLand_lib

vagrant@vagrant-ubuntu-trusty-32:~$ echo $PYTHONPATH
:/home/vagrant/visnav/PrecisionLand_lib

When I run those commands from /home/vagrant/ and the same reply when I run
it from /ardupilot/ArduCopter/ which seems to suggest it should find the
files.

Regards
Kyle
On 23 Jun 2015 12:06 am, "Daniel Nugent" notifications@github.com wrote:

run echo $PATH' andecho $PYTHONPATH` and let me know what you get


Reply to this email directly or view it on GitHub
#1 (comment).

@djnugent
Copy link
Owner

Your PYHONPATH does not match the export statements in the README. Make them match and try again. I have also never run my code on vagrant so I am not sure how it will behave.

@BrownKyle
Copy link
Author

BrownKyle commented Jun 23, 2015 via email

@djnugent
Copy link
Owner

That sounds like a linux issue. I am not sure why that is happening.

@adrianhsm
Copy link

should export PYTHONPATH=$PYHTONPATH:$HOME/visnav/PrecisionLand_lib be changed to
export PYTHONPATH=$PYTHONPATH:$HOME/visnav/PrecisionLand_lib,that is PYHTONPATH to PYTHONPATH

@djnugent
Copy link
Owner

@adrianhsm Good eye! I will put that in my next commit. Thanks

@djnugent djnugent closed this as completed Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants