Ask coding questions

← Back to all posts
5
Upgrading pip.

I cannot upgrade my pip. I'm trying to install the random package but it tells me to upgrade my pip.
Here is my error:
"Could not find a version that satisfies the requirement Random (from versions: )
No matching distribution found for Random
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command"

Answered by
TheDrone7 (477)
[earned 5 cycles]
View Answer
Commentshotnewtop
3
  • random package is built-in, you don't have to install it.
  • older version of pip is just a warning but still do a it's job perfectly fine.
1

@TheDrone7 I tried it without it but it did not work. When I don't import random it says Random.Random is not defined.

1

@KianAlford it's true, there's just a little error with your code, python is case sensitive.

1

@TheDrone7 I tried it both cases. It does not work either way. If that was the issue I would not be asking these questions.

1

@KianAlford can I get a link to your repl?

1

@TheDrone7 https://repl.it/@KianAlford/War is that the link or do i need to invite you to it??

1

@KianAlford it seems like you just don't know how to use the random package, here's a link that might help - https://docs.python.org/3.7/library/random.html

1

@TheDrone7 ok ive been using random for so long and this never happened when I did this in code before. This is why I don't ask questions. Just stop.

1

@TheDrone7 you also don't know how to answer my question either now do you.

1

@KianAlford it's pretty clear from your code you're new to this, unless you've been using some other language, there's no point in arguing.

1

@TheDrone7 im not as new to this as much as you think. I don't think you know how to answer my questions so your using other "issues". don't even try acting like you know what your doing ok.

1

@KianAlford I've been using python for 2 years now and random package hasn't changed since. It's even the she in v2.7, if you're really trying to prove a point here? Put it forward more clearly.

1

@TheDrone7 Or is it that you don't understand my point. Actually open your mind to smeones errors. If you really think you can help. Then listen.

1

@KianAlford I saw the problem in your code and found that you weren't using the proper functions, so I sent a link to the official documentation for the package so you may pick the function that suits your purposes. By it seems like you just don't know how to use the package I didn't mean to offend you. It was just a bad choice of words on my side, also you can see that even this message took me an hour to prepare so I don't end up increasing the problem.

1

@TheDrone7 sorry. i'm frustrated with this code and I just took it out on you. thank you

1

Ok folks - chill out.

@KianAlford - while you might not have found the answer that @TheDrone7 gave useful, there's no reason to be rude.

Your command on line 12 doesn't look right to me. Did you mean something like this?

player_1 = cards[random.randint(0, 26)]

1

@themaka sorry. frustrated at this. no. I need it to get 26 variables from the list at random.

1

@KianAlford Ah, that's a bit more complicated.

Here's a YouTube video about build card games in Python - https://youtu.be/62TmpPDs0mM - hopefully it can get you moving in the right direction.

1

@a5rocks thank you very much. It was that easy. that makes me feel insane lol thanks again though

1

@KianAlford also? How do I make it so that those random selected ones are not used in player 2's set.

1

@KianAlford um... you could do:

player_1 = random.sample(LIST_HERE, 26)
player_2 = random.sample([item for item in LIST_HERE if item not in player_1], 26)

Btw, yw :D

2

@a5rocks that worked and ?. I have a lot of things I know but don't know how to put it together thanks m8.

1

@KianAlford oof. Well, gl with your project

1

@a5rocks thank you. Here is my email if you could use help. just email me i check my email from 6:30Am to 3:00Pm

[email protected]