Comments (7)
I found that this suggestion from Graham Dumpleton solved my problem with server hanging at import clr
when using mod-wsgi==4.6.4+ap24vc14
on Python 3.6.5.
https://stackoverflow.com/a/4236503
Set:
WSGIApplicationGroup %{GLOBAL}
See the application issues document on mod_wsgi wiki.
Most likely you have an extension module not designed to work in sub interpreter. The above forces it to run in main interpreter.
from pythonnet.
Hi!, exists some solution for this issue? or alternate solution? In my enviroment i have (pip freeze):
Django==1.7.10
django-braces==1.8.1
django-filter==0.11.0
django-mssql==1.7
django-oauth-toolkit==0.9.0
djangorestframework==3.3.1
Markdown==2.6.5
oauthlib==1.0.1
pythonnet==2.0.0
pywin32==219
requests==2.8.1
six==1.10.0
virtualenv==13.1.2
And run with mod_wsgi 4.4.12, python 2.7.11, apache 2.4 on windows server 2012. I think maybe if i use other connector or other web server can function well, because if i remove 'import clr' from my code in Django, Apache+WSGI are well and all function correct, but if i add 'import clr' webserver doesn't anything, logs are empty and server is without errors. And if using django runserver, all function well.
Any idea?
from pythonnet.
@eisenheimjelid I had to use IronPython with subprocess
import subprocess
target = ["~/path/to/IronPython27/ipy.exe", "~/path/to/my_dotnet_app.py", "arg0", "arg1", ...]
retval = subprocess.check_output(target, universal_newlines=True)
a little slow depending on your machine, but works fine.
For Windows you will need .NET and for Linux/Darwin you will need Mono
on Ubuntu:
sudo apt-get install mono-complete
from pythonnet.
Thank you @mikofski but that not is my better solution.
Because i use DLL and i require keep open connection with other program on Windows, if i use EXE like function on subprocess (hi.exe args...) imply for each operation send will open and close connection with that program; so will be really slow.
I will search other solution, but 'subprocess' will be my plan b.
So, thanks. Best regards.
PD. The DLL what i use is related with SAP BO, SAP SDK DI API.
from pythonnet.
from pythonnet.
@mikofski @eisenheimjelid why would you use .NET from Flask/Django app?
from pythonnet.
I needed to use a particular .NET assembly that communicated with an ASP.NET framework to get some data from a MSSQL server. I did not have access to the database directly, nor could I use the ASP.NET framework from Python. It was a black box, and all I was given was the DLL with exposed methods like GetWeatherDataHeader()
etc. I used subprocess in the interim and we eventually replaced the entire framework with all Django and PostgreSQL on Linux. So no more need for Python.NET on this project. But there are always others.
from pythonnet.
Related Issues (20)
- PyObject.FromManagedObject(value); does not convert C# bool to Python bool HOT 2
- Importing from DLL works only when namespace != assembly name
- What is the best practice for packaging Python in your application?
- InterfaceObjects cannot address properties outside their declaration HOT 2
- Add to the docs that runtimeconfig.json from a self-contained project is not supported HOT 1
- The model slows down on GPU
- Performance question on List conversion from python to c#.
- Update documentation to reflect API changes HOT 2
- Error line only refers to main code, not imported code from external file HOT 1
- Initialization Error in .NET 8.0.4 HOT 1
- can we have a new release? HOT 2
- Check if the C# methods I am calling within my Python scripts are valid?
- Trying to load a assembly with embedded Assembly inside
- Memory Access Violation - Python Net 3.0.2 - Multi-threaded Dot Net application
- Python Virtual Environment throws error with Python Net 3.0.2
- PythonNet on .NET CORE crashes in IIS HOT 2
- Error when using GridSearchCV n_jobs=-1
- Disable CLR (and related) imports & attempt to isolate the Python environment from the .NET world
- Error with pythonnet just trying to import clr HOT 1
- Redirect Console.Write log to file live from .NET Framwork library
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythonnet.