how to find mod_wsgi.so file - wsgi

I have successfully run the python setup.py install but finding it difficult to locate mod_wsgi.so file so that I can paste it in apache folder. Pls some one guide me in this regard
Thanx in advance

Run:
mod_wsgi-express module-config
and it tells you what to add to the Apache configuration file to load the mod_wsgi module.
This is described in:
https://pypi.python.org/pypi/mod_wsgi
for the method of using pip install and then integrating into an existing Apache installation. See section 'Connecting into Apache installation'. Same if you ran python setup.py install in source code.
You still then need to configure it for your specific WSGI application.

Related

import win32api in python 3.7 resulting in dll import error

I am having the error while running jupyter notebook. Error replication:
python --version
Python 3.7.9
python
import win32api
The error was: ImportError: DLL load failed
After doing a some stackoverflow, I got to know that there are 2 dll files missing namely: pythoncom37.dll and pywintypes37.dll
I also got to know that I can run this post command: pywin32_postinstall.py in the Scripts folder. I ran this script. Restarted my pc. I manually download these two dll and copied it to my system32. After manually downloading, I started to have a different type of error: ImportError: DLL load failed: %1 is not a valid Win32 application
I used anaconda and ran my jupyter notebook which was my main aim but can you please make me aware as what is going wrong?
I've run into this recently, but with a different version of the DLLs. What solved it for me was using a different version of pywin32.
My solution (conda env, python 3.8.5):
pip install pywin32==300
or try 225, 227, 228. The latest pywin32 (301 as of this post) seems to be having dll search issues (I wouldn't be surprised if whatever version you were using is also having dll search issues). 301 was released after your issue started, but you may have a similar problem nonetheless.
There is currently an issue on pywin32 DLL loading failing: https://github.com/mhammond/pywin32/issues/1709
Factors involved (in my experience) include your PATH variable (if you're using conda). I haven't tested it myself, but I'd be curious to see if this issue occurs without conda. This issue stops happening for me if the first dlls found are those for 301. In my case, that means putting them in my C:\Windows\System32 folder (yeah I'm on Windows; joy).
So a possible solution #2 would be to run the pywin32 post install script which should be located under your venv/Scripts/pywin32_postinstall.py
To try that solution, open an ADMIN command prompt (very important that it's admin), navigate to your venv, and run:
ppython.exe Scripts\pywin32_postinstall.py --install
You shouldn't HAVE to do this, but if you just need a one-off solution and it works, great!
pip install --upgrade pywin32 ==225 worked for me. Tried version 300 and was unsuccessful.

How to install splunkclient for Windows

I am trying to connect to my splunk server via Python on my WIndows laptop.
I downloaded splunklib and splunk-sdk. However, when I run
import splunklib.client as client
I get an error of
ModuleNotFoundError: No module named 'splunklib.client'; 'splunklib' is not a package
Any ideas on why this is occurring and suggestions on to how to fix this or the best way to access Splunk via Python?
Did you properly install the splunk-sdk? You would normally use something like pip to install it.
pip install splunk-sdk
Alternatively, you can install it into the PYTHONPATH
Refer to
https://dev.splunk.com/enterprise/docs/python/sdk-python/gettingstartedpython/installsdkpython/
Windows requires a manual setup of the SDK.
Download the Splunk Software Development Kit for Python as a zip file.
Unzip the zip file into the same directory as your program source.
Add the following line to your source code before import splunklib.client as client:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "splunk-sdk-python-master"))
Another option is to unzip the sdk to another folder and specify the absolute path in the sys.path.insert().

Is there an installer for geodict python library?

I wanted to use the code:
import geodict_lib
locations = geodict_lib.find_locations_in_text(text)
But there seems to be no installer for geodict_lib. How do I install this is Anaconda 3.0 Python 3?
I know this is a year on, but perhaps I could help others who stumble on this. You'll need to place the files in the directory for modules that your installation of Python is monitoring.
First, download the .zip file from GitHub here.
Once you've done that, you can run the following at the command line or terminal:
conda list
This will provide the path to all installed packages in your installation of Python. Move the geodict.zip file you downloaded to that location. You might want to run which python as well (see here) since you may have a few different installations to check for.
Now when you run python import geodict in Python it should run without trouble!

Error installing winshell (python setup.py egg_info failed with error code 1)

I'm trying to install winshell under Python 3.3.0 / Windows 7.
(I should say that I have only a fuzzy notion of how package installing works, so my apologies if I'm making a basic blunder ... this stuff clearly is not really aimed at mere mortals).
What I did was: I opened a CMD window & navigated to the Python33 directory. I typed
pip install winshell
and got "...downloading winshell 0.6 zip followed by running setup.py egg_info for package winshell...
and then I got
python setup.py egg_info failed with error code 1 (in the log file)
I've tried googling generally and in here - most of the posts are moderately incomprehensible - to me at least. There are tentative suggestions in comments to an answer that suggest I'd need to install either pwin32 or win32con. And that pwin32 can't be installed with pip. But I haven't found a definitive 'how to' for installing winshell.
Before I go down either of those rabbit holes, is it correct that, in order to install & use winshell, do I need those modules? And please point me to the best, simple, instructions for doing that.
...
This is all for the purpose of getting the target path of a shortcut as in:
path = winshell.shortcut(filethatisashortcut).path
so as to kludge os.walk to follow shortcuts (Windows, remember!). If there's a more direct method - please advise.
You need to install the pywin32 module according to the docs:
Prerequisites & Compatibility
The module has been tested on versions of Python from 2.4 to 3.2. It may
also work on older (or newer) versions. You’ll need Python 2.5+ for context
manager support. It’s tested with the most recent pywin32 extensions, but
the functionality it uses from those libraries has been in place for many
versions.
(Also looking at the modules imported in the source files, you clearly need to install Python for Windows extensions (pywin32). Don't have access to a windows machine to test, but why don't you go by the book first.)

SIP install - unable to open siplib.sbf

I'm trying to install SIP on my computer so I can proceed to get PyQt. I put the install files in a folder on my desktop ('C:\Users\User\Desktop\Programming\Sip\sip-4.15.5'). So, to install it, I ran the following commands from CMD:
cd C:\Python33
python "C:\Users\User\Desktop\Programming\Sip\sip-4.15.5\configure.py"
The version of python in 'C:\Python33' IS the one used in the command 'python'. Here's the output I got:
This is SIP 4.15.5 for Python 3.3.5 on win32.
The SIP code generator will be installed in C:\Python33.
The sip module will be installed in C:\Python33\Lib\site-packages.
The sip.h header file will be installed in C:\Python33\include.
The default directory to install .sip files in is C:\Python33\sip.
The platform/compiler configuration is win32-msvc2010.
Creating siplib\sip.h...
Creating siplib\siplib.c...
Creating siplib\siplib.sbf...
Creating sipconfig.py...
Creating top level Makefile...
Creating sip code generator Makefile...
Creating sip module Makefile...
Error: Unable to open
"C:\Users\User\Desktop\Programming\Sip\sip-4.15.5\siplib\siplib.sbf"
Now, the key lines are obviously the last two, so I looked in the appropriate folder and found that there was a rather good reason for the error: there is no "siplib.sbf." The closest it gets is "siplib.sbf.in". What on earth is going on? If this is a stupid question, please feel free to tell me so.
You must change current working directory to the sip-4.15.5 first:
cd C:\Users\User\Desktop\Programming\Sip\sip-4.15.5
python configure.py

Resources