mod_wsgi on archlinux with python 3.2 - python

I actually had mod_wsgi working with python3.1, but after updating some software... it no longer works.
I followed these instructions for python3.1 modified slightly for 3.2:
https://wiki.archlinux.org/index.php/Mod_wsgi
and while it seems to build/install ok, trying to start apache give me the error :
Cannot load /etc/httpd/modules/mod_wsgi.so into server: /etc/httpd/modules/mod_wsgi.so: undefined symbol: PyCObject_FromVoidPtr
just as this guy got:
Python 3.1.1 with --enable-shared : will not build any extensions
Any help would be appreciated.
I am a linux noob.

The released versions of mod_wsgi cannot be used with Python 3.2. You must currently use source code directly from subversion repository for mod_wsgi. See:
http://code.google.com/p/modwsgi/source/checkout

Related

python, trac, apache, mod_wsgi on windows

I'm using trac 1.2 on windows. Their documentation says it requires python2, so I pip install'd it with python2 x64, and spent a lot of time configuring some trac environments. Now I want to run trac through apache httpd so I can set it up with microsoft active directory, so I figured, okay, let's try mod_wsgi. I read this mod_wsgi documentation which mentions that python2 is built with VC9, and that apache, mod_wsgi, python binaries need to be consistent architecture throughout. So that means, for me, VC9, x64 for all. I installed the VC9 runtime from here. For mod_wsgi, I pip installd it using the mod_wsgi‑4.6.4+ap24vc9‑cp27‑cp27m‑win_amd64.whl file from here to avoid having to install VS2008's entire toolchain. Now I guess I need apache x64 VC9. The apache binary closest to VC9 I could find was VC10 here which says it loads VC9 modules, so I went ahead and tried it. I ran mod_wsgi-express module-config which gave me
LoadModule wsgi_module "c:/python27/lib/site-packages/mod_wsgi/server/mod_wsgiNone"
WSGIPythonHome "c:/python27"
The first line wasn't right, since httpd complained it couldn't load the module, so I changed it to
LoadModule wsgi_module "c:/python27/lib/site-packages/mod_wsgi/server/mod_wsgi.pyd"
I verified that that module exists at the specified path, and ran httpd which still error'd out with
httpd: Syntax error on line 179 of C:/Apache24/conf/httpd.conf: Cannot load c:/python27/lib/site-packages/mod_wsgi/server/mod_wsgi.pyd into server: The specified module could not be found.
So I guess the VC10 x64 apache binary I downloaded isn't backwards compatible with VC9 x64 mod_wsgi.
Does this mean I now need to build my own VC9 x64 apache binary? There must be a simpler way to achieve running trac 1.2 within an apache web server, right? Unfortunately, it's not as obvious to me. Any help is appreciated. Also, let me know if I need to clarify any other detail.

Error when running tensorflow [duplicate]

When I run django project, I came across a strange problem as listed:
ImportError: /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_AsASCIIString
If I I run this project in dev mode(python manage.py runserver 0.0.0.0:8000), it doesn't occur. But when I deploy this project in apache and then this problem occurs.
In this project, I use nltk package and mongodb, and numpy is a dependency.
My OS is CentOS 6.3 and I upgraded python from 2.6.6 to 2.7.3 which is compiled by myself.
Following some instructions, I recompile and rebuild python with ./configure --enable-unicode=ucs2. But that seems didn't work.
So any guys know the reason or solutions? Thanks a lot!
Rebuild NumPy against a Python built as UCS-4.

Which mod_wsgi Binary to download?

1) I am trying to setup a WAMPServer and am stuck on which file I need to download from the site: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
I am using: Windows 7(64 bit), Apache 2.4.9 and Python 2.7.
2) Also, many of the tutorials I have seen on the matter say to download a .so file. However the above link contains .whl files?
I've been using this https://stackoverflow.com/a/20128269/2268507 as a guide.
I would really appreciate it if someone could shed some light on these two matters.
Thank you for your help.
That page on the gohike site tells you to go read:
https://github.com/GrahamDumpleton/mod_wsgi/blob/master/win32/README.rst
Did you do that?
That page for mod_wsgi explains what version you should use for what. It does this in reference to the binaries that the mod_wsgi downloads list has, but if you understand what Python wheels are then you can use those from the gohike site as well.
UPDATE
Note that details at this URL are obsolete. You should use pip install as described at:
https://pypi.python.org/pypi/mod_wsgi
Once installed, run mod_wsgi-express module-config to display config you should add to your Apache configuration file to load mod_wsgi that you installed using pip install.
Yes, read the Graham's [Git] and take a look at paragraph:
"
Note that Apache Lounge never made available any Win64 VC9 binaries for Apache 2.4. This means that technically there is no combination available for correctly running mod_wsgi with a Win64 VC9 version of Python 2.6 or 2.7.
History shows that users simply don't want to accept this and don't want to understand that mixing VC9 and VC10 binaries are not guaranteed to work.
"
See that? don't use Python 2.6 or 2.7 in Win64, Apache doesn't support the module for you.
But you can still download the ".so" file in here , just found which is the best and suit for you and install it into Apache. This is the tutorial how to install mod_wsig to Apache and XAMPP. Good Luck!
Rian Hariadi, Jakarta Coding

HG reviewboard installation on Win7 x64

While it was stated that it's not the best idea to host a reviewboard for mercurial on windows evironment I stil gave it a try. So far I have not succeeded. And thus I am in search of help.
I am running Windows 7 x64 and have followed the official Installing on Windows guide.
Here I had no problems, problem occured when I chose wsgi. Now I am using Apache 2.2 32bit, python 2.5.4 32 bit and I have downloaded an apache wsgi module from: http://code.google.com/p/modwsgi/wiki/InstallationOnWindows
Strangly enough they don't have module for this particular combo (Apache 2.2|python 2.5) so I grabbed the closest thing: mod_wsgi-win32-ap22py26-3.3.so - Apache 2.2 / Python 2.6
Still I did not consider win32 would be of any problems for win64 huh ?
Well after I have told Apache2.2 in it's httpd.conf to "LoadModule wsgi_module modules/mod_wsgi.so" that I have put in modules folder, here is what it told me:
httpd.exe: Syntax error on line 129 of G:/tools/Apache2/conf/httpd.conf:
Cannot load G:/tools/Apache2/modules/mod_wsgi.so into server: %1 is not
a valid Win32 application.
Is this cause I use python 2.5 not 2.6 AND/OR windows 7 64 ? And if it's has any relation to python version - I couldn't find wsgi mod for 2.5 at least not downloadable version, only sources that need to be compiled and then some.
Has anyone faced similar problems and could advice or give hint how to load those that wsgi module ?
I'm pretty sure that mod_wsgi has to be compiled against the correct Python version, so you can't use mod_wsgi-win32-ap22py26-3.3.so with 2.5.4.
(BTW, not sure why you're still using 2.5 anyway?)

installed new version of python, but django still uses system default

On Dreamhost, I did the following
installed Python 2.7.1 in my ~/opt directory,
added export PATH=$HOME/opt/bin/:$PATH in my .bash_profile
verified with python --version that 2.7.1 was default
installed setuptools 0.6c11-py2.7
installed Django 1.2.4 with /path/to/python2.7 setup.py install
verified version 1.2.4 with import django and django.VERSION in python shell
wget http://wiki.dreamhost.com/django-setup.py
python2.7 django-setup.py in my site directory ("site.com")
intentionally put a syntax error in ~/site.com/project/urls.py
visited the site in web browser and the error page still says I'm using Python 2.5.2
Why does my Django refuse to use my new version of Python?
According to this, installing-django-with-python-2-5-and-not-with-the-default-version-of-python, the problem might be with mod_wsgi (or I think passenger in my case (but I don't actually know if they do the same thing)).
Should I try to compile mod_wsgi, compile passenger_wsgi, install virtualenv, all of the above, none of the above, A and C, B D and E, or something else altogether?
Maybe you can change the WSGIPythonExecutable directive in your mod_wsgi configuration?
To configure Passenger's Python interpretter, you can follow these steps.

Categories

Resources