CLR not working on 32 bit Linux
See original GitHub issueEnvironment
- Pythonnet version: 2.5.1 and also 3.0.0-dev
- Python version: 3.5.3, 2.7.13 and also 3.8.5 (from Debian repositories and also if compiled locally with --enable-shared)
- MONO Versions: 6.10, 5.16 and also 5.20
- Operating System: Linux (Debian 9 ‘stretch’ Live, i686)
Details
Pythonnet seems not to be working on a Linux 32-Bit environment (i686) at all. I tested it on a “Debian live” (USB) system in two different computers, using Python from the Debian repositories and also building python from source code, here are the results:
-
Using Python from the Debian repositories: The python execution crashes just doing
import clrSee attachment: mono_crash.4383a3eb2.0.zip, trace.txt -
Building Python from source code (with
--enable-shared):
It doesn’t crash, but clr throws an error when trying to load an assembly (“AttributeError: module ‘clr’ has no attribute ‘AddReference’”). This was reported in some places around internet, but I don’t have any clr module already installed which could cause a name collision. See output:
user@debian:~$ /opt/python/python3.5.3/bin/python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
>>> dir(clr)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'facade']
>>> str(clr)
"<module 'clr' from '/opt/python/python3.5.3/lib/python3.5/site-packages/clr.cpython-35m-i386-linux-gnu.so'>"
>>>
user@debian:~$ /opt/python/python3.5.3/bin/pip3 list
clang (11.0)
pip (9.0.1)
pycparser (2.20)
pythonnet (2.5.1)
setuptools (28.8.0)
wheel (0.35.1)
Notes
- On a x64-System it works, using the same version of Debian, Pythonnet and Python.
- If this is really a limitation of 32-Bit-Systems that cannot be fixed, it should be documented on the “readme”.
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (14 by maintainers)
Top Results From Across the Web
Developers - CLR not working on 32 bit Linux -
Notes. On a x64-System it works, using the same version of Debian, Pythonnet and Python. If this is really a limitation of 32-Bit-Systems...
Read more >MSSQL on Linux: Common Language Runtime (CLR) not ...
This installation of the Common Language Runtime (CLR) is corrupted. The CLR is installed with the Microsoft .NET Framework.
Read more >Does a CLR Class Library have to be run in Win32?
Right-click the C# project > Properties > Build tab to select the jitter you want to use. Untick the "Prefer 32-bit" checkbox for...
Read more >First Time Using Wine : r/wine_gaming
Hi Im running Ubuntu 20.04 LTS. And i installed wine and blindly copied and ... Unhandled exception: 0xe0434352 in 32-bit code (0x7b00dfa2).
Read more >Restrictions on .NET CLR routines
Running a 32-bit CLR routine on a 64-bit instance. CLR routines cannot be run on 64- bit instances, because the .NET Framework cannot...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@filmor A summary of bisecting is available here
The criteria that I used to decide if a commit was good or bad was by running the following bash script (which I named issue1210.sh) after each bisect iteration. If pytest passed then that commit was considered good.
Please let me know if you’d like further information.
@filmor have you tried with .NET Core? If the behavior is different, I would simply open a bug in Mono.