Which mod_wsgi Binary to download? - python

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

Related

0x80070643 error while installing Python 3.6

I'm actually using Python for an audio steganography project but I have some troubles.
I searched this error code on the forum, but I found things about SQL installations and not Python.
I'm trying to re-install Python 3.6.5 after an uninstall, because of a bug with pip.
I installed Python 2.7, Python 3.6.5, Python with VS 2017, before uninstall it because it wasn't working.
However, when I'm runing the installer as an administrator, hit "customize installation", tick everything excpet "balblalblabal (this requires VS 2015 or later)", and click on "install", it tells me that :
.
I realy need Python to work and I'm now stuck ...
If anybody here could help me, it would be nice !
Thanks all,
maleik.
PS : I have the log for you :*
The log link
I found this in the log file which you have attached. Try cleaning the registry with CC cleaner and give it a try. If it still doesn't work, try installing python with web installer Python Web Installed 3.6.5.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to install MSI package.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package.
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to configure per-machine MSI package.
[2610:03A4][2018-12-05T20:46:18]i319: Applied execute package: core_AllUsers, result: 0x80070643, restart: None
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package
I installed python from Microsoft store after facing this problem and it magically got installed without any error as it may have directly been installed. I don't know but try if it eorks for you too.
You need to run the installation as a local administrator.
I had the same problem installing Python version 3.9 for the first time on my Windows 10, as this same problem happens to many users trying to install Python, the best solution I accidentally, just like #MANAN AGGARWAL discovered trying to check if I already had a version of Python installed on my computer by the DOS Command Prompt, was:
Open the DOS Command Prompt (cmd) and dictate "python": if a screen shows you a version, it's clearly not the first time you've installed Python, so if you want to upgrade you should try: https: / /www.delftstack.com/en/howto/python/how-to-update-python/ But if you've never installed any version of Python, the solution lies in updating your operating system to the latest version through Windows Update, and open the command prompt and type Python, or go directly to the Microsoft Store and search for Python followed by its latest version. It works without error.
** If by chance it does not automatically install on your PC after downloading, click "install on my devices" and select your computer name.
Why can't I install Python directly from the website file? Please note that when trying to install any software/applications from outside Microsoft's trusted locations, there are high chances of user settings interfering with the installation. When coming, for example, from the Microsoft Store, a chance of success is much greater, even without having problems related to User Permission Settings.
Another important thing to point out here is that installing a lot of software from outside Microsoft's trusted platforms can cause you to change some user permissions which can have positive effects with some software and negative effects with others, even with security your own system if you don't know what you're doing.
it's simple , Try Lower Version Like 'Python 3.6' but Download web install.
install it , then install last python version.
your python will update.
I've faced same/similar problem with installing Python 3.9.12 in a clean Windows 8.1 64-bit (VirtualBoxed test environment).
I thought the issue could have been fixed in a newer version of Python, but the freshest 3.10.10 fails with same issue.
The original log isn't available any longer, but luckily it is quoted in another answer, and the following line reveals the real problem:
Applied execute package: core_AllUsers, result: 0x80070643, restart: None
My log looks the same, and if you scroll the log up, you'll discover that core_AllUsers is a UCRT MSI-installer, which is downloaded from Python site (for 3.10.10 64-bit the link may look like https://www.python.org/ftp/python/3.10.10/amd64/ucrt.msi).
If you download it manually (Python installer is smart enough to do a cleanup even if it fails, so you won't find this MSI in a local cache) and run, it will probably crash. And if it is your case, I have a simple solution - just install update KB2999226 (Update for Universal C Runtime) for your OS, which you can download from Microsoft.
I also faced the similar issue. What the trick worked for me is I installed it for the individual user (as earlier installation was for the all users).
So earlier if one has installed it for the all users then install it for the specific user and vice versa.
I know this is not the resolution of the error faced. However, this approach will install Python which is the main motive to achieve.
I encountered the same issue after installing a fresh Windows 8.1 on my PC.
I solved that by using the Python v3.9 web installation file which you can find here.
However, you can choose any other version that has a web installation file
Note: You need internet connection to use this method.

What's the best way to deploy flask application to windows based server

I tried many attempt in installing flask app in windows. I found that mod_wsgi need to be installed along with apache, however, I can't get the latest mod_wsgi.so , any idea the easiest way to install flask in windows ? thanks
See instructions for using pip install mod_wsgi in:
https://stackoverflow.com/a/42307082/128141
Should work fine with Python 3. Has been one report of something not quite being right for Python 2.7 in generated configuration but can be manually fixed if that occurs. Better to use latest Python 3 anyway.

Does google app engine use python 2.7.0 or 2.7.1?

What python version does app engine use?
This is related to problems I'm having on mac osx with getting pycrypto to work. Because the python version now in mac is 2.7.1. When Google says the python version for app engine is '2.7' do they mean precisely 2.7.0? Or is python 2.7.1 okay too?
Can this cause problems for my local install of pycrypto? ( which I installed with pip: sudo pip install pycrypto==2.6 )The pycrypto library works correctly, but it somehow messes up app engine running a development server. The logging doesn't show all errors or logs which I expect to appear there.
When Google says the python version for app engine is '2.7' do they mean precisely 2.7.0? Or is python 2.7.1 okay too?
Any subversion of python 2.7 works. 2.7.0 works, but I have used 2.7.6 and 2.7.10 extensively as well. So I'm sure that 2.7.1 will work too.
Can this cause problems for my local install of pycrypto? ( which I installed with pip using: 'sudo pip install pycrypto==2.6' )The pycrypto library works correctly, but it somehow messes up app engine running a development server. The logging doesn't show all errors or logs which I expect to appear there.
I know you have asked about this before but I will give you an other (better) way to include pycrypto in your appengine project.
In your app.yaml, specify the following:
libraries:
- name: pycrypto
version: "2.6" # or "latest", or "2.3"
See https://cloud.google.com/appengine/docs/python/tools/libraries27 for more info about which libraries are supported by appengine and how you can import which versions.
It seems as though you're asking the question which inspired your title, about python verson 2.7.x, as a way to get insight into your actual problem, which is related to pycrypto. Tim's answer dealt with the question of which sub-versions of 2.7.x are supported.
It appears you're using both the app.yaml libraries stanza and pip to get an instance of pycrypto. So:
Is the pip-installed pycrypto residing on your dev-box somewhere like /usr/local/lib/python-2.7, or is it in the app's folder, specifically?
When the dev-server is running, is it possible your python path has it using the pycrypto installed by pip on your system, with that pycrypto being a different version than the one in production? This might cause different behaviour on the dev-server vs. production.
...All this said, it still seems odd, as Tim has pointed out, that you should see a disruption to logging based on this. What is it you're logging, and are you using any exception handling which might be dropping the responsibility to log?
Finally, is there a setting when running the dev-server which you can use that would enable more verbosity? Try that to see if you can raise the logging level enough to make the exceptions you're looking for visible.
These are my thoughts so far on how to get out of your jam.

BitNami DjangoStack not 'self contained', cannot run application

I installed the Windows (32bit) BitNami DjangoStack 1.4.1.0 and elected not to install the python that came with it as I already have Python 2.7 installed.
I got the error below and also an internal server error when I clicked on the button in the introduction web page (so Appache is running ok)
enter code here
[error] mod_wsgi (pid=3990): Target WSGI script '/opt/bitnami/apps/django/scripts/django.wsgi' cannot be loaded as Python module
I found a similar question but that related to installing on Amazon. Also following through the answers it appeared that the problem is that the wsgi had been compiled against the wrong python version.
I then uninstalled BitNami and re-installed using the python version that was provided - still the same message.
I don't see how the wrong python version can be the problem if the BitNami package is self contained, i.e. comes with all the bits needed to run.
In case my previously installed version was causing the problem I remove it from the PATH environment variable.
Also the documentation for Windows seems wrong. django.conf and django.wsgi are not where the docs say they are (\Users\user\BitNami SDjangoStack projects\apps). In fact the only thing in that directory is the new project I selected on installation - no apps directory. I found the files in the BitNami directories.
Also when I typed python in the BitNami console I got python 2.7.3, not 2.7.2 which is listed in the installation guide.
I thought this package would be wonderful to help me get a production Django site running. It is now ready in the development phase to go live for testing.
What do you exactly mean with not installing Python? BitNami DjangoStack is self contained in the sense that it includes its own Python and its dependecies. Also you mentioned that you are running it on Windows but the path /opt/bitnami is the default path when installing as root in Linux. What exact options did you select during the installation?

Apache Config - Multiple python versions

I have a couple versions of python on my box. My app uses python 2.7 which is found in /usr/local/bin/python. Apache seems to be using an earlier version in /usr/bin/python. How can I configure Apache to use a later version of Python for my app?
To use with Python 3, you need to install the right mod_wsgi for python 3.
On Debian or Ubuntu : sudo apt-get install libapache2-mod-wsgi-py3.
For older versions of Python, when installing mod_wsgi, type : ./configure --with-python=/usr/local/bin/python2.5 for version 2.5 for instance.
You can't. Either rebuild mod_wsgi against the other version of Python, or change the shebang line in your CGI scripts to the other executable.
I could be mistaking, but whatever user apache is started with has a profile which likely has the search path in it. You could change the search path to search /usr/local/bin before /usr/bin, though this is not an ideal approach. Whatever default shell is set for the account used by Apache, just check that you have an rc-file for that shell, and if not, create one.

Categories

Resources