question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import of SnowflakeOCSPAsn1Crypto crashes Python

See original GitHub issue

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using (python --version)?

Python 3.7.5

  1. What operating system and processor architecture are you using (python -c 'import platform; print(platform.platform())')?

Darwin-19.0.0-x86_64-i386-64bit

  1. What are the component versions in the environment (pip list)?

see attached log file

  1. What did you do? If possible, provide a recipe for reproducing the error. A complete runnable program is good.

from snowflake.connector.ocsp_asn1crypto import SnowflakeOCSPAsn1Crypto as SFOCSP

see attached log file for the complete process

  1. What did you expect to see?

  2. What did you see instead?

Python process crashes

  1. Can you set logging to DEBUG and collect the logs? log.txt

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
aydumoulincommented, Jul 20, 2020

@smtakeda this issue surfaced again with Big Sur beta

Stack is the following

  • python 3.7.6
  • Darwin-20.0.0-x86_64-i386-64bit
  • openssl 1.1
  • cffi==1.13.2
  • snowflake-connector-python==2.2.9

Same means of reproducibility as @ms32035 experienced

Also results in

~/.pyenv/versions/3.7.6/lib/python3.7/site-packages/oscrypto/_mac/_security_cffi.py in <module>
    237 security_path = find_library('Security')
    238 if not security_path:
--> 239     raise LibraryNotFoundError('The library Security could not be found')
    240
    241 Security = ffi.dlopen(security_path)

LibraryNotFoundError: The library Security could not be found

This fails locally

python -c 'from ctypes.util import find_library; assert find_library("c")'

But will work in

docker run 3.7-slim-stretch python -c 'from ctypes.util import find_library; assert find_library("c")'

Sounds like cmake’s find_library is on the loose on Big Sur

Some talk on it in oscrypto

Okay I fixed it using oscryto’s master. I recommend bumpiog the dependency to oscrypto once it’s shipped to pypi

pip install --upgrade git+https://github.com/wbond/oscrypto
1reaction
ms32035commented, Nov 14, 2019

ok, the warning was just covering up the actual problem. Traced the issue to be caused by this https://forums.developer.apple.com/thread/119429

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import crashes Python in script but works in jupyter console ...
I have installed fbprophet with the latest version of Anaconda (conda 4.5.2, python 3.6.5) on Windows 10. Everything works when used in ...
Read more >
snowflake-connector-python - PyPI
Fix default ssl_context options; Pin more dependencies for Python Connector; Fix import of SnowflakeOCSPAsn1Crypto crashes Python on MacOS Catalina ...
Read more >
FAQ: Why does Python crash when importing arcpy from the ...
Answer. After upgrading from ArcGIS Pro 2.3 to 2.4, an issue has been reported where Python crashes when importing arcpy into the Command...
Read more >
Issue 46070: [subinterpreters] crash when importing _sre in ...
On Python 3.10, the re module is no longer imported by "import importlib.util". The crash is random. Sometimes, I need 3 or 4...
Read more >
Cannot import name 'SnowflakeOCSPAsn1Crypto' from ...
I was just trying a small dbt sample project with dbt 0.20.1 against my Snowflake db to test a bug that exists in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found