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.

Symbol not found: __PyThreadState_Current

See original GitHub issue

In an attempt to run the Sycamore depth 12 example, I’ve run into the following exception:

Traceback (most recent call last):
  File "test_cotengra.py", line 40, in <module>
    info = tn.contract(all, optimize=opt, get='path-info', output_inds=[])
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/quimb/tensor/tensor_core.py", line 3141, in contract
    return tensor_contract(*self, **opts)
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/quimb/tensor/tensor_core.py", line 315, in tensor_contract
    path_info = get_contraction(eq, *ops, path=True, **contract_opts)
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/quimb/tensor/tensor_core.py", line 110, in get_contraction
    return fn(eq, *shapes, **kwargs)
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/quimb/tensor/tensor_core.py", line 78, in _get_contract_path
    return oe.contract_path(eq, *shapes, shapes=True, **kwargs)[1]
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/opt_einsum/contract.py", line 259, in contract_path
    path = path_type(input_sets, output_set, dimension_dict, memory_arg)
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/cotengra/hyper.py", line 347, in __call__
    for trial in trials:
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/tqdm/std.py", line 1129, in __iter__
    for obj in iterable:
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/cotengra/hyper.py", line 312, in _gen_results_parallel
    yield self.get_and_report_next_future()
  File "/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/cotengra/hyper.py", line 296, in get_and_report_next_future
    trial = future.result()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
ImportError: dlopen(/Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/kahypar.cpython-37m-darwin.so, 2): Symbol not found: __PyThreadState_Current
  Referenced from: /Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/kahypar.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Users/david/Develop/cotengra/tensor/lib/python3.7/site-packages/kahypar.cpython-37m-darwin.so

Helpful info: OS: macOS Catalina $PYTHONPATH: /Users/david/Library/Python/3.7/lib/python

I’ve tried changing my environment variables and editing the CMake of kahypar such that CC=clang, CXX=clang++ and, as a sanity check, to CC=gcc, CXX=g++ – taking care to uninstall and reinstall the kahypar python bindings with pip each time.

Any insight would be much appreciated.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
aneksteindcommented, May 8, 2020

I also installed using pypi, I will try and separate the two and update with any progress to rule out building kahypar from source

0reactions
jcmgraycommented, May 12, 2020

Glad you were able to get it fixed- thanks for keeping this issue updated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does "Symbol not found / Expected in: flat namespace ...
It means the symbol wasn't found. · @immibis I think that gcc expected gcc code and it found clang code instead, and that...
Read more >
Symbol not found error while importing tensorflow in M1 ...
Hello there, I have installed tensorflow in my M1 Macbook Pro using these commands in a conda environment: conda install -c apple tensorflow-deps ......
Read more >
Cffi Module Built But Not Found On Import - ADocLib
This is about getting an ImportError about cffibackend.so with a message like Symbol not found: PyUnicodeUCS2AsASCIIString.This error occurs in Python 2.
Read more >
osx/pvpython: Symbol not found: _PyObject_GenericGetAttr
On osx with conda (python 3.6/3.7/3.8), paraview Python modules are imported successfully while pvpython fails to run with the following ...
Read more >
Symbol not found: _ffi_prep_closure on Apple Silicon with ...
python -VV Python 3.9.6 (default, Jul 12 2021, 18:23:45) [Clang 12.0.5 (clang-1205.0.22.9)] $ pip install bcrypt -U Collecting bcrypt Using ...
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