-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
installation issue: can't find pythemis on macOS M1 with non-brew way of installing python #913
Comments
thank you @AikakiAdmin, we will take a look on M1 installation. maybe openssl installation path? 🤔 |
@AikakiAdmin could you please provide step by step commands and their outputs that you are running? We have tested the following on M1 with macOS 12.3.1 (21E258) according to the installation instructions. Installing themis
Generating keys
that's working on our side. Let's try to find the difference. |
aikaki@Vijays-MacBook-Pro documents % brew tap cossacklabs/tap ==> Tapping cossacklabs/tap |
It seems you installed later version of the python using brew. My python site package in not writeable |
Okay... so the library seems to be at least loaded, right? Could you please do import ctypes.util
print(ctypes.util.find_library('libthemis')) which is how PyThemis locats the native library. This should print out the following path:
(which is normally a symlink into homebrew's cellar) If it's something else, this means Python is probably loading not the library it should load. However, if it is that path, let's check the library symbols:
if there is no At the moment I can't find any known issues in Python library loading & name resolution in |
code is returning None, which mean it is not getting the library. so a path problem. ikaki@Vijays-MacBook-Pro themis % nm -gU /opt/homebrew/lib/libthemis.dylib |
library is present aikaki@Vijays-MacBook-Pro documents % cd /opt/homebrew/lib/ |
added path also but same output "None" for the code you suggested. Any idea how libraries are searched in Mac? aikaki@Vijays-MacBook-Pro ~ % echo $PATH |
This problem is resolved when installed python using brew. My confusion is if I need to package Themis in docker, what step I need in Dockerfile aikaki@Vijays-MacBook-Pro themis % python3 securecell.py |
Uh-huh... Thanks, noted your observation. I believe we should add some check for I guess, homebrew's Python has homebrew paths baked into it, while with non-brew Python you wouldn't get
There is You can also tweak the native library search paths via |
Like, with macOS in Docker?.. 🤔 If you use a Linux-based image for Docker, there are Themis packages for some distros (Fedora, CentOS, Ubuntu, Debian – not for Alpine though, that one you'd likely need to build from source). If you use Python from the distro's package repositories, Themis packages should work with it fine: |
I already built a docker image which uses fast api frame work and I want
add some encryption as part of APIs. I am in love with Themis for its
simplicity of use and light weight. Let me see how we can go to next step.
For now issue is closed.
…On Sat, 16 Apr 2022 at 7:21 PM, Oleksii Lozovskyi ***@***.***> wrote:
if I need to package Themis in docker, what step I need in Dockerfile
Like, with *macOS* in Docker?.. 🤔
If you use a Linux-based image for Docker, there are Themis packages for
some distros
<https://docs.cossacklabs.com/themis/installation/installation-from-packages/>
(Fedora, CentOS, Ubuntu, Debian – not for Alpine though, that one you'd
likely need to build from source).
If you use Python from the distro's package repositories, Themis packages
should work with it fine: yum/apt/rpm them after adding Cossack Labs'
repositories.
—
Reply to this email directly, view it on GitHub
<#913 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN67P53HABTJW3PN3MJL2TDVFLAXBANCNFSM5TQAMW2Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Describe the bug
I am trying to use Themis using python on MacOS
I installed brew first and followed the instructions. but I am not able to run the code and following error is occurring everytime, what could be be cause of this behaviour.?
Error
File "securecell.py", line 4, in
master_key = GenerateSymmetricKey()
File "/Users/aikaki/Documents/Python Programs/themis/venv/lib/python3.8/site-packages/pythemis/skeygen.py", line 71, in GenerateSymmetricKey
res = themis.themis_gen_sym_key(None, byref(key_length))
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/init.py", line 378, in getattr
func = self.getitem(name)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/init.py", line 383, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, themis_gen_sym_key): symbol not found
Expected behavior
I was expecting the code to run smoothly
Environment (please complete the following information):
-(https://docs.cossacklabs.com/themis/languages/python/installation/)
The text was updated successfully, but these errors were encountered: