i'm having this problem:
i'm runing pythonbrew to get python2.7, and so i re-compiled mod_wsgi to use the 2.7 python.
to that end, i followed this tutorial:
code.google.com/p/modwsgi/wiki/QuickInstallationGuide
which involved downloading the file - there is a tar.gz file i get - and then "configuring it" with ./configure --with-python=/home/bharal/.pythonbrew/pythons/Python-2.7.2/bin/python --enable-shared
now i'm assuming this is the right place to attach for my python - the value for with-python above is just the response i get to a which python
OK! So, now the problem. After i run the configure above, i run make and i get:
/usr/include/features.h:160:1: warning: this is the location of the previous definition
/usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-static x86_64-linux-gnu-gcc -o mod_wsgi.la -rpath /usr/lib/apache2/modules -module -avoid-version mod_wsgi.lo -L/home/aiyer /.pythonbrew/pythons/Python-2.7.2/lib -L/home/aiyer/.pythonbrew/pythons/Python-2.7.2/lib /python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm
/usr/bin/ld: /home/bharal/.pythonbrew/pythons/Python-2.7.2/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/home/aiyer/.pythonbrew/pythons/Python-2.7.2/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
And i have no idea what to do. I came across this answer is SO:
https://stackoverflow.com/a/6118155/1061426
but this doesn't help me any much - it isn't as far as i can tell a series of steps, but more an interesting tidbit to think about.
I ran this command to check if i have python 64 bit:
import sys
print maxint
if 64 bit ==> 9223372036854775807
if 32 bit ==> 2147483647
ok, so i'm totes running 64bit because i get the bigger number. So i read this doco here:
http://code.google.com/p/modwsgi/wiki/InstallationIssues#Mixing_32_Bit_And_64_Bit_Packages
because i'm running the 64 bit python, does that mean that my problem isn't this:
This error is believed to be result of the version of Python being used having been originally compiled for the generic X86 32 bit architecture whereas mod_wsgi is being compiled for X86 64 bit architecture. The actual error arises in this case because 'libtool' would appear to be unable to generate a dynamically loadable module for the X86 64 bit architecture from a X86 32 bit static library.
but rather this?
Alternatively, the problem is due to 'libtool' on this platform not being able to create a loadable module from a X86 64 bit static library in all cases.
(the above quotes from the above link)
and if that is the case, what the heck do i do? I haven't the foggiest notion what to do in either scenario - and yes, i read the rest of that page, but it might as well have been written in greek ( i don't speak greek ).
any suggestions?
UPDATE:
i never fixed this and ended up using the python my ubuntu came with - no difference from the running of my code's point of view.
The documentation says:
If the first issue, the only solution to this problem is to recompile
Python for the X86 64 bit architecture. When doing this, it is
preferable, and may actually be necessary, to ensure that the
'--enable-shared' option is provided to the 'configure' script for
Python when it is being compiled and installed.
So, you need to reinstall Python from source code, ensuring the '--enable-shared' option is supplied to the 'configure' command for Python prior to running 'make'.
If 'pythonbrew' doesn't allow you to do that, then tell the pythonbrew people that the way they are building their Python version with shared library support is arguably broken and will prevent many embedded systems from failing to run.
Having come across this problem myself with Fedora 19 64bit, I found that the mod_wsgi would compile and install from source if I installed both the Python-devel and httpd-devel packages.
I am not using pythonbrew however.
My Dear Python developers, I was also getting the same error, and here is how I got it fixed. The very first step is that you'll have install python with --enable-shared option. Next thing, Make sure you have dev dependencies installed for both Apache and Python. sudo apt-get install apache2-dev and sudo apt-get install python3.8-dev. I was using Python 3.8 so i install python3.8-dev. You need to install the one matching with your python version.
In addition to this, read this aricle and follow the instruction closely, given here https://modwsgi.readthedocs.io/en/develop/user-guides/quick-installation-guide.html#apache-requirements
I just followed it and was able to make it work properly.
Related
I am trying to install JCC (as part of the installation of PyLucene) and I encountered several issues with it.
The python version I use is 3.7, and I have installed adoptopenjdk-8.jdk using brew cask (since Java-8 is no longer available without specific license (read it somewhere)). After this didn't really worked I manually installed Java-8
The error I am receiving while trying to run setup.py in shell (using either java8 or adoptopenjdk) is:
OSError: warning: [options] bootstrap class path not set in conjunction with -source 5
error: Source option 5 is no longer supported. Use 7 or later.
error: Target option 5 is no longer supported. Use 7 or later.
Please help me install PyLucene!
It is related to these (but they are outdated and doesn't work):
pyLucene Installation
https://medium.com/#michaelaalcorn/how-to-use-pylucene-e2e2f540024c
EDIT:
I realized this is related to javac versions but idk how to solve it.
This site looks helpful (from the code) but I can't understand whats written here: https://www.jianshu.com/p/dcd149a65eb0
So,
Changing the the setup.py file in 2 locations solved it:
line 185:
JAVAC = {
'darwin': ['/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/bin/javac', '-source', '1.5', '-target', '1.5'],
and adding one line here (line 68):
JAVAHOME = '/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home'
JDK = {
'darwin': JAVAHOME,
'ipod': '/usr/include/gcc',
After much gnashing of teeth, I found that this works to build pylucene
My configuration:
Mac OSX 10.15.7
Powerbook Intel core i7 (I note this, because I got
the weird error "gcc: error: this compiler does not support arm64"
when trying to compile with gcc)
Python 2.7.16 (Python 3.8.2 doesn't seem to work... lots of compile
errors with bad types.)
Apple clang version 12.0.0 (clang-1200.0.32.29)
gcc (Homebrew GCC 10.2.0_3) 10.2.0
I used clang instead of gcc (which doesn't seem to work at all) by doing this:
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
In the file setup.py, I removed -ljava and -ljvm flags from the LFLAG dictionary where darwin is in the key. Otherwise, ld complains.
I've managed only to build pylucene. I have no idea (yet) whether it will work with Python 2.7 or Python 3.x
I will update with details.
I'd like to use graph-tool on windows 7, but I'm having trouble installing it.
All the requirements listed here are successfully installed. Python 2.7 is installed in C:\python27. Boost 1.49.0 was successfully compiled with mingw, installed in C:\boost and the BOOST_ROOT environment variable is pointing to it. Boost is compiled in debug and release mode and both static and dynamic.
Invoking configure from within MSyS leads to the following error.
configure: error:
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LDFLAGS environment variable.
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================
Calling configure LDFLAGS="-LC:/python27/libs" fixed this error, but lead to the following error
checking for boostlib >= 1.38.0... configure: error: We could not detect the boo
st libraries (version 1.38 or higher). If you have a staged boost library (still
not installed) please specify $BOOST_ROOT in your environment and do not give a
PATH to --with-boost option. If you are sure you have boost installed, then ch
eck your version number looking in <boost/version.hpp>. See http://randspringer.
de/boost for more documentation.
This is weird, since BOOST_ROOT is clearly defined (checked it with printenv command).
The next command I tried was configure --with-boost="C:/boost" LDFLAGS="-LC:/python27/libs"
checking for boostlib >= 1.38.0... yes
checking whether the Boost::Python library is available... no
configure: error: No usable boost::python found
Alright it detects boost, but It can't find boost::python. Due to its size I'm unable to post the config.log on stackoverflow but you can find it here.
I'm really confused right now and would appreciate any help.
I have zero experience with compiling graph-tool (or anything else) for windows, but the following part of your config.log stands out:
configure:17224: checking whether the Boost::Python library is available
configure:17254: g++ -c -Wall -ftemplate-depth-150 -Wno-deprecated -Wno-unknown-pragmas -O99 -fvisibility=default -fvisibility-inlines-hidden -Wno-unknown-pragmas -Ic:\python27\include conftest.cpp >&5
conftest.cpp:32:36: fatal error: boost/python/module.hpp: No such file or directory
compilation terminated.
Note how the boost path you passed is not being used! Try to pass CXXFLAGS="-IC:\boost\include" to configure as well.
May be something like this would help:
./configure --prefix=/usr/
for windows path is different, try it yourself.
I am trying to install mod_wsgi and django. When i "make" mod_wsgi then i get error if i use python2.7 but it went ok with default python.
i already wasted much time to figure that but could not solve it.
I just wanted to know that if continue with default python and install Django then can i change the python to 2.7 later
EDIT:
CENTOS5.5
The error i get is
/usr/bin/ld:
/opt/python27/lib/libpython2.7.a(node.o):
relocation R_X86_64_32 against `a
local symbol' can not be used when
making a shared object; recompile with
-fPIC
/opt/python27/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: * [mod_wsgi.la] Error 1
this all heppens if i do
"make" in mod_wsgi directory
Now this error is written on their help site
But i could not configure these things.
According to them
If the version of Python being used
was compiled for X86 64 bit
architecture and a shared library does
exist, but not in the 'config'
directory, then adding the missing
symlink may be all that is required.
i have found that my python version is 64bit . So the only thing left is the other option he talked in above text.
I don't know how to
1) Check if shared library does exist
2) How to add the missing symlink
If i make the mos_wsgi using default python then i get no error.
I just wanted to know that if continue with default python and install Django then can i change the python to 2.7 later
Yes. Upgrades are permitted. AFAIK, there's no law that says you are not permitted to upgrade. Indeed, why ask if an upgrade is possible? Have you been told that you're not permitted to upgrade?
Use the default Python.
Learn Python. Do the entire tutorial.
Install Django.
Learn Django. Do the entire tutorial.
When you go to install mod_wsgi (which you should not do first) please search for CentOS and mod_wsgi. Search is an important skill.
Problem with Django setup using mod_wsgi and apache on centos 5.4
http://library.linode.com/frameworks/django-apache-mod-wsgi/centos-5
And upgrades are permitted. Don't ask for permission. Search for relevant issues.
I am trying to build Python from source and need to include the SSL module for my web scraper to work with it.
I ran into the problem of SSL not being found, so I downloaded and built OpenSSL from source. The problem is, I need to install the development libraries along with OpenSSL in order for Python to run the -lssl parameter correctly when running make. I can't seem to find any documentation on how to build OpenSSL with the development libs, even though I'm sure it's got to be something simple I'm just missing.
I must do this from source; with no package managers. I have my reasons.
EDIT:
I have changed a few of the python configuration settings to try and fix the problem, and this is the compile error I am getting now:
gcc -pthread -Xlinker -export-dynamic -o python \
Modules/python.o \
libpython2.7.a -lpthread -ldl -lutil -L/home/[username]/openssl-src -lssl -lcrypto -lm
libpython2.7.a(posixmodule.o)(.text+0x4016): In function posix_tmpnam':<br />
./Modules/posixmodule.c:7346: warning: the use oftmpnam_r' is dangerous, better use mkstemp'
libpython2.7.a(posixmodule.o)(.text+0x3f76): In functionposix_tempnam':
./Modules/posixmodule.c:7301: warning: the use of tempnam' is dangerous, better usemkstemp'
./python: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
make: * [sharedmods] Error 127
The "no such file or directory" is being thrown looking for a file that does exist in the /home/[username]/openssl-src directory.
The default OpenSSL build should install the appropriate header files and libraries using make install, just make sure to provide the right prefix to the configure script (e.g., ./configure --prefix=/usr).
If this fails, please post the exact error that gcc shows.
By the way, please consider using an automated tool such as buildout for building Python. I think the standard recipes take care of SSL support (possibly even downloading and compiling OpenSSL), although I am not certain about this.
This answer doesn't EXACTLY answer my question, but I did find out what I needed to know so I will post it here. I had to change the location of the SSL files it was looking for to just /usr rather than /usr/local. RedHat by default has all the shared libraries in /usr/lib rather than /usr/local/lib, which is where it was looking by default.
in the Bourne shell (/bin/sh or /bin/bash):
$ LD_LIBRARY_PATH=/usr/local/lib
$ export LD_LIBRARY_PATH
$ make
in the C-shell (/bin/csh or /bin/tcsh):
% setenv LD_LIBRARY_PATH /usr/local/lib
% make
I am trying to install the
R/SPlus - Python Interface (RSPython) on my Mac OS X 10.4.11 with R version 2.7.2 (2008-08-25) and python 2.6.2 from fink.
The routine:
sudo R CMD INSTALL -c RSPython_0.7-1.tar.gz
produced this error message:
* Installing to library '/Library/Frameworks/R.framework/Resources/library'
* Installing *source* package 'RSPython' ...
checking for python... /sw/bin/python
Python version 2.6
Using threads
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package 'RSPython'
** Removing '/Library/Frameworks/R.framework/Versions/2.7/Resources/library/RSPython'
The config.log was not created o my system.
The contact e-mail address to the author does not work anymore, so I just hope somebody here tried the same already or can give me an alternative for running R routines in python.
Best regards,
Simon
To debug this, simply unpack the tar file yourself (tar xzvf RSPython_0.7-1.tar.gz) and run ./configure in the directory created. You should get a config.log file that you can examine.
Try running R CMD CHECK RSPython_0.7-1.tar.gz
That should produce at least produce bunch of logs in a RSPython.Rcheck folder
You might get some clues in there.
Update ---
If you can get one of the other packages to work I'd recommend it. On my system (R 2.9.1 using system python (2.6) in /usr/bin/python), install works but then RSPython fails to run due to problems inside its .First.lib function. I expect you would need to hack the sources considerably to get it to work.
I found the rpy and rpy2 packages and going to try those as an alternative to the older RSPython.
rpy2 is includes in fink's unstable distribution ... well, and it just works fine.