tensorflow / quantum

Hybrid Quantum-Classical Machine Learning in TensorFlow
https://www.tensorflow.org/quantum
Apache License 2.0
1.79k stars 572 forks source link

Problems with installing package from PyPI and Colab due to dependency conflicts #798

Open knottyanyon opened 1 year ago

knottyanyon commented 1 year ago

This problem has been brought up repeatedly for a few months and it's a classic example of 'the solution is trivial and is left as an exercise for the reader'.

So I'm going to leave here some information that helped me resolve the dependency conflicts and build it from source on my device. Information is based on darwin-arm64v8 but should be applicable in general if one is building from source.

General notes:

If one isn't familiar with setting environment build variables etc and making sure the paths are pointing correctly to gcc etc.

For arm Macs: I probably have the cached wheels of tensorflow quantum from my bazel build. If possible I can find a way to share them.

Unfortunately there are way too many duplicate issues around this with scattered workarounds and solutions. @MichaelBroughton or any of the active maintainers, please merge them if possible to reduce the clutter in this repository.

Hope the pointers would be helpful with installation until the dependency conflicts are resolved.

lockwo commented 1 year ago

I don't believe there are any active maintainers of this repository

knottyanyon commented 1 year ago

Are you aware of any mailing lists like the one for Cirq that one can sign up to follow any updates?

lockwo commented 1 year ago

I am not aware of any. The last functional change was with the 0.6.0 release, Feb 3 2022.

badihian commented 10 months ago

This is such a mess. I have spent several days trying all sorts of fixes but can't get it to work. I've tried using TFQ on Windows with Anaconda and WSL, I've tried on a virtual machine of Ubuntu, I've tried with Google Colab, yet nothing works. If anyone who is involved in this project would consider creating a Docker container for this with the proper setup, similar to the one for TF, that would be a huge help. As of now, this is essentially unusable.

lockwo commented 10 months ago

I've tried qbraid before (free tier) and had some success (https://www.qbraid.com/products). Ubuntu w/ python 3.8 and the right TF version should work (that's what I do), but there are a lot of difficulties I know. Imo TFQ should probably be on the https://killedbygoogle.com list.

nagarajRPoojari commented 9 months ago

I managed to install ,

pragmatic-philosopher09 commented 9 months ago

I managed to install ,

  • tensorflow-quantum 0.3.0 with tensorflow 2.11.0 , python 3.8 locally on windows. I can import and use it , but most of the functionalities are not available in 0.3.0 version
  • tensorflow-quantum 0.7.2 with tensorflow 2.11.0 , python 3.8 on colab. but I can't import it now.

Did you manage to resolve these issues? I'm also presently grappling with similar problems.

nagarajRPoojari commented 9 months ago

I managed to install ,

  • tensorflow-quantum 0.3.0 with tensorflow 2.11.0 , python 3.8 locally on windows. I can import and use it , but most of the functionalities are not available in 0.3.0 version
  • tensorflow-quantum 0.7.2 with tensorflow 2.11.0 , python 3.8 on colab. but I can't import it now.

Did you manage to resolve these issues? I'm also presently grappling with similar problems.

Nope , I even tried with qBraid , still same issue.

pragmatic-philosopher09 commented 9 months ago

I managed to install ,

  • tensorflow-quantum 0.3.0 with tensorflow 2.11.0 , python 3.8 locally on windows. I can import and use it , but most of the functionalities are not available in 0.3.0 version
  • tensorflow-quantum 0.7.2 with tensorflow 2.11.0 , python 3.8 on colab. but I can't import it now.

Did you manage to resolve these issues? I'm also presently grappling with similar problems.

Nope , I even tried with qBraid , still same issue.

Hey so I figured out a stopgap solution - you can use GitHub Codespaces or even try locally on VSCode in Windows. These are the compatible versions: tensorflow v 2.7.0, tensorflow-quantum 0.7.2 and Python 3.8 (using venv). I'm sharing a video link that can help out understand the versioning problem:

https://www.youtube.com/watch?v=Kd8uJx-OLHg

aartuuroo20 commented 8 months ago

Hi, I am trying to install tensorflow quantum and I am getting errors. I'm installing using python version 3.8, tensorflow version 2.7 and tensorflow quantum version 0.7. I don't know what to do.