检查 PyPI 包名称是否被占用的最佳方法是什么?
我已经多次在pypi中搜索软件包但没有收到任何结果。然后我花时间创建了一个包,其名称似乎没有被占用,但在部署时却收到错误。有没有更好的方法来检查包名称的可用性?
python 库 PULP 的新手,我发现文档有点无用,因为它不包含使用变量列表的示例。我试图在下面创建一个绝对简约的示例来说明我的困惑。
import pulp
IDENTIFIERS = ['A','B','C','D','E']
PRICES = dict( zip( IDENTIFIERS, [100.0, 99.0, 100.5, 101.5, 200.0 ] ) )
n = len( IDENTIFIERS )
x = pulp.LpVariable.dicts( "x", indexs = IDENTIFIERS, lowBound=0, upBound=1, cat='Integer', indexStart=[] )
prob = pulp.LpProblem( "Minimalist example", pulp.LpMaximize )
prob += pulp.lpSum( [ x[i]*PRICES[i] for i in IDENTIFIERS ] ), " Objective is sum of prices of selected items "
prob += pulp.lpSum( [ x[i] for i in IDENTIFIERS ] )==2, " Constraint …Run Code Online (Sandbox Code Playgroud)