XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
747 stars 186 forks source link

Dependency versions error #580

Closed maxtremblay closed 3 years ago

maxtremblay commented 3 years ago

Issue description

I made a fork of this project and tried to setup a new virtual environment.

python -m venv sf-venv
source sf-venv/bin/active.fish
pip install -r requirements.txt

However, I got the following error

ERROR: Cannot install -r requirements.txt (line 4) and numpy>=1.20 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested numpy>=1.20
    tensorflow 2.5.0 depends on numpy~=1.19.2

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

Additional information

If it helps, I am using Python 3.9.4 and pip 21.1.1.

A quick fix would be to downgrade the version of numpy in requirements.txt and solve the issue, but I am not sure it is the best way to go.

antalszava commented 3 years ago

Hi @maxtremblay, thank you for catching this! One quick solution could be downgrading TF from 2.5 until we add a longer-term solution.

antalszava commented 3 years ago

Hi @maxtremblay, as you suggested, we downgraded numpy in requirements.txt, so this should not be an issue.

maxtremblay commented 3 years ago

Yes, this fix the issue.