Visual C++ for python failed with exit status 1120 - mod-wsgi

I am using python2.7 and trying to host my flask app on windows server. While installing mod_wsgi , the command prompt throws the below mentioned error
error: command 'C:\Users\USER\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\link.exe' failed with exit status 1120
I tried reinstalling the visual C++ for python , but the error still persists. Any suggestions???

Please update your question with a more complete error log. You might even find something helpful by reading the error log more carefully -- The error is not in "Visual C++ for Python failing" but from the VC++ linker.
Also, instead of trying to configure mod_wsgi for Windows, you might find it easier to use wfastcgi. wfastcgi is maintained by Microsoft.

Related

OSError: WinError 193 %1 is not a valid Win32 application

I have been working on a project in Visual Studio Code with Python 3.8.5, and I have a windows 64 bit operating system. I decided to upgrade to Python 3.11.1, and downloaded the official 64 bit installer and followed the instructions. All the packages I import at the beginning of my project that were previously working now give this error "[WinError 193] %1 is not a valid Win32 application" when I run the import statements for them.
For some of the packages (pandas, numpy, matploblib) this was solved by using an approach I saw on a few similar questions to this, by opening the command prompt and typing "pip uninstall pandas" etc and then doing "pip install pandas".
However, for the other packages (sklearn, umap, nltk), this isn't working even after trying that process a few times. I've also tried updating pip. Does anybody have any ideas on what could be causing this to work for some packages but not for others? It allows me to install all of the packages via the command prompt, the issue only arises when I actually try and import them via VSCode, and it's the same error for every package. I've seen some suggestions saying to ensure the environment path is clean, but I'm still quite a beginner so I'm a bit unsure as to what that means.
Any help would be really appreciated.

OCaml Error : Fatal error: exception Cmi_format.Error(_)

I'm using OCaml on my Windows device via Cygwin. I installed Opam as well, and also ran the command
opam pin add merlin --dev-repo
because after installing the most recent OCaml for Windows the compiler ocamlc wouldn't work and some Google searching offered this solution.
The error that I got when I first tried to run ocamlc was:
Error: C:\OCaml\lib/pervasives.cmi
is not a compiled interface for this version of OCaml.
It seems to be for an older version of OCaml.
However, now whenever I type "ocaml" in the terminal, rather than getting the interactive editor I get the fatal error message:
Fatal error: exception Cmi_format.Error(_)
Does anybody know what the problem might be? Thank you.
Installed two different versions of OCaml that weren't compatible.

SCIP Python Installation Issue Windows with pip

Hello community / developers,
I am currently trying to install SCIP with python and found that there is Windows Support and a pip installer based on https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.md.
Nevertheless I run into a problem "Cannot open include file"
Below is a list of the things I performed to get to this step.
Download Python Anaconda 2.7 64 bit
Install with all checkboxes as they are
Download PyCharm Community edition
Click 64 bit desktop link, and associate with .py checkboxes
Open CMD > write: easy_install -U pip
Download Visual C++ Compiler for Python 2.7
Setup folder structure and downloaded header files
CMD > pip install pyscipopt leads to error:
C:\Users\UserName\Downloads\SCIPOPTDIR\include\scip/def.h(32) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\Users\UserName\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
My environment variables and folder directory can be found here:
http://imgur.com/a/mJRva
Help is very much appreciated,
Kind regards
The error message says your missing "stdint.h". This is because you don't have a recent Visual Studio version. You probably use the one that came with your Python installation. Try installing the latest Visual Studio to fix this issue.
You might want to look at this question:
Why Microsoft Visual Studio cannot find <stdint.h>?
PySCIPOpt needs a C/C++ linker to build the Python module - although it's already precompiled on PyPI.
Alright, I figured it out. I needed to
(1) Install Python 3.6 instead of Python 2.7 (both Anaconda)
(2) Afterwards pip installation worked
(3) I moved the library files in the lib folder
(4) Now I can execute the examples.
Interestingly, I get an unresolved reference error although the code works fine (I assume this is a bug of Pycharm/scipy?) Link to picture: https://www.dropbox.com/s/d8pf6dkwuz9cwto/scip_python.png?dl=0

apache2 mod_wsgi crashes when importing pyodbc

Operating system - Ubuntu Server 14.04 on Azure VM
Tried with different versions of python (3.4.3, 3.6.0), apache and mod_wsgi.
Installed MS Native ODBC driver using instructions from here
https://gist.github.com/joecampo/6f777a659b8132b9d6fe1c3589df394c , while pyodbc was installed using pip.
To debug the wsgi_module I have set up the django application to run in embedded mode and:
gdb /usr/local/apache2/bin/httpd
run -X
When I access any function which imports pyodbc, the wsgi fails with the following error:
Program received signal SIGSEGV, Segmentation fault.
import_types () at src/pyodbcmodule.cpp:223
223 src/pyodbcmodule.cpp: No such file or directory.
Importing module works fine when I run the django app from the command line:
python3 manage.py runserver
Is there a workaround?
I experienced the same problem when setting up a Python Pyramid project, and downgrading to a previous version of pyodbc fixed it.
It looks like this may be a bug in pyodbc or the WSGI module. See pyodbc 4.0.9+ segfault with uwsgi #199. You may already be aware that this line is a red herring:
223 src/pyodbcmodule.cpp: No such file or directory.
That error is coming from the debugger and just tells where in import_types() the exception was raised, however searching for that file led me to that bug report on GitHub.
You obviously already know how to debug Apache and wsgi, but for anyone who doesn't there are detailed instructions here.
This has been fixed in 4.0.16 by adding support for subinterpreters.

webRTC compilation windows 7 64 bit

I am trying to compile the webRTC code but I get the following error.
I am not trying with Visual Studio.
The error got is <PATH>/src/buildtools/win/gn.exe cannot start because of incompatibility of 64 bit windows version. The confusion is I am compiling on Windows 7 64 bit. The error is confusing to say the least.
Steps followed are :-
Unzipping the depot_tools from the chromium webpage and setting up the correct path.
Then for downloading the webRTC and compilation the steps were
mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc
gclient sync
gn gen out/Default < The problem arises here >
We would need the entire trace of all the python script to give you a full answer, but it is VERY likely that you need to have MSVC 2015 (14) installed and to set the corresponding environment variable DEPOT_TOOLS_WIN_TOOLCHAIN=0. The scripts will otherwise stop working with cryptic error messages, even before the compilation. It fits your "symptoms".
See this for more answers (chromium and webrtc build instructions are shared):
https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
If you copy paste the trace form the python scripts here, I might be able to help you more.