\_tfq_simulate_ops.so not found while import tensorflow_quantum

2k Views Asked by At

Trying import of initial libraries related to tensorflow_quantum:

import tensorflow as tf
import tensorflow_quantum as tfq

import cirq
import sympy
import numpy as np
Getting error in 2nd line:

  File "Path_to_anaconda_site_packages\tensorflow_core\python\framework\load_library.py", line 61, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)

NotFoundError: Path_To_Tensorflow_Quantum\core\ops\_tfq_simulate_ops.so not found
3

There are 3 best solutions below

0
On

This is the solution provided by the Tensorflow team, it worked for me.

!pip install tensorflow-gpu==2.1.0
!pip install cirq==0.7.0 pathos==0.2.5 tensorflow-quantum==0.2.0
1
On

Do following steps:

!pip uninstall tensorflow
!pip install tensorflow

then restart runtime to import the packages.It works.

0
On

This might be something that would be worth raising as an issue on the TensorFlow Quantum Github here (https://github.com/tensorflow/quantum/issues). Without much information on the platform your are using or even what python version you have it might be hard to diagnose the problem here, but a quick fix you could try might be that you have an older version of TensorFlow installed. TensorFlow Quantum requires tf == 2.1.0.

pip install --upgrade pip
pip install --upgrade tensorflow

If that doesn't do it, then it might be worth opening an issue on github and giving a few more details on there :)