I am trying to install GEOS for Django project and following Docs but while compiling on Ubuntu 16.04 Xenial I get this error. There was some fix for it here but it also didn't worked. Following is the error I get while I ran "make" as per official Django docs.
Error:
gdalserver.c: In function 'CreateSocketAndBindAndListen':
gdalserver.c:125:21: error: storage size of 'sHints' isn't known
struct addrinfo sHints;
^
gdalserver.c:127:31: error: invalid application of 'sizeof' to incomplete type 'struct addrinfo'
memset(&sHints, 0, sizeof(struct addrinfo));
^
gdalserver.c:130:23: error: 'AI_PASSIVE' undeclared (first use in this function)
sHints.ai_flags = AI_PASSIVE;
^
gdalserver.c:130:23: note: each undeclared identifier is reported only once for each function it appears in
gdalserver.c:133:12: warning: implicit declaration of function 'getaddrinfo' [-Wimplicit-function-declaration]
nRet = getaddrinfo(NULL, pszService, &sHints, &psResults);
^
gdalserver.c:136:48: warning: implicit declaration of function 'gai_strerror' [-Wimplicit-function-declaration]
fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(nRet));
^
gdalserver.c:136:25: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Wformat=]
fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(nRet));
^
gdalserver.c:142:39: error: dereferencing pointer to incomplete type 'struct addrinfo'
psResultsIter = psResultsIter->ai_next)
^
gdalserver.c:163:5: warning: implicit declaration of function 'freeaddrinfo' [-Wimplicit-function-declaration]
freeaddrinfo(psResults);
^
gdalserver.c:125:21: warning: unused variable 'sHints' [-Wunused-variable]
struct addrinfo sHints;
^
../GDALmake.opt:565: recipe for target 'gdalserver.lo' failed
make[1]: *** [gdalserver.lo] Error 1
make[1]: Leaving directory '/home/osboxes/gdal-1.11.2/apps'
GNUmakefile:69: recipe for target 'apps-target' failed
make: *** [apps-target] Error 2
Try version GDAL 2.2.2. The version you are trying is not maintained. Also try to upgrade all the version of software you are using. There is a reason for patches and upgrades so keep always updated versions.
Related
I'm new to RedHat but have been using Ubuntu for a while. I'm trying to install rpy2 using pip install rpy2 and I get the error
/usr/include/features.h:164:1: warning: this is the location of the previous definition
./rpy/rinterface/_rinterface.c:86:31: error: readline/readline.h: No such file or directory
In file included from ./rpy/rinterface/_rinterface.c:122:
./rpy/rinterface/embeddedr.c: In function ‘SexpObject_CObject_destroy’:
./rpy/rinterface/embeddedr.c:68: warning: implicit declaration of function ‘PyCapsule_GetPointer’
./rpy/rinterface/embeddedr.c:69: warning: cast to pointer from integer of different size
./rpy/rinterface/embeddedr.c: In function ‘Rpy_PreserveObject’:
./rpy/rinterface/embeddedr.c:107: warning: implicit declaration of function ‘PyCapsule_New’
./rpy/rinterface/embeddedr.c:109: warning: assignment makes pointer from integer without a cast
./rpy/rinterface/embeddedr.c:122: warning: cast to pointer from integer of different size
./rpy/rinterface/embeddedr.c: In function ‘Rpy_ReleaseObject’:
./rpy/rinterface/embeddedr.c:178: warning: cast to pointer from integer of different size
./rpy/rinterface/embeddedr.c: In function ‘Rpy_ProtectedIDs’:
./rpy/rinterface/embeddedr.c:301: warning: cast to pointer from integer of different size
In file included from ./rpy/rinterface/_rinterface.c:125:
./rpy/rinterface/sexp.c: In function ‘Sexp_sexp_set’:
./rpy/rinterface/sexp.c:282: warning: implicit declaration of function ‘PyCapsule_CheckExact’
./rpy/rinterface/sexp.c:288: warning: cast to pointer from integer of different size
./rpy/rinterface/sexp.c: In function ‘Sexp_init’:
./rpy/rinterface/sexp.c:738: warning: unused variable ‘copy’
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_init’:
./rpy/rinterface/_rinterface.c:1333: error: ‘rl_completer_word_break_characters’ undeclared (first use in this function)
./rpy/rinterface/_rinterface.c:1333: error: (Each undeclared identifier is reported only once
./rpy/rinterface/_rinterface.c:1333: error: for each function it appears in.)
./rpy/rinterface/_rinterface.c:1336: error: ‘rl_basic_word_break_characters’ undeclared (first use in this function)
./rpy/rinterface/_rinterface.c: In function ‘init_rinterface’:
./rpy/rinterface/_rinterface.c:3688: warning: assignment makes pointer from integer without a cast
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/rpy2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BynTYR-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/rpy2
Storing complete log in /root/.pip/pip.log
I know that I need something called adns as mentioned elsewhere, but can't figure out how to install in on RedHat. I tried downloading it and installing from file but that didn't work.
You need to sudo yum install readline-devel to get the readline header files needed to build.
I am getting gcc failed error while installing ngch : https://github.com/seandavi/ngCGH
it gives same error while easy_install as well and I am using windows.
Running pysam-0.7.4\setup.py -q bdist_egg --dist-dir c:\users\sam\appdata\lo
cal\temp\easy_install-ilqggk\pysam-0.7.4\egg-dist-tmp-rolwff
In file included from pysam\csamtools.c:241:
samtools/razf.h:38:18: error: zlib.h: No such file or directory
In file included from pysam\csamtools.c:241:
samtools/razf.h:91: error: expected specifier-qualifier-list before 'z_stream'
pysam\csamtools.c: In function '__pyx_pf_9csamtools_7Samfile_10fetch':
pysam\csamtools.c:9814: warning: passing argument 7 of 'bam_fetch' from incompatible
pointer type
pysam\csamtools.c: In function '__pyx_pf_9csamtools_7Samfile_11mate':
pysam\csamtools.c:10254: warning: passing argument 7 of 'bam_fetch' from incompa
tible pointer type
pysam\csamtools.c: In function '__pyx_pf_9csamtools_7Samfile_12count':
pysam\csamtools.c:10730: warning: passing argument 7 of 'bam_fetch' from incompa
tible pointer type
pysam\csamtools.c: In function '__pyx_pf_9csamtools_7Samfile_13pileup':
pysam\csamtools.c:11148: warning: passing argument 7 of 'bam_fetch' from incompa
tible pointer type
pysam\csamtools.c: In function '__pyx_f_9csamtools___advance_snpcalls':
pysam\csamtools.c:17424: warning: implicit declaration of function 'bam_prob_rea
ln'
pysam\csamtools.c:17452: warning: implicit declaration of function 'bam_cap_mapQ
'
pysam\csamtools.c: In function '__pyx_pf_9csamtools_20IteratorColumnRegion_1__ne
xt__':
pysam\csamtools.c:18907: warning: passing argument 1 of '__pyx_f_9csamtools_make
PileupProxy' from incompatible pointer type
pysam\csamtools.c: In function '__pyx_pf_9csamtools_21IteratorColumnAllRefs_1__n
ext__':
pysam\csamtools.c:19134: warning: passing argument 1 of '__pyx_f_9csamtools_make
PileupProxy' from incompatible pointer type
pysam\csamtools.c: In function '__Pyx_InitGlobals':
pysam\csamtools.c:38587: warning: this decimal constant is unsigned only in ISO
C90
error: Setup script exited with error: command 'gcc' failed with exit status 1
can anyone let me know how can I get over this error?
It's most likely pysam that fails to compile due to missing zlib-dev. Try installing it before ie in Ubuntu I did:
sudo apt-get install zlib1g-dev
for fedora you can try:
yum install zlib-devel
I don't know about windows though...
Hey I have looked at and old question here but it doesn't answer my question
I have installed libpng, then try to install autopy and get complie errors.
I am not great at python yet so I am not sure on how to fix them.
Ashley:~ ashleyhughes$ sudo easy_install autopy
Searching for autopy
Reading http://pypi.python.org/simple/autopy/
Reading http://www.autopy.org
Best match: autopy 0.51
Downloading http://pypi.python.org/packages/source/a/autopy/autopy-0.51.tar.gz#md5=b92055aa2a3712a9c3b4c874014b450e
Processing autopy-0.51.tar.gz
Running autopy-0.51/setup.py -q bdist_egg --dist-dir /tmp/easy_install-U9uWoj/autopy-0.51/egg-dist-tmp-hdjtIx
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
clang: warning: argument unused during compilation: '-mno-fused-madd'
src/screengrab.c:48:26: warning: implicit declaration of function
'CGDisplayBitsPerPixel' is invalid in C99
[-Wimplicit-function-declaration]
bitsPerPixel = (uint8_t)CGDisplayBitsPerPixel(displayID);
^
src/screengrab.c:191:2: warning: 'CGLSetFullScreen' is deprecated
[-Wdeprecated-declarations]
CGLSetFullScreen(glContext);
^
src/screengrab.c:194:2: warning: implicit declaration of function 'glReadBuffer'
is invalid in C99 [-Wimplicit-function-declaration]
glReadBuffer(GL_FRONT);
^
src/screengrab.c:194:15: error: use of undeclared identifier 'GL_FRONT'
glReadBuffer(GL_FRONT);
^
src/screengrab.c:197:2: warning: implicit declaration of function 'glFinish' is
invalid in C99 [-Wimplicit-function-declaration]
glFinish();
^
src/screengrab.c:199:6: warning: implicit declaration of function 'glGetError'
is invalid in C99 [-Wimplicit-function-declaration]
if (glGetError() != GL_NO_ERROR) return NULL;
^
src/screengrab.c:199:22: error: use of undeclared identifier 'GL_NO_ERROR'
if (glGetError() != GL_NO_ERROR) return NULL;
^
src/screengrab.c:207:2: warning: implicit declaration of function
'glPopClientAttrib' is invalid in C99 [-Wimplicit-function-declaration]
glPopClientAttrib(); /* Clear attributes previously set. */
^
src/screengrab.c:223:2: warning: implicit declaration of function
'glPushClientAttrib' is invalid in C99 [-Wimplicit-function-declaration]
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
^
src/screengrab.c:223:21: error: use of undeclared identifier
'GL_CLIENT_PIXEL_STORE_BIT'
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
^
src/screengrab.c:225:2: warning: implicit declaration of function
'glPixelStorei' is invalid in C99 [-Wimplicit-function-declaration]
glPixelStorei(GL_PACK_ALIGNMENT, BYTE_ALIGN); /* Force alignment. */
^
src/screengrab.c:225:16: error: use of undeclared identifier 'GL_PACK_ALIGNMENT'
glPixelStorei(GL_PACK_ALIGNMENT, BYTE_ALIGN); /* Force alignment. */
^
src/screengrab.c:226:16: error: use of undeclared identifier
'GL_PACK_ROW_LENGTH'
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
^
src/screengrab.c:227:16: error: use of undeclared identifier 'GL_PACK_SKIP_ROWS'
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
^
src/screengrab.c:228:16: error: use of undeclared identifier
'GL_PACK_SKIP_PIXELS'
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
^
src/screengrab.c:235:2: warning: implicit declaration of function 'glReadPixels'
is invalid in C99 [-Wimplicit-function-declaration]
glReadPixels(x, y, width, height,
^
src/screengrab.c:236:30: error: use of undeclared identifier 'GL_BGRA'
MMRGB_IS_BGR ? GL_BGRA : GL_RGBA,
^
src/screengrab.c:236:40: error: use of undeclared identifier 'GL_RGBA'
MMRGB_IS_BGR ? GL_BGRA : GL_RGBA,
^
9 warnings and 9 errors generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
Can anyone help. I need autopy as it works on multiple platforms
I used ethan.tira-thompson.com/Mac_OS_X_Ports.html to install libpng
Have xcode installed with command line tools as well
I had the same problem, if you notice all 9 errors are coming from one file:
src/screengrab.c
This file has not been updated to the latest version of OpenGL and there are deprecated methods. On the autopy github repo there is a bug reported for this here. The fix/hack suggested there is to add the line:
#include <OpenGL/gl.h>
after line 7 in src/screengrab.c. You are going to have to get the source from Github and alter it locally rather than using easy_install.
Note this is a hack that will get it to compile but the screen grabs will be all black. Someone needs to spend a few minutes rewriting screengrab.c with up to date methods.
When I added
#include <OpenGL/gl.h>
It did not compile.
So, I took a look though my hard disk, looking for each gl.h
So, I tried
#include "/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h"
Then I managed to compile it :-)
You could only install autopy in python 3.8; Else It can't be installed.
Or you can downgrade your autopy version. There is autopy release history:
https://pypi.org/project/autopy/#history
I had also errors while installing autopy, But when I installed python 3.8,
It worked perfectly.
That works - Thanks!
If you have tried this:
$ sudo easy_install autopy
Another option is to compile from the latest source on the GitHub repository:
$ git clone git://github.com/msanders/autopy.git
$ cd autopy
$ python setup.py build
$ python setup.py install
When building from source, make sure to cd out of the autopy directory before attempting to use AutoPy or else it may fail on an ImportError due to Python's relative imports.
apache version :2.2.6
python versoin :2.6
result of ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python=/usr/bin/python is ok but just got some errors as follows when make:
....
mod_wsgi.c:14430: error: expected expression before âmoduleâ
mod_wsgi.c:14431: error: expected identifier or â(â before â=â token
mod_wsgi.c:14446: error: expected expression before âmoduleâ
mod_wsgi.c:14447: error: âmodule_dictâ undeclared (first use in this function)
mod_wsgi.c:14448: error: âobjectâ undeclared (first use in this function)
mod_wsgi.c:14450: error: expected expression before âmoduleâ
mod_wsgi.c:14454: error: âvarsâ undeclared (first use in this function)
mod_wsgi.c:14455: error: âargsâ undeclared (first use in this function)
mod_wsgi.c:14456: error: âresultâ undeclared (first use in this function)
mod_wsgi.c:14457: error: âmethodâ undeclared (first use in this function)
mod_wsgi.c:14474: error: âPy_Noneâ undeclared (first use in this function)
mod_wsgi.c:14488: error: âPy_Trueâ undeclared (first use in this function)
mod_wsgi.c:14491: error: âPy_Falseâ undeclared (first use in this function)
mod_wsgi.c:14503: error: âPyExc_TypeErrorâ undeclared (first use in this function)
mod_wsgi.c:14519: error: âAuthObjectâ has no member named ârâ
mod_wsgi.c:14523: error: âAuthObjectâ has no member named âlogâ
mod_wsgi.c:14526: error: âPyExc_AttributeErrorâ undeclared (first use in this function)
mod_wsgi.c:14528: error: âAuthObjectâ has no member named âlogâ
mod_wsgi.c:14541: error: expected expression before â)â token
mod_wsgi.c:14548: error: expected â;â before âap_log_rerrorâ
mod_wsgi.c:14553: error: expected â;â before â}â token
mod_wsgi.c:14558: error: too many arguments to function âwsgi_log_python_errorâ
mod_wsgi.c:14563: error: expected expression before âmoduleâ
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1
Please advise me
i had the same error; i solved it by compileing python 2.7.2 from scratch; if you look around different forums you will see that some libraries of python where compiled on a 32 bit system and you problably are using a 64 bit system.
go for 2.7 or above 2.6 is a pain to compile due to all the missing dependencies that you have to get. you will end with something like this
Python build finished, but the necessary bits to build these modules were not found:
bsddb185 dl imageop
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
_curses_panel
running build_scripts
this libraries have all been depreciated so it is safe to do a make install as is
I tried to install pysqlite. Some suspicious things start to appear during the installation. Why I typed:
python setup.py build
I got the following message in the end:
src/module.c:286: error: ‘SQLITE_PRAGMA’ undeclared here (not in a function)
src/module.c:287: error: ‘SQLITE_READ’ undeclared here (not in a function)
src/module.c:288: error: ‘SQLITE_SELECT’ undeclared here (not in a function)
src/module.c:289: error: ‘SQLITE_TRANSACTION’ undeclared here (not in a function)
src/module.c:290: error: ‘SQLITE_UPDATE’ undeclared here (not in a function)
src/module.c:291: error: ‘SQLITE_ATTACH’ undeclared here (not in a function)
src/module.c:292: error: ‘SQLITE_DETACH’ undeclared here (not in a function)
src/module.c: In function ‘init_sqlite’:
src/module.c:419: warning: implicit declaration of function ‘sqlite3_libversion’
src/module.c:419: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
error: command 'gcc' failed with exit status 1
I just ignored the last line and decided to continue. So, I typed:
python setup.py install
And than, again, I got similar error message:
src/module.c:288: error: ‘SQLITE_SELECT’ undeclared here (not in a function)
src/module.c:289: error: ‘SQLITE_TRANSACTION’ undeclared here (not in a function)
src/module.c:290: error: ‘SQLITE_UPDATE’ undeclared here (not in a function)
src/module.c:291: error: ‘SQLITE_ATTACH’ undeclared here (not in a function)
src/module.c:292: error: ‘SQLITE_DETACH’ undeclared here (not in a function)
src/module.c: In function ‘init_sqlite’:
src/module.c:419: warning: implicit declaration of function ‘sqlite3_libversion’
src/module.c:419: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
error: command 'gcc' failed with exit status 1
After that I wanted to try if pysqlite works.
If in the python-command-line mode I type
from pysqlite2 import *
Python does not complain. However, if I try to follow an exmaple in my book:
from pysqlite2 import dbapi2 as sqlite
I get a error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pysqlite2/dbapi2.py", line 27, in <module>
from pysqlite2._sqlite import *
ImportError: No module named _sqlite
Does anybody have any ideas why it happens and how this problem can be solved. By the way, I have installed a new version of Python. "python -V" gives me "Python 2.6.2". Thank you in advance for any help.
I just ignored the last line and decided to continue.
You can't just ignore the last line. It was telling you there was an error, so it couldn't compile. The next thing you ran told you it couldn't install because it couldn't compile. Then, your python told you it couldn't run the code because it wasn't installed. You need to get the compile step working before you move on to installing it.
A lesson in compiling python extensions is needed, which distribution are you using ? You seem to be missing the sqlite headers with the given macro definitions. When the python setup runs it compiles bindings to the sqlite native binary and copies a few .py files to the library. The _sqlite is typically a .pyd file (equivalent to a dll) which has calls to the sqlite library, in your case that did not get built.
Check the presence of the sqlite headers etc.
The correct way to build pysqlite is now on the website.
$ tar xvfz <version>.tar.gz
$ cd <version>
$ python setup.py build_static install
The build_static will download the latest sqlite code and statically compile against it. For a note I just did this on a 1and1 shared host.
http://trac.edgewall.org/wiki/PySqlite#Buildingpysqlite