n-roth12 / DFSLineupOptimizer

A Python project for generating NFL daily fantasy contest lineups.
MIT License
9 stars 1 forks source link

optimize_lineup() takes 2 positional arguments but 3 were given #5

Closed chrisgarland21 closed 1 month ago

chrisgarland21 commented 1 month ago

Hello!

I installed the package via pip (pip install lineup-optimizer) then I could not find optimize.py from the Readme so I downloaded that file and put it in the "site-packages\lineup_optimizer" directory with the other script files. I changed to that directory then when I try to run it as in the Readme, I get the following error:

C:\Users\mrsve\Documents\Python\Lib\site-packages\lineup_optimizer>python optimize.py FULL_ROSTER "DKSalaries.csv" Traceback (most recent call last): File "C:\Users\mrsve\Documents\Python\Lib\site-packages\lineup_optimizer\optimize.py", line 20, in <module> optimize(sys.argv) File "C:\Users\mrsve\Documents\Python\Lib\site-packages\lineup_optimizer\optimize.py", line 15, in optimize lineup = optimize_lineup(mode, filepath, stack) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: optimize_lineup() takes 2 positional arguments but 3 were given

The same error occurs whether I use the above command or add the stack (python optimize.py FULL_ROSTER "DKSalaries.csv" 3-2). I think there's something with my installation that screwed it up but I can't figure it out. Thanks!

n-roth12 commented 1 month ago

Hello,

I believe the latest version on GitHub may not have been deployed to PyPi, because the stack argument for optimize_lineup was added recently. I would recommend cloning the repo into a clean directory and running it that way and let me know if you are still seeing that error.

Sorry about that, I will try to deploy to PyPi soon.

chrisgarland21 commented 1 month ago

Perfect, worked well after cloning the repo. Thanks!