我必须安装模块guizero以获得我已经获得的Python作业,但它不起作用。
这就是我Mac上的终端,版本10.7.5
人们说我去了Library/Python
,但这是另一个问题。我的MAC没有向我显示库中名为Python
的任何文件夹。这就是库文件夹的样子:
我正在使用的命令是
pip3 install --user guizero
我收到此错误:
Could not find a version the satisfies the requirement guizero (from versions: )
No matching distribution found for guizero
任何人都可以帮忙吗?!
答案 0 :(得分:0)
尝试更新您的点数版本:
Private Sub GroupAttack(attackersGroup As clsGroup, defendersGroup As clsGroup)
'implements the attack of one group on another
Dim victimNo As Integer
Dim randomNumber As Integer
Dim attacker As clsCharacter
Dim damage As Integer
Dim defender As clsCharacter
Randomize
For Each attacker In attackersGroup.members
'check if attacker is still alive
If attacker.health > 0 Then
'check if any defenders are still alive because there's no point attacking dead defenders
If defendersGroup.aliveCount > 0 Then
'do some damage on a defender
If defendersGroup.count > 0 Then
'choose a random hostile
victimNo = Int(((Rnd() * defendersGroup.aliveCount) + 1))
'find an alive victim
memberid = 0
j = 0
Do While j < victimNo
memberid = memberid + 1
If defendersGroup.members(memberid).health > 0 Then
j = j + 1
End If
Loop
'reset our victimno to the live victim
victimNo = memberid
damage = defendersGroup.character(victimNo).attack(attacker.strength)
If damage <> 0 Then 'attacker hit
mScript = mScript & attacker.name & " hits " & _
defendersGroup.character(victimNo).name & " for " & damage & " damage"
If defendersGroup.character(victimNo).health = 0 Then
mScript = mScript & " and kills " & defendersGroup.character(victimNo).name
End If
mScript = mScript & vbCrLf
Else 'attacker missed
mScript = mScript & attacker.name & " missed " & defendersGroup.character(victimNo).name & vbCrLf
End If
End If
End If
End If
Next attacker
End Sub
或pip install --upgrade pip
答案 1 :(得分:0)
Pip不仅可以神奇地发明guizero是什么。您需要从https://pypi.python.org/pypi/guizero下载guizero-0.2.1-py3-none-any.whl
。将其保存在Library/Python/2.5/site-packages
(用您的版本替换2.5)文件夹中,然后在终端中键入pip install guizero-0.2.1-py3-none-any.whl
(键入guiz和tab两次,自动为您完成文件名)
修改
首先安装easy_install
curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python
然后安装pip
sudo easy_install pip
您现在可以使用
安装任何模块 pip install guizero