quantum icon indicating copy to clipboard operation
quantum copied to clipboard

That sounds like the issues I linked. Colabs default Python version isn’t supported.

Open anikde opened this issue 1 year ago • 7 comments

          That sounds like the issues I linked. Colabs default Python version isn’t supported.

Originally posted by @lockwo in https://github.com/tensorflow/quantum/issues/768#issuecomment-1535598819

anikde avatar Jun 16 '23 05:06 anikde

It's true, the default version of python isn't supported. I came to an understanding that tensorflow_quantum works is compatible with python 3.8. So I installed python3.8 in google colab with help of an issue in tensorflow repo.

But then while importing tensorflow_quantum it shows ModuleNotFoundError: No module named 'tensorflow_quantum' For reference I have mentioned link to my colab notebook

anikde avatar Jun 16 '23 05:06 anikde

Yea, I've had a bunch of issues with colab now that they changed the version. In the linked notebook, I keep getting an error in that notebook that the runtime crashed, but that's not surprising, I usually encounter issues when hacking with colabs default versions. I have entirely stopped using colab + TFQ since the change in default python version.

Since TFQ has no problem installing on a fresh local environment with 3.8.10 it doesn't seem like there's any errors in TFQ, I would assume something else is at play in colab, which I don't know enough about to comment on.

lockwo avatar Jun 16 '23 05:06 lockwo

I actually had no problems with this colab: https://github.com/tensorflow/tensorflow/issues/60428#issuecomment-1527270841 from the TF issue you linked. Seemed to do the trick. image

lockwo avatar Jun 16 '23 05:06 lockwo

That's really odd. I really can't think of any reason why am I getting that error, we both are running the same notebook. Screenshot from 2023-06-16 11-35-24

anikde avatar Jun 16 '23 06:06 anikde

That notebook does not work for me either. When running, !sudo update-alternatives --config python3, I get, update-alternatives: error: no alternatives for python3. Screenshot 2023-09-20 at 2 48 21 PM

kiannaamaya avatar Sep 20 '23 18:09 kiannaamaya

Yes, changing python versions in colab can be unreliable at best. I do not attempt it usually. If you are having version control problems with colab though, I would recommend contacting their support for more help.

lockwo avatar Sep 20 '23 18:09 lockwo

Duplicate of #798

knottyanyon avatar Sep 22 '23 13:09 knottyanyon