ValueError: Sample larger than population or is negative
Hello, last night it was working well, since today noon I get this error.
Running in headless_browser=True if needed.
__________________________________________________________________________________________
INFO [2022-02-11 21:35:40] [usr] Starting to follow user `Followers`..
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
INFO [2022-02-11 21:35:40] [usr] User 'melissariso' [1/2]
INFO [2022-02-11 21:35:50] [usr] GraphQL query hash: [c76146de99bb02f6415203be841dd25a]
INFO [2022-02-11 21:35:53] [usr] Sessional Live Report:
|> No any statistics to show
On session start was FOLLOWING 2067 users & had 55900 FOLLOWERS
[Session lasted 1.61 minutes]
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2022-02-11 21:35:53] [usr] Session ended!
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Traceback (most recent call last):
File "quickstart.py", line 25, in <module>
session.follow_user_followers(['melissariso'], amount=25, randomize=True, interact=True)
File "/home/usr/git/InstaPy/instapy/instapy.py", line 3678, in follow_user_followers
person_list, simulated_list = get_given_user_followers(
File "/home/usr/git/InstaPy/instapy/unfollow_util.py", line 1007, in get_given_user_followers
person_list, simulated_list = get_users_through_dialog_with_graphql(
File "/home/usr/git/InstaPy/instapy/unfollow_util.py", line 825, in get_users_through_dialog_with_graphql
followers_list = random.sample(followers_list, real_amount)
File "/usr/lib/python3.8/random.py", line 363, in sample
raise ValueError("Sample larger than population or is negative")
ValueError: Sample larger than population or is negative
No one is getting this error?
@TheNighthawk99 I just had this error too. Pretty random as I've been running without errors for a few days.
@TheNighthawk99 I just had this error too. Pretty random as I've been running without errors for a few days.
I am running InstaPy on two VMs, both with headless_browser=True. In the first one I have been running in the last weeks, then suddenly got this error. In the second one, it is running regularly, hope it keeps. I cannot understand why.
Yeah, also not sure what is happening. I've been running for several hours today and have not seen the error message again.
is this issue fixed in any way?
try changing
File "/home/usr/git/InstaPy/instapy/unfollow_util.py", line 825, in get_users_through_dialog_with_graphql followers_list = random.sample(followers_list, real_amount)
with followers_list = random.sample(followers_list, min(followers_list, real_amount))