Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding a few words about how to install via pip #37

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

Merged
merged 2 commits into from
Dec 2, 2015

Conversation

pdelsante
Copy link
Contributor

I'm adding a few words about how to install the package from pip.

I'm also fixing the imports in the examples; at least when installed from pip, import user_agent_parser won't work, you will need something like from ua_parser import user_agent_parser.

### Install via pip
First, check that you've got the correct dependencies. For example, on Ubuntu:
```
$ apt-get install libyaml libyaml-dev python-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't required for pyyaml. They're just optional, so it's not correct to declare these as dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, but I can confirm that imports will fail if you install via pip without prior installing these (see #14 (comment))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is completely untrue. I just verified with our latest release that it works just fine without libyaml or python-dev.

Can you provide me with some steps to reproduce?

This was with:

  • pip 7.1.2
  • python 2.7.9
  • ua-parser 0.5.1

on Debian Jessie.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear with what I did, I booted a new Debian docker container and ran:

root@f703d39fc6f7:/# apt-get update && apt-get install -y curl python
root@f703d39fc6f7:/# curl -s https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python
root@f703d39fc6f7:/# pip install ua-parser

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And lastly, looking at how we use pyyaml, we don't even attempt to use the c bindings from libyaml anyways.

If we did, we'd have to explicitly do something like, yaml.load(..., Loader=CSafeLoader)

pyyaml doesn't detect the libyaml bindings automatically, unfortunately. :(

@mattrobenolt
Copy link
Member

Thanks @pdelsante, if you update the pip installation directions, I'll merge. The import fixes are correct though.

@mattrobenolt
Copy link
Member

Looks good. :) Thanks for the contribution. 🍰 🍨

mattrobenolt added a commit that referenced this pull request Dec 2, 2015
Adding a few words about how to install via pip
@mattrobenolt mattrobenolt merged commit dcb4085 into ua-parser:master Dec 2, 2015
@pdelsante pdelsante deleted the fix-doc branch December 2, 2015 21:06
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

Successfully merging this pull request may close these issues.

2 participants