I am trying to install adns-python using linux and had to recompile adns with some special options, so I can't seem to use easy_install <tarball> as I normally would
(py26_default)[mpenning#localhost src]$ easy_install adns-python-1.2.1.tar.gz
Processing adns-python-1.2.1.tar.gz
Running adns-python-1.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-9cVl4i/adns-python-1.2.1/egg-dist-tmp-vvO8Ms
adnsmodule.c:10:18: error: adns.h: No such file or directory
adnsmodule.c:31: error: expected specifier-qualifier-list before âadns_stateâ
adns.h is installed under /opt/adns/include/adns.h; how can I make easy_install install with a local installation of adns?
EDIT
After the attempt below, I still find an ld error, even though I exported LD_LIBRARY_PATH...
(py26_default)[mpenning#localhost src]$ ls /opt/adns/lib/
libadns.a libadns.so libadns.so.1 libadns.so.1.2
(py26_default)[mpenning#localhost src]$ export LD_LIBRARY_PATH=/opt/adns/lib
(py26_default)[mpenning#localhost src]$ C_INCLUDE_PATH=/opt/adns/include easy_install ./adns-python-1.2.1.tar.gz
Processing adns-python-1.2.1.tar.gz
Running adns-python-1.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-x68T9f/adns-python-1.2.1/egg-dist-tmp-MpCzMP
/usr/bin/ld: cannot find -ladns
collect2: ld returned 1 exit status
error: Setup script exited with error: command 'gcc' failed with exit status 1
(py26_default)[mpenning#localhost src]$
LD_LIBRARY_PATH is used to find a shared library at runtime (when an executable is run), not during linking.
To build the extension, unpack the tarball and run:
python setup.py build_ext -I/opt/adns/include -L/opt/adns/lib -R/opt/adns/lib
To install:
python setup.py install
You could specify build_ext options in setup.cfg:
[build_ext]
include_dirs=/opt/adns/include
library_dirs=/opt/adns/lib
rpath=/opt/adns/lib
in this case you could run easy_install directly.
Please try like this
INCLUDE_PATH=/opt/adns/include easy_install adns-python-1.2.1.tar.gz
if it is not working please try with CPLUS_INCLUDE_PATH or C_INCLUDE_PATH
Related
I'm trying to install a python package using easy_install but it keeps saying that a file is missing. I have tried 'sudo apt-get install python2.7-dev'
I'm on xubuntu.
sudo easy_install autopy
Searching for autopy
Reading https://pypi.python.org/simple/autopy/
Best match: autopy 0.51
Downloading https://pypi.python.org/packages/source/a/autopy/autopy-0.51.tar.gz#md5=b92055aa2a3712a9c3b4c874014b450e
Processing autopy-0.51.tar.gz
Writing /tmp/easy_install-lFRYYC/autopy-0.51/setup.cfg
Running autopy-0.51/setup.py -q bdist_egg --dist-dir /tmp/easy_install-lFRYYC/autopy-0.51/egg-dist-tmp-WC7CUY
src/snprintf.c: In function ‘portable_vsnprintf’:
src/snprintf.c:569:19: warning: variable ‘starting_p’ set but not used [-Wunused-but-set-variable]
const char *starting_p;
^
src/png_io.c:3:17: fatal error: png.h: No such file or directory
#include <png.h>
^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
In my dev environment, due to some networking problems, when I run:
(my-virt-env)$ pip install lxml
It always fails due to:
Downloading/unpacking lxml
Downloading lxml-3.1.2.tar.gz (3.3Mb): 1.2Mb downloaded
Exception:
Traceback (most recent call last):
blablabla
error: [Errno 104] Connection reset by peer
Then I downloaded lxml-3.1.2.tar.gz from somewhere else and used an usb key to copy it over. Is there anyway I can tell pip not bother to go to the Internet for this package, just install it via the local tar.gz? So I can do something like:
(my-virt-env)$ pip install ${local_path}/lxml*.tar.gz
tried this command, I get very long error message:
pip install /home/shengjie/Downloads/lxml-3.1.2.tar.gz
Unpacking /home/shengjie/Downloads/lxml-3.1.2.tar.gz
Running setup.py egg_info for package from file:///home/shengjie/Downloads/lxml-3.1.2.tar.gz
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.1.2.
Building without Cython.
ERROR: /bin/sh: 1: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
......................
bla bla bla
......................
/tmp/pip-Vg13dM-build/src/lxml/includes/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
I am running Ubuntu, I know you can run `apt-get install python-lxml` and get it installed on your box. But that doesn't work for my case as I want install it in my virtual env: `my-virt-env`.
You can do it, the command is:
pip install --no-index --find-links=file:///[absolute path to your tar.gz]
What I'm seeing is that it's complaining that the DEV version of libxml2 and libxslt are missing.
Do an apt-get installation of those 2 packages, libxml2-dev and libxslt-dev, and perform your pip installation again and see how that goes.
I am using Active Python 2.5.1, Mercurial 1.8.1 and TortoiseHg 1.1.0
on Windows XP (all x86)
I am trying to configure a mercurial repo in reviewboard. For that it
requires mercurial python module
So when i try to install mercurial via easy_install i get the
following error
C:\>easy_install mercurial==1.8.1
Searching for mercurial==1.8.1
Reading http://pypi.python.org/simple/mercurial/
Reading http://mercurial.selenic.com/
Reading http://www.selenic.com/mercurial
Reading http://mercurial.selenic.com/release/
Best match: mercurial 1.8.1
Downloading http://mercurial.selenic.com/release/mercurial-1.8.1.tar.gz
Processing mercurial-1.8.1.tar.gz
Running mercurial-1.8.1\setup.py -q bdist_egg --dist-dir c:
\docume~1\username\locals~1\temp\easy_install-7l0ykf
\mercurial-1.8.1\egg-dist-tmp-egcnt6
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: Setup script exited with error: command 'gcc' failed with exit
status 1
I have installed gcc through MinGW
Thanks shu zOMG chen, 1.8.1 is a requirement so can't really change that.The second link did help, but now there's another problem. After removing -mno-cygwin occurences from distutils\cygwinccompiler.py I ran easy_install mercurial==1.8.1. The trace is as folows :
C:\>easy_install mercurial==1.8.1
Searching for mercurial==1.8.1
Reading http://pypi.python.org/simple/mercurial/
Reading http://mercurial.selenic.com/
Reading http://www.selenic.com/mercurial
Reading http://mercurial.selenic.com/release/
Best match: mercurial 1.8.1
Downloading http://mercurial.selenic.com/release/mercurial-1.8.1.tar.gz
Processing mercurial-1.8.1.tar.gz
Running mercurial-1.8.1\setup.py -q bdist_egg --dist-dir c:\docume~1\username\locals~1\temp\easy_install-05el_6\mercurial-1.8.1\egg-dist-tmp-zsfye0
gcc: error: CreateProcess: No such file or directory
error: Setup script exited with error: command 'gcc' failed with exit status 1
C:\>
Please Help
Regards
From your output it appears that easy_install is trying to build mercurial with an option that requires some cygwin parts. If you're using mingw gcc you might want to look at https://www.mercurial-scm.org/wiki/BuildingOnWindows for instuctions on how to build in windows.
Is there a reason you're using 1.8.1? The latest version is 2.1.2.
Googling around, Compiling with cython and mingw produces gcc: error: unrecognized command line option '-mno-cygwin' might help you with this too.
There are also exe and msi installers for Windows at https://www.mercurial-scm.org/downloads.
In my opinion, the TortoiseXXX changes the mental picture of what is behind the wrapper. It was difficult for me to explain to my colleague how to work with CVS correctly when TortoiseCVS was used.
Off topic: For your own other purpose, try also Git instead (http://git-scm.com/) The idea is very similar. I guess the Git is going to win statistically.
The msysgit (Windows) is nice, the functionality is comparable with the original Linux one, the included Git Gui and gitk may have rather strange look (Tcl/Tk), but they are very good for the basic Git operations.
I have tried to install ShoutPY (http://dingoskidneys.com/shoutpy/) under python 2.7 x86 on windows but install fails with:
C:\Python27\Scripts>easy_install shoutpy
Searching for shoutpy
Reading http://pypi.python.org/simple/shoutpy/
Reading http://dingoskidneys.com/shoutpy/
Best match: shoutpy 1.0.0
Downloading http://dingoskidneys.com/shoutpy/shoutpy-1.0.0.tar.gz
Processing shoutpy-1.0.0.tar.gz
Writing c:\users\vladim~1\appdata\local\temp\easy_install-pnwegl\shoutpy-1.0.0\s
etup.cfg
Running shoutpy-1.0.0\setup.py -q bdist_egg --dist-dir c:\users\vladim~1\appdata
\local\temp\easy_install-pnwegl\shoutpy-1.0.0\egg-dist-tmp-otdtxq
shoutpy.cc:26:28: fatal error: boost/python.hpp: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
What I figured out is that I am missing Boost.python. Tried to find how to install it but failed, could anyone help me out?
thanks.
I'm guessing you're not running this under Cygwin, so you have a couple challenges. Did you install gcc? It's required by your install. You'll also need Boost installed and as Bart said in the comments, the best thing to do is to check out their build/install documentation.
pycurl installs fine on python2.6 but i get the following error when I try to install in on 2.7 via easy_install on maverick
$ sudo easy_install pycurl
install_dir /usr/local/lib/python2.7/dist-packages/
Searching for pycurl
Reading http://pypi.python.org/simple/pycurl/
Reading http://pycurl.sourceforge.net/
Reading http://pycurl.sourceforge.net/download/
Best match: pycurl 7.19.0
Downloading http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
Processing pycurl-7.19.0.tar.gz
Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-PFzxzf/pycurl-7.19.0/egg-dist-tmp-oAFjdV
Using curl-config (libcurl 7.21.0)
src/pycurl.c:42: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
Is 2.7 not compatible with pycurl?
sudo apt-get install python-dev
This installs the Python development package that is required and fixes the problem of the missing header file.
(Please read the comment by Corey)