任何人都可以帮助我,我认为我必须将pip安装到错误的位置,因为我也找不到numpy或pandas。
from pydfs_lineup_optimizer import Site, Sport, get_optimizer
optimizer = get_optimizer(Site.DraftKings, Sport.FOOTBALL)
optimizer.load_players_from_csv("DKSalaries.csv")
for lineup in optimizer.optimize(10):
print(lineup)
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-41770e2b315e> in <module>
----> 1从pydfs_lineup_optimizer导入站点,Sport,get_optimizer 2 3 4优化程序= get_optimizer(Site.DraftKings,Sport.FOOTBALL) 5 Optimizer.load_players_from_csv(“ DKSalaries.csv”) ModuleNotFoundError:没有名为“ pydfs_lineup_optimizer”的模块
Microsoft Windows [Version 10.0.18363.1082]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\mario>python -m pip install pydfs-lineup-optimizer
Requirement already satisfied: pydfs-lineup-optimizer in
c:\users\mario\appdata\local\programs\python\python37\lib\site-packages (3.3.0)
Requirement already satisfied: PuLP>=2.2 in
c:\users\mario\appdata\local\programs\python\python37\lib\site-packages (from pydfs-lineup-optimizer) (2.3)
Requirement already satisfied: pytz in
c:\users\mario\appdata\local\programs\python\python37\lib\site-packages (from pydfs-lineup-optimizer) (2020.1)
Requirement already satisfied: amply>=0.1.2 in
c:\users\mario\appdata\local\programs\python\python37\lib\site-packages (from PuLP>=2.2->pydfs-lineup-optimizer) (0.1.2)
Requirement already satisfied: docutils>=0.3 in
c:\users\mario\appdata\local\programs\python\python37\lib\site-packages (from amply>=0.1.2->PuLP>=2.2->pydfs-lineup-optimizer) (0.16)
Requirement already satisfied: pyparsing in
c:\users\mario\appdata\local\programs\python\python37\lib\site-packages (from amply>=0.1.2-
>PuLP>=2.2->pydfs-lineup-optimizer) (2.4.7)
WARNING: You are using pip version 20.1.1; however, version 20.2.3 is available.
您应该考虑通过'C:\ Users \ mario \ AppData \ Local \ Programs \ Python \ Python37 \ python.exe -m pip install --upgrade pip'命令进行升级。