简体   繁体   English

尝试在python 3.6上安装pygame和pip时遇到问题

[英]Having issues while trying to install pygame and pip on python 3.6

I'm new to programming and I'm studying python. 我是编程新手,正在学习python。 I have to install pygame and pip in order to continue the book I'm studying from but I can't seem to find an easy way to do it. 我必须安装pygame和pip才能继续学习该书,但似乎找不到一种简单的方法。 I've tried to upgrade pip but I dont know exactly how to do it. 我曾尝试升级点子,但我不知道该怎么做。 I already tried by using the prompter but it says that it cant recognize it as a internal or external command. 我已经尝试过使用提示器,但提示它无法将其识别为内部或外部命令。 I have recently downloaded the python 3.6.5 version and I still have the python 3.5 version installed. 我最近下载了python 3.6.5版本,但仍然安装了python 3.5版本。 Is there an easy way to do it? 有一个简单的方法吗?

Edit: Already tried to do this one: 'pip' is not recognized as an internal or external command 编辑:已经尝试执行此操作: 'pip'不识别为内部或外部命令

and this one: How do I update pip itself from inside my virtual environment? 这一个: 如何从虚拟环境内部更新点子本身?

but couldnìt understand that much. 但听不懂。

Usually, you can do 通常你可以

easy_install pip
pip install pygame

As alternative you can just use Anaconda which already has pip set up and ready to roll. 作为替代方案,您可以只使用已经设置了pip并可以滚动的Anaconda

You don't have to install pip, since it's installed by default. 您无需安装pip,因为它是默认安装的。

If you're using Windows, enter py -3.6 -m pip install pygame in the command-line. 如果您使用的是Windows, py -3.6 -m pip install pygame在命令行中输入py -3.6 -m pip install pygame This will install pygame specifically for Python version 3.6. 这将专门为Python版本3.6安装pygame。

In other operating systems you can enter pip3 install pygame or python3 -m pip install pygame . 在其他操作系统中,您可以输入pip3 install pygamepython3 -m pip install pygame OS X users often have trouble with the installation, but I can't help with that. OS X用户通常在安装时遇到麻烦,但是我对此无能为力。

Check out pygame's getting started page. 查看pygame的入门页面。


The problem in this special case was that the "Scripts" directory which contains pip was not installed. 在这种特殊情况下的问题是未安装包含pip的“脚本”目录。 The user was able to fix it by running the Python installer again and selecting "modify". 用户能够通过再次运行Python安装程序并选择“修改”来修复它。

Afterwards you can also upgrade pip in this way python -m pip install --upgrade pip or in Windows py -m pip install --upgrade pip . 之后,您还可以通过python -m pip install --upgrade pip或Windows py -m pip install --upgrade pip来升级py -m pip install --upgrade pip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM