The pyro package has an incompatibility with the pipreqs tool. pipreqs can generate a list of dependencies for any code base using imports. However, there is an ambiguity with the other pyro package. When pipreqs encounters import pyro it does not know which package we plan to import.
The source file tested on in folder_using_pyro is the example here:
import os
from functools import partial
import numpy as np
import pandas as pd
import seaborn as sns
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import pyro
from pyro.distributions import Normal, Uniform, Delta
from pyro.infer import SVI, Trace_ELBO
from pyro.optim import Adam
from pyro.distributions.util import logsumexp
from pyro.infer import EmpiricalMarginal, SVI, Trace_ELBO, TracePredictive
from pyro.infer.mcmc import MCMC, NUTS
import pyro.optim as optim
import pyro.poutine as poutine
# for CI testing
smoke_test = ('CI' in os.environ)
assert pyro.__version__.startswith('0.4.0')
pyro.enable_validation(True)
pyro.set_rng_seed(1)
pyro.enable_validation(True)
Issue Description
The pyro package has an incompatibility with the pipreqs tool.
pipreqs
can generate a list of dependencies for any code base using imports. However, there is an ambiguity with the other pyro package. Whenpipreqs
encountersimport pyro
it does not know which package we plan to import.Environment
Code Snippet
If we run
pipreqs
with the above requirements,Then we get a requirements file:
After installing
pip install pyro-ppl
to get pyro in the environment, thenpipreqs
gives both packages:The source file tested on in
folder_using_pyro
is the example here: