jd-boyd/python-lzo

unable to install python-lzo using "pip install python-lzo" on Windows

billykoos opened this issue · 7 comments

I'm unable to install python-lzo using the normal means. It complains of "no distribution found". I am able to use the following:
pip install git+https://github.com/jd-boyd/python-lzo.git

I tried this as well as "pip install https://github.com/jd-boyd/python-lzo/archive/master.zip" and I get an error.

Collecting https://github.com/jd-boyd/python-lzo/archive/master.zip
Downloading https://github.com/jd-boyd/python-lzo/archive/master.zip
- 20kB 660kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "C:\Users\xxxxxx\AppData\Local\Temp\pip-jjoxukoe-build\setup.py", li
ne 25, in
raise Exception("please set LZO_DIR to where the lzo source lives")
Exception: please set LZO_DIR to where the lzo source lives

For windows, you need to place the lzo source code in "c:\src\lzo-1.08". You will also need a C compiler, possibly needing to match the one that your version of python was built with.

I should disclaim that I've never tested the windows install.

Added a note to the readme.

I'm trying to install the package on a Mac using pip install python-lzo but the installation fails with error:

zomodule.c:35:10: fatal error: 'lzo1x.h' file not found
    #include <lzo1x.h>
             ^
    1 error generated.
    error: command 'clang' failed with exit status 1

This should go in a new issue. Please try to include some additional information such as what version of OSX you are using as well as what version of XCode you have installed or if not XCode where you are getting clang and what version you have.

I had the same problem. The issue is the include files end up in /usr/local/include instead of /usr/include. I was able to get it to work by modifying setup.py:

diff --git a/setup.py b/setup.py
index 732a0ae..55f5623 100644
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,7 @@ if sys.platform == "win32":
 else:
     libraries = ["lzo2"]
     include_dirs.append("/usr/include/lzo")
+    include_dirs.append("/usr/local/include/lzo")
     ##library_dirs.append("/usr/local/lib")
     ##runtime_library_dirs.append("/usr/local/lib")

The issue is the include files end up in /usr/local/include instead of /usr/include.

That is dependent on how lzo2 was installed on your mac in the first place. Also, this is still not the appropriate issue to continue discussing this.