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

Pip install fails #41

Closed
julianoes opened this issue Dec 2, 2016 · 5 comments
Closed

Pip install fails #41

julianoes opened this issue Dec 2, 2016 · 5 comments

Comments

@julianoes
Copy link
Contributor

I have no luck installing the package as described in the README:

sudo pip install .
Processing /home/julianoes/src/pymavlink
Requirement already satisfied (use --upgrade to upgrade): future in /usr/lib/python3.5/site-packages (from pymavlink==2.0.9)
Requirement already satisfied (use --upgrade to upgrade): lxml in /usr/lib/python3.5/site-packages (from pymavlink==2.0.9)
Installing collected packages: pymavlink
  Running setup.py install for pymavlink ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-jk12x8xn-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ted1c5dm-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    No XML message definitions found

This happens on Python2 and Python3.
I also tried to install pymavlink as part of mavlink (as a submodule) and saw the same error.

@OXINARF
Copy link
Member

OXINARF commented Dec 3, 2016

It is clear that it hasn't found the XML files. The code is simple:

if os.getenv("MDEF",None) is not None:
        mdef_paths = [os.getenv("MDEF")]
    else:
        mdef_paths = [os.path.join('..', 'message_definitions'),
                      os.path.join('mavlink', 'message_definitions'),
                      os.path.join('..', 'mavlink', 'message_definitions'),
                      os.path.join('message_definitions'),
        ]

So you either have a wrong MDEF env var set or you don't have the files in any of those directories.

@julianoes
Copy link
Contributor Author

@OXINARF thanks for your help, appreciated.

I didn't know about the MDEF env variable but I can see that it should not be necessary to set it for my case because the definitions can be found in ../message_definitions.

I realized that sudo python setup.py install works, however sudo pip install . does not.

@khancyr
Copy link
Contributor

khancyr commented Dec 4, 2016

Yep that a problematic, it is because pip install is excecuted from /tmp not from pymavlink directory. I will works on a patch and I need to finish the readme correctly

@julianoes
Copy link
Contributor Author

julianoes commented Dec 4, 2016

@khancyr yes you're right, it's because it moves to /tmp. Also, I tried to use MDEF but it gets lost by sudo. This finally worked:

sudo MDEF=$HOME/src/mavlink/message_definitions pip install .

or:

sudo MDEF=`pwd`/../message_definitions pip install .

@khancyr khancyr mentioned this issue Jan 5, 2017
@julianoes
Copy link
Contributor Author

Thanks @khancyr, closing.

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