Problem in creating python package from pytorch lightning module

I want to create a python package that utilizes PyTorch lightening. If in the source code of one of the files in the package, I include this import pytorch_lightning as pl, then I cannot use the package. Specifically, I get this error whenever I import the package:

torch.cuda.DeferredCudaCallError: CUDA call failed lazily at initialization with error: device >= 0 && device < num_gpus INTERNAL ASSERT FAILED at "../aten/src/ATen/cuda/CUDAContext.cpp":50, please report a bug to PyTorch.