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
754 stars 191 forks source link

Numba 0.48 requirement #304

Closed antalszava closed 4 years ago

antalszava commented 4 years ago

Issue description

The numba package has been introduced into SF, however, no version is pinned in requirements.txt.

Source code and tracebacks

ImportError while loading conftest '/xanadu/strawberryfields/tests/conftest.py'.
tests/conftest.py:21: in <module>
    import strawberryfields as sf
strawberryfields/__init__.py:26: in <module>
    from .engine import Engine, LocalEngine, StarshipEngine
strawberryfields/engine.py:26: in <module>
    from .backends import load_backend
strawberryfields/backends/__init__.py:82: in <module>
    from .fockbackend import FockBackend
strawberryfields/backends/fockbackend/__init__.py:16: in <module>
    from .backend import FockBackend
strawberryfields/backends/fockbackend/backend.py:24: in <module>
    from .circuit import Circuit
strawberryfields/backends/fockbackend/circuit.py:27: in <module>
    from numba.typed import List
E   ImportError: cannot import name 'List' from 'numba.typed' (/anaconda3/lib/python3.7/site-packages/numba/typed/__init__.py)

If numba is not installed, then a simple numba import error is emitted.

josh146 commented 4 years ago

Since numba is a hard requirement of SF, we should also add it to setup.py (no version pinning needed here for now)

antalszava commented 4 years ago

Closing this as https://github.com/XanaduAI/strawberryfields/pull/305 got merged.