IRISPIP Cryptodome C++ Error
Hello,
I need AES ECB with PKSC7 padding for an interface.
Unfortunately, the %SYSTEM.Encryption.AESEncode cannot do this.
Therefore I wanted to include the following python lib.
PyCrptydome -> https://pycryptodome.readthedocs.io/en/latest/index.html
We need to install the package offline on the system. So I downloaded it and put it in the MGR/Python/ directory.
However, when I try to install it, I get the following error message:
E:\HealthConnect\20201\bin>irispip install E:\HealthConnect\20201\Mgr\python\pycryptodome-3.18.0.tar.gz --target E:\HealthConnect\20201\Mgr\python pycryptodomex --no-binary :all
Processing e:\healthconnect\20201\mgr\python\pycryptodome-3.18.0.tar.gz
ERROR: Command errored out with exit status 1:
command: 'e:\healthconnect\20201\lib\python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Srv_KomServ03\\AppData\\Local\\Temp\\pip-req-build-9o3bv5i5\\setup.py'"'"'; __file__='"'"'C:\\Users\\Srv_KomServ03\\AppData\\Local\\Temp\\pip-req-build-9o3bv5i5\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Srv_KomServ03\AppData\Local\Temp\pip-pip-egg-info-1gqloa2j'
cwd: C:\Users\Srv_KomServ03\AppData\Local\Temp\pip-req-build-9o3bv5i5\
Complete output (20 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Srv_KomServ03\AppData\Local\Temp\pip-req-build-9o3bv5i5\setup.py", line 488, in <module>
set_compiler_options(package_root, ext_modules)
File "C:\Users\Srv_KomServ03\AppData\Local\Temp\pip-req-build-9o3bv5i5\compiler_opt.py", line 327, in set_compiler_options
clang = compiler_is_clang()
File "C:\Users\Srv_KomServ03\AppData\Local\Temp\pip-req-build-9o3bv5i5\compiler_opt.py", line 251, in compiler_is_clang
return test_compilation(source, msg="clang")
File "C:\Users\Srv_KomServ03\AppData\Local\Temp\pip-req-build-9o3bv5i5\compiler_opt.py", line 82, in test_compilation
objects = compiler.compile([fname], extra_postargs=extra_cc_options)
File "e:\healthconnect\20201\mgr\python\setuptools\_distutils\_msvccompiler.py", line 343, in compile
self.initialize()
File "e:\healthconnect\20201\mgr\python\setuptools\_distutils\_msvccompiler.py", line 253, in initialize
vc_env = _get_vc_env(plat_spec)
File "e:\healthconnect\20201\mgr\python\setuptools\msvc.py", line 210, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
File "e:\healthconnect\20201\mgr\python\setuptools\msvc.py", line 164, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Testing support for clang
----------------------------------------
WARNING: Discarding file:///E:/HealthConnect/20201/Mgr/python/pycryptodome-3.18.0.tar.gz. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
However, the required C++ version is installed on this system: See screenshot
.png)
Can someone explain what I am doing wrong? Or is it the offline install? Is it also possible that the Python version in IRIS is out of date?
Kind regards
Armin
Comments
Why are you building from source? Use wheels:
.\irispip install https://files.pythonhosted.org/packages/3f/a1/72ad8fbeb2630e74fa89622ab24ec0ce46dc93dc172156f1a112eb76c014/pycryptodome-3.18.0-cp35-abi3-win_amd64.whl --target C:\InterSystems\IRIS\mgr\pythonThe System has no internet connection.
Download wheel from a computer that does have internet connection and transfer the wheel file into the target system somehow.
When I try to do this, it still tries to connect to the Internet. This then ends in a timeout.
E:\HealthConnect\20201\bin>.\irispip install E:\HealthConnect\20201\Mgr\python\pycryptodome-3.18.0-cp35-abi3-win_amd64.whl --target e:\HealthConnect\20201\Mgr\python pycryptodomex --no-binary :all
Processing e:\healthconnect\20201\mgr\python\pycryptodome-3.18.0-cp35-abi3-win_amd64.whl
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'Eine vorhandene Verbindung wurde vom Remotehost geschlossen', None, 10054, None))': /simple/pycryptodomex/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'Eine vorhandene Verbindung wurde vom Remotehost geschlossen', None, 10054, None))': /simple/pycryptodomex/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'Eine vorhandene Verbindung wurde vom Remotehost geschlossen', None, 10054, None))': /simple/pycryptodomex/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'Eine vorhandene Verbindung wurde vom Remotehost geschlossen', None, 10054, None))': /simple/pycryptodomex/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'Eine vorhandene Verbindung wurde vom Remotehost geschlossen', None, 10054, None))': /simple/pycryptodomex/
ERROR: Could not find a version that satisfies the requirement pycryptodomex (from versions: none)
Try adding --no-index
Thanks, one step further
Processing e:\healthconnect\20201\mgr\python\pycryptodome-3.18.0-cp35-abi3-win_amd64.whl
ERROR: Could not find a version that satisfies the requirement pycryptodomex (from versions: none)
ERROR: No matching distribution found for pycryptodomex
First install pycryptodomex wheel.
Hello Eduard,
Thanks for the feedback, but unfortunately I don't really understand how I can realise this. I am still quite inexperienced with the topic of wheels and Python.
Could you give me some more information here?
I thought the "irispip install *.whl" would install the wheel file.
kind regards
Armin
I thought the "irispip install *.whl" would install the wheel file.
That is correct. Download pycryptodomex wheel same as you downloaded pycryptodom wheel, thansfer it to your server and try to install first pycryptodomex, then pycryptodom.
Hi Eduard,
Thanks, then I am not completely wrong after all :)
my understanding is that the CryptodomeX is the same package as the Cryptodome package.
The difference is that the Cryptodomex package must be addressed as "Cryptodome" in the code. And without this parameter the package can be used as a "fork" for the Crypto package. Therefore it can be called later as "crypto".
See: https://pycryptodome.readthedocs.io/en/latest/src/installation.html
Hi Eduard,
another step further...
The installation worked. but the error with cryptodomex is still present.
It doesn't matter, the functionality should still be there.
Thanks for your help.
E:\HealthConnect\20201\bin>irispip install e:\HealthConnect\20201\Mgr\python\pycryptodome-3.18.0-cp35-abi3-win_amd64.whl --target e:\HealthConnect\20201\Mgr\python\ pycryptodome --no-binary :all --no-index
Processing e:\healthconnect\20201\mgr\python\pycryptodome-3.18.0-cp35-abi3-win_amd64.whl
Installing collected packages: pycryptodome
Successfully installed pycryptodome-3.18.0E:\HealthConnect\20201\bin>irispip install e:\HealthConnect\20201\Mgr\python\pycryptodome-3.18.0-cp35-abi3-win_amd64.whl --target e:\HealthConnect\20201\Mgr\python\ pycryptodomex --no-binary :all --no-index
Processing e:\healthconnect\20201\mgr\python\pycryptodome-3.18.0-cp35-abi3-win_amd64.whl
ERROR: Could not find a version that satisfies the requirement pycryptodomex (from versions: none)
ERROR: No matching distribution found for pycryptodomex
With kind regards
Armin