quantum icon indicating copy to clipboard operation
quantum copied to clipboard

got error when import tensorflow_quantum as tfq

Open Piggy-hammer opened this issue 1 year ago • 4 comments

when I trying to do import tensorflow_quantum as tfq

I got error like:

NotFoundError: /home/miniconda3/envs/municipal/lib/python3.9/site-packages/tensorflow_quantum/core/ops/_tfq_simulate_ops.so: undefined symbol: _ZNK10tensorflow8OpKernel11TraceStringERKNS_15OpKernelContextEb

What should I do? My package lists are: python=3.9.0 tensorflow=2.7.0 cirq=0.13.1 tensorflow-quantum=0.6.1

Piggy-hammer avatar May 18 '23 04:05 Piggy-hammer

Usually, my go to advice is just to do a fresh environment with a fresh install. I have encountered a myriad of installation issues (as have others: https://github.com/tensorflow/quantum/issues/602, https://github.com/tensorflow/quantum/issues/714, https://github.com/tensorflow/quantum/issues/180, https://github.com/tensorflow/quantum/issues/711, https://github.com/tensorflow/quantum/issues/571), almost all of which have been solved by completely starting from scratch in a new environment. If the issues persists even in this environment, you can post more details on your setup (OS, other package versions, other TF installations, etc.) and it can progress from there.

lockwo avatar May 18 '23 05:05 lockwo

How did you install tensorflow 2.7.0? I receive "ERROR: Could not find a version that satisfies the requirement tensorflow==2.7.0 (from versions: 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0, 2.11.1, 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.13.0rc0, 2.13.0rc1) ERROR: No matching distribution found for tensorflow==2.7.0" every time I try to install that version on MacOS, Linux, and Windows on Python 3.9, 3.10, and 3.11.

owenonline avatar Jun 08 '23 10:06 owenonline

That's odd, it just worked by default for me. I use Python 3.8 but 3.9 should be supported, and I've done this on Mac and Linux. I would make an issue on tensorflow repo page about this issue, since they probably know a lot more than I do about these issues relating to TF.

lockwo avatar Jun 08 '23 15:06 lockwo

Duplicate of #798

knottyanyon avatar Sep 22 '23 13:09 knottyanyon