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

Using pip install -r requirements.txt does not install lxml #151

Closed
ei8fdb opened this issue Sep 1, 2013 · 5 comments
Closed

Using pip install -r requirements.txt does not install lxml #151

ei8fdb opened this issue Sep 1, 2013 · 5 comments

Comments

@ei8fdb
Copy link

ei8fdb commented Sep 1, 2013

Hi!

[I may be presuming something incorrectly, but here goes...]

I cloned the repo and followed the pip install step from the readme, "pip install -r requirements.txt", to install the python requirements. It finished successfully.

I then tried to run mailpile using: Mailpile$ ./mp --set "my_from: name@domain.tld = MyName" --setup, and got:

Traceback (most recent call last):
File "./mp", line 7, in
from mailpile.app import Main
File "./mailpile/init.py", line 3, in
import mailpile.app
File "./mailpile/app.py", line 37, in
import lxml.html
ImportError: No module named lxml.html

I presume pip install was supposed to install python-lxml? Looking through requirements.txt shows:

$ cat requirements.txt
lxml==2.3.2
http://sourceforge.net/projects/py-gnupg/files/GnuPGInterface/0.3.2/GnuPGInterface-0.3.2.tar.gz

To fix this I installed it with apt-get install python-lxml.

Should lxml be defined differently in the requirements.txt file?

If so it should be changed, OR if pip install does NOT install lxml, then it should be stated clearly that you have to install it seperately, as the current wording gives the impression that pip install takes care of it.

Thanks.

@ulikoehler
Copy link
Contributor

lxml is a native library, so you need at least build-essential and libxml2-dev (not sure about exact package names, so don't quote me on this). apt-get install python-lxml does not need those, because it's pre-built.

So I suspect pip tried to install lxml (it works provided you have the correct deps installed, see make virtualenv ) but it failed due to being unable to compile the native library.

Could you please check if that's the case or post the output of pip install -r requirements.txt here?

@tdi
Copy link

tdi commented Oct 16, 2013

@bernardATdiymut Just install libxml2-dev and then pip install lxml. pip freeze command will verify whether it is installed.

@ghost ghost assigned bnvk and BjarniRunar Oct 27, 2013
@BjarniRunar BjarniRunar removed their assignment Apr 26, 2014
@bnvk
Copy link
Contributor

bnvk commented Oct 10, 2014

I'm experiencing this issue still on a fresh install of Ubuntu 14.04

@bnvk bnvk added this to the 1.0 Release milestone Oct 10, 2014
@ulikoehler
Copy link
Contributor

@brennannovak I don't think this is really solvable by using python packaging.
The only way I can think of doing so is executing something link gksu apt-get install libxml2-dev. I don't think anything in Mailpile should be done this way. Users should IMO never have to enter their admin password after starting mailpile.

I think the easiest way of solving this is building a deb-package (I added some code for this last year, but it probably doesn't work any more) and adding a python-lxml dependency (if not already present).

@BjarniRunar
Copy link
Member

Agree with Uli. Ultimately, cloning from github is a developer exercise, and developers have to be able to deal with dependencies and tricky builds at times. The only solution we have to this problem is to stop using lxml, which we can't do in the near term.

Closing this, the issue will be addressed via. packaging. But thanks much for reporting & discussing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants