You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to import crl with python 3.10 - 32bit #1617
Pythonnet Version:
Requirement already satisfied: pythonnet in c:\users\hossa\appdata\local\programs\python\python310-32\lib\site-packages\pythonnet-3.0.0.dev1-py3.10.egg (3.0.0.dev1)
Requirement already satisfied: clr_loader in c:\users\hossa\appdata\local\programs\python\python310-32\lib\site-packages\clr_loader-0.1.6-py3.10.egg (from pythonnet) (0.1.6)
Requirement already satisfied: cffi>=1.13 in c:\users\hossa\appdata\local\programs\python\python310-32\lib\site-packages (from clr_loader->pythonnet) (1.15.0)
Requirement already satisfied: pycparser in c:\users\hossa\appdata\local\programs\python\python310-32\lib\site-packages (from cffi>=1.13->clr_loader->pythonnet) (2.21)
Python version:3.10.0
Operating System: windows 10
.NET Runtime:
v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation 3.0.6920.4902
v3.5 3.5.30729.4926
Client 4.8.04084
Full 4.8.04084
Client 4.0.0.0
Details
import clr
gives the following error:
Traceback (most recent call last):
File "C:\Users\hossa\git\Research\Riz\clrstuff.py", line 1, in <module>
import clr
File "C:\Users\hossa\AppData\Local\Programs\Python\Python310-32\lib\site-packages\pythonnet-3.0.0.dev1-py3.10.egg\clr.py", line 6, in <module>
load()
File "C:\Users\hossa\AppData\Local\Programs\Python\Python310-32\lib\site-packages\pythonnet-3.0.0.dev1-py3.10.egg\pythonnet\__init__.py", line 43, in load
if func(''.encode("utf8")) != 0:
File "C:\Users\hossa\AppData\Local\Programs\Python\Python310-32\lib\site-packages\clr_loader-0.1.6-py3.10.egg\clr_loader\wrappers.py", line 20, in __call__
return self._callable(ffi.cast("void*", buf_arr), len(buf_arr))
RuntimeError: cannot call null pointer pointer from cdata 'int(*)(void *, int)'
It could matter in the sense that I don't have a 32bit system to test with, so I can just test a 64bit Windows with a 32bit Python installation, and that doesn't exhibit the problem that you are seeing.
It could be that this was fixed in pythonnet/clr-loader#15, so clr-loader 0.1.7. Please try to upgrade this package (pip install -U clr-loader) and reopen if that doesn't fix the issue.
could you pls share you address this issue with more details,
i still have this issue and pending my development for days.. File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\pythonnet\__init__.py", line 143, in load if func(b"") != 0: File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\clr_loader\types.py", line 64, in __call__ return self._callable(ffi.cast("void*", buf_arr), len(buf_arr)) RuntimeError: cannot call null pointer pointer from cdata 'int(*)(void *, int)'
after I copy the clr_loader folder to the project folder, I got the same error :
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "clr.py", line 6, in
File "pythonnet_init.py", line 143, in load
File "clr_loader\types.py", line 64, in call
return self._callable(ffi.cast("void*", buf_arr), len(buf_arr))
RuntimeError: cannot call null pointer pointer from cdata 'int(*)(void *, int)'
Activity
CommonCrisis commentedon Nov 22, 2021
If you read the docs you can see that pythonnet is only working for <=Python3.8.
#1389
filmor commentedon Nov 22, 2021
Well, the master branch (that the pythonnet-3.0 is built from) should support 3.9 and 3.10, but I can't reproduce this particular error.
riz-hossain commentedon Nov 22, 2021
filmor commentedon Nov 22, 2021
It could matter in the sense that I don't have a 32bit system to test with, so I can just test a 64bit Windows with a 32bit Python installation, and that doesn't exhibit the problem that you are seeing.
filmor commentedon Dec 22, 2021
It could be that this was fixed in pythonnet/clr-loader#15, so
clr-loader 0.1.7. Please try to upgrade this package (pip install -U clr-loader) and reopen if that doesn't fix the issue.mohammadjavadqazi commentedon Apr 19, 2022
Still has same problem 32bit Windows 10
Python 3.10.0
Clr_loader 0.1.7
mohammadjavadqazi commentedon Apr 25, 2022
update .NET and solved.
Yuangang0101 commentedon Oct 18, 2022
could you pls share you address this issue with more details,
i still have this issue and pending my development for days..
File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\pythonnet\__init__.py", line 143, in load if func(b"") != 0: File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\clr_loader\types.py", line 64, in __call__ return self._callable(ffi.cast("void*", buf_arr), len(buf_arr)) RuntimeError: cannot call null pointer pointer from cdata 'int(*)(void *, int)'tony950309 commentedon Jan 16, 2023
Hi, did you solve the problem?
I am using :
python 3.7.11
windows 10 64bits
Clr_loader 0.1.7
everything is okay while running in pycharm, but after I pack up the script in pyinstaller, I got the error:
cannot load library ...\clr_loader\ffi\dlls\amd64\ClrLoader.dll': error 0x7e
after I copy the clr_loader folder to the project folder, I got the same error :
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "clr.py", line 6, in
File "pythonnet_init.py", line 143, in load
File "clr_loader\types.py", line 64, in call
return self._callable(ffi.cast("void*", buf_arr), len(buf_arr))
RuntimeError: cannot call null pointer pointer from cdata 'int(*)(void *, int)'
stansotn commentedon Apr 27, 2023
I am seeing this issue with pyinstaller on python3.9; @tony950309 were you able to find a workaround?
Josef-Haupt commentedon May 24, 2023
I also get the same error after building with pyinstaller:
clr-loader 0.2.5
pythonnet 3.0.1
python 3.10.10
I have no idea what the problem is, since it works on my win11 machine, but won't on another and I did not install any additional .NET dependencies.
Is there a workaround? Or do you need more info? I see this issue is closed, but seems to be an ongoing problem.
x011 commentedon May 25, 2023
The problem seems to be related to an outdated
hook-clr.pyfrompyinstaller-hooks-contrib, updatingpyinstaller-hooks-contribsolved my problem.pip install --upgrade --force-reinstall pyinstaller-hooks-contribdaogework commentedon May 30, 2023
I faced this problem in venv,without venv no problem,and nothing to do with py310 or py311