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

ubuntu 22.04: Could not find a version that satisfies the requirement tensorflow-quantum #795

Open cjhudlin opened 1 year ago

cjhudlin commented 1 year ago

hello, we are tying to install T-quantum on a server at our location, tensrflow 2.13 is installed and all other requirements installed via conda. python3 version installed is 3.11. when running the command "pip install -U tensorflow-quantum" as per the install instrutions, the error comes:

pip3 install -U tensorflow-quantum --verbose Using pip 23.2.1 from /home/uadmin/miniconda3/lib/python3.11/site-packages/pip (python 3.11) ERROR: Could not find a version that satisfies the requirement tensorflow-quantum (from versions: none) ERROR: No matching distribution found for tensorflow-quantum

please can someone assist here?

thank you

lockwo commented 1 year ago

Neither TF 2.13 nor Python 3.11 is supported. See https://github.com/tensorflow/quantum/issues/794#issuecomment-1635037043.

cjhudlin commented 1 year ago

why is the latest version not supported?

lockwo commented 1 year ago

I don't know. I would guess because TFQ doesn't have a lot of development support, and the latest version doesn't have a huge set of feature improvements relevant for TFQ.

cjhudlin commented 1 year ago

thank you for the heads up, ill install with recommended tf, tfq and python versions

cjhudlin commented 1 year ago

now it is working, but this install instructions need to be updated on the website as the install instructions referr to installing tf2.13:

install tensorflow: curl https://repo.anaconda.com/miniconda/Miniconda3-py39_23.5.2-0-Linux-x86_64.sh -o Miniconda3-py39_23.5.2-0-Linux-x86_64.sh bash Miniconda3-py39_23.5.2-0-Linux-x86_64.sh

conda create --name tf python=3.9 conda activate tf conda install -c conda-forge cudatoolkit=11.8.0

pip install nvidia-cudnn-cu11==8.6.0.163

mkdir -p $CONDA_PREFIX/etc/conda/activate.d echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.file)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh echo 'export LD_LIBRARY_PATH=$CONDA_PREFIX/lib/:$CUDNN_PATH/lib:$LD_LIBRARY_PATH' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh

pip install tensorflow==2.11.* pip3 install -U tensorflow-quantum

lockwo commented 1 year ago

Where is 2.13 on the website? I see the install website saying python 3.7, 3.8, 3.9 are supported, and 2.11 TF (which isn't even really right, 2.7 is required for the stable versions of TF), but I don't see 2.13 on https://www.tensorflow.org/quantum/install

cjhudlin commented 1 year ago

image

also, even after meeting the requirements, still cannot install tfq. i have installed tf 2.11 and use python 3.10 which is suppported by tf 2.11, but usng pip or conda it doesn find tensorflow-quantum or tfq-nightly packages

cjhudlin commented 1 year ago

edit: i was able to install TFQ wth the command above. i had to remove it and reinstall lika above. the command was modified

kiannaamaya commented 1 year ago

Could you explain what commands you used to remove and reinstall? I do not see the commands you are referring to. Thanks in advance.

lockwo commented 1 year ago

If you installed via pip it's pip uninstall and pip install. However, you want to make sure to remove all potentially conflicting TF stuff which can be a pain. I recommend using a new virtual environment and just doing a clean install.

kiannaamaya commented 1 year ago

Thank you for your response but I have still been able to try a solution. I tried no Mac and Windows and nothing has worked so far.

lockwo commented 1 year ago

You tried with Mac and windows? Windows is unsupported (past like v0.2 or something), and if the Mac is M1 or M2 there are a lot of issues (with TF more broadly, see other issues on this GitHub specific to Mac). If you are having more general troubles, distinct from previous open or closed issues, I suggest you open a new issue with all of you hardware/software details, what steps you took, what the errors are, etc.

knottyanyon commented 1 year ago

Duplicate of #798

BytePaul commented 8 months ago

Try opening google.com and then run this command. This solution worked for me. I was trying to run this on my corporate laptop but to no avail until i tried the above fix as recommended by my IT department