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.

ImportError with import hashlib.py

See original GitHub issue

I get this error when running the examples: Traceback (most recent call last): File "/home/d.baburin/work/cocotb/cocotb/__init__.py", line 37, in <module> import random File "/usr/lib64/python2.7/random.py", line 49, in <module> import hashlib as _hashlib File "/usr/lib64/python2.7/hashlib.py", line 116, in <module> import _hashlib ImportError: /usr/lib64/libssl.so.10: symbol private_ossl_minimum_dh_bits, version libcrypto.so.10 not defined in file libcrypto.so.10 with link time reference Failed to load "cocotb" ` I have Centos 7 and Cadence Xcelium simulator (new version of Cadence IUS).

As far as I understand it requires earlier version for openssl. My version 1.0.2k and in /lib64/ libssl.so.10 and libcrypto.so.10 symlinks links on 1.0.2k version files. When I change simlinks on previous version - 0.9.8e, I got next error( but simulation was started): Traceback (most recent call last): File "/usr/libexec/abrt-action-ureport", line 11, in <module> import augeas File "/usr/lib/python2.7/site-packages/augeas.py", line 43, in <module> import ctypes.util File "/usr/lib64/python2.7/ctypes/util.py", line 89, in <module> import re, tempfile, errno File "/usr/lib64/python2.7/tempfile.py", line 35, in <module> from random import Random as _Random File "/usr/lib64/python2.7/random.py", line 49, in <module> import hashlib as _hashlib File "/usr/lib64/python2.7/hashlib.py", line 116, in <module> import _hashlib ImportError: /usr/lib64/python2.7/lib-dynload/_hashlib.so: symbol HMAC_CTX_copy, version libcrypto.so.10 not defined in file libcrypto.so.10 with link time reference

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
martijnbastiaancommented, Jul 7, 2021

Alternatively, if you don’t want or cannot change your Xcelium distribution you can patch these lines:

https://github.com/cocotb/cocotb/blob/4946a08d744f2b96ca0e85d62efba3203710da10/cocotb/share/makefiles/simulators/Makefile.xcelium#L110-L112

Splicing an extra line LD_PRELOAD="/lib64/libcrypto.so.10 /lib64/libssl.so.10" \ in between such that it reads:

	MODULE=$(MODULE) TESTCASE=$(TESTCASE) TOPLEVEL=$(TOPLEVEL) GPI_EXTRA=$(GPI_EXTRA) TOPLEVEL_LANG=$(TOPLEVEL_LANG) \
	LD_PRELOAD="/lib64/libcrypto.so.10 /lib64/libssl.so.10" \
	$(CMD) -timescale $(COCOTB_HDL_TIMEUNIT)/$(COCOTB_HDL_TIMEPRECISION) \
	$(EXTRA_ARGS) $(GPI_ARGS) $(INCDIRS) -access +rwc -createdebugdb $(MAKE_LIB) $(HDL_SOURCES) $(PLUSARGS) 2>&1 | tee $(SIM_BUILD)/sim.log

seems to work for me.

0reactions
flamehjcommented, Sep 18, 2018

Thanks, @stuarthodgson, @jrpetrus! It really works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError with import hashlib.py · Issue #644 - GitHub
I have Centos 7 and Cadence Xcelium simulator (new version of Cadence IUS). As far as I understand it requires earlier version for...
Read more >
Unable to import "hashlib" - Stack Overflow
hashlib is a new module/library in python 2.5 the server certainly run python 2.4 or earlier.
Read more >
#668 (Can't import hashlib on python 2.4) – Bcfg2
Looks like we're importing hashlib without checking if we are running in a new enough ... line 5, in ? import hashlib ImportError:...
Read more >
ImportError: No module named _md5 - Please help
Hi,. I am trying to run a python script and got this error. >>import _md5 >>ImportError: No module named _md5. Googling the problem...
Read more >
why the Python can be ran by alert, but can not ran manually
Solved: I have a script that can be ran with alert, but if I run the script manually, the following error will showed....
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