{"action":"created","issue":{"url":"https://api.github.com/repos/ArduPilot/pymavlink/issues/68","repository_url":"https://api.github.com/repos/ArduPilot/pymavlink","labels_url":"https://api.github.com/repos/ArduPilot/pymavlink/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/ArduPilot/pymavlink/issues/68/comments","events_url":"https://api.github.com/repos/ArduPilot/pymavlink/issues/68/events","html_url":"https://github.com/ArduPilot/pymavlink/issues/68","id":220417466,"number":68,"title":"Installing pymavlink on Ubuntu 16.04 fails","user":{"login":"ufechner7","id":4235229,"avatar_url":"https://avatars1.githubusercontent.com/u/4235229?v=3","gravatar_id":"","url":"https://api.github.com/users/ufechner7","html_url":"https://github.com/ufechner7","followers_url":"https://api.github.com/users/ufechner7/followers","following_url":"https://api.github.com/users/ufechner7/following{/other_user}","gists_url":"https://api.github.com/users/ufechner7/gists{/gist_id}","starred_url":"https://api.github.com/users/ufechner7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufechner7/subscriptions","organizations_url":"https://api.github.com/users/ufechner7/orgs","repos_url":"https://api.github.com/users/ufechner7/repos","events_url":"https://api.github.com/users/ufechner7/events{/privacy}","received_events_url":"https://api.github.com/users/ufechner7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-08T18:18:41Z","updated_at":"2017-04-09T09:42:42Z","closed_at":null,"body":"I tried to install pymavlink with pip:\r\nsudo pip2 install -U pymavlink\r\nNo error message.\r\nTrying to import mavutil \r\nimport mavutil\r\nfirst gives the error message \"module not found\"\r\nIf I add the following line to my .bashrc file:\r\n```\r\nexport PYTHONPATH=\"${PYTHONPATH}:/usr/local/lib/python2.7/dist-packages/pymavlink\"\r\n```\r\nand try to import mavutil I get a different error message:\r\n\r\n```\r\nIn [1]: import mavutil\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-1-062bfe057715> in <module>()\r\n----> 1 import mavutil\r\n\r\n/usr/local/lib/python2.7/dist-packages/pymavlink/mavutil.py in <module>()\r\n    105 \r\n    106 # Set the default dialect. This is done here as it needs to be after the function declaration\r\n--> 107 set_dialect(os.environ['MAVLINK_DIALECT'])\r\n    108 \r\n    109 class mavfile(object):\r\n\r\n/usr/local/lib/python2.7/dist-packages/pymavlink/mavutil.py in set_dialect(dialect)\r\n     80     '''\r\n     81     global mavlink, current_dialect\r\n---> 82     from .generator import mavparse\r\n     83     if 'MAVLINK20' in os.environ:\r\n     84         wire_protocol = mavparse.PROTOCOL_2_0\r\n\r\nValueError: Attempted relative import in non-package\r\n```\r\nAny idea?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ArduPilot/pymavlink/issues/comments/292775415","html_url":"https://github.com/ArduPilot/pymavlink/issues/68#issuecomment-292775415","issue_url":"https://api.github.com/repos/ArduPilot/pymavlink/issues/68","id":292775415,"user":{"login":"ufechner7","id":4235229,"avatar_url":"https://avatars1.githubusercontent.com/u/4235229?v=3","gravatar_id":"","url":"https://api.github.com/users/ufechner7","html_url":"https://github.com/ufechner7","followers_url":"https://api.github.com/users/ufechner7/followers","following_url":"https://api.github.com/users/ufechner7/following{/other_user}","gists_url":"https://api.github.com/users/ufechner7/gists{/gist_id}","starred_url":"https://api.github.com/users/ufechner7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufechner7/subscriptions","organizations_url":"https://api.github.com/users/ufechner7/orgs","repos_url":"https://api.github.com/users/ufechner7/repos","events_url":"https://api.github.com/users/ufechner7/events{/privacy}","received_events_url":"https://api.github.com/users/ufechner7/received_events","type":"User","site_admin":false},"created_at":"2017-04-09T09:42:42Z","updated_at":"2017-04-09T09:42:42Z","body":"Ok, I got a step further:\r\n```\r\nI installed pymavlink with the following commands:\r\n\r\nsudo apt-get install libxml2-dev libxslt-dev python-dev\r\nsudo pip2 install -U future lxml\r\nsudo pip2 install -U pymavlink\r\n\r\nI added the following line to .bashrc:\r\nexport PYTHONPATH=\"${PYTHONPATH}:/usr/local/lib/python2.7/dist-packages/pymavlink\"\r\n\r\nThis works:\r\nfrom pymavlink import mavutil\r\n\r\ncd /usr/local/lib/python2.7/dist-packages/pymavlink\r\nsudo mavgen.py -o mavlinkv10.py message_definitions/v1.0/common.xml\r\n\r\njoe mavlinkv10.py\r\n--> in line 13, replace ... with .\r\n--> save\r\n\r\nfrom pymavlink import mavlinkv10 as mavlink\r\n\r\nis working now.\r\n```\r\nIs this complicated way that includes manual editing of mavlinv10.py the intended way to use this software?"}}
{"actor":{"display_login":"ufechner7"}}