简体   繁体   English

如何在Windows上的python 3.4中安装pip?

[英]How to install pip in python 3.4 on windows?

I'm really struggling at installing any python modules (eg six, yahoo_finance) because they require pip to be installed, but I don't know whether I have pip already or how to install it. 我真的很努力地安装任何python模块(例如,六个,yahoo_finance),因为它们需要安装pip,但是我不知道我是否已经拥有pip或如何安装它。 Once its installed I don't know what command to type in and where to type it in. Can I install these modules any other way without pip? 安装后,我不知道要键入什么命令以及在哪里键入命令。是否可以通过其他方式安装这些模块而无需pip?

I am only a beginner, so sorry if this is a bit basic. 我只是一个初学者,如果这有点基础,请抱歉。

Thanks in advance 提前致谢

pip comes already bundled with python 3.4 It will be in your scripts directory C:\\Python34\\Scripts\\ Add it to your Environment variables and you can run it from any directory or else open the directory mentioned above in command prompt and run pip install ... to install whatever you want pip已与python 3.4捆绑在一起,它将位于您的脚本目录C:\\Python34\\Scripts\\并将其添加到Environment variables ,您可以从任何目录运行它,也可以在命令提示符下打开上述目录并运行pip install ...安装任何您想要的

在此处输入图片说明

First, make sure you have it installed, if not follow the instructions below. 首先,请确保已安装,否则请按照以下说明进行操作。 Type which pip , and if it doesn't list an URL, it means it's not installed yet. 输入which pip ,如果没有列出网址,则表示尚未安装。

Go here https://bootstrap.pypa.io/get-pip.py and download the file. 转到https://bootstrap.pypa.io/get-pip.py并下载文件。

Then open terminal and go to your downloads folder (or wherever you downloaded it to) and type python get-pip.py to execute the script. 然后打开终端并转到您的下载文件夹(或将其下载到的位置),然后键入python get-pip.py以执行脚本。 If you get an error that says OSError: Permission Denied , or something similar, run it with administrator permissions. 如果收到错误消息OSError: Permission Denied或类似的错误,请使用管理员权限运行它。

If the installation is successful, you should now have pip installed on your computer. 如果安装成功,则您现在应该在计算机上安装了pip。 Type pip --version to make sure you have it installed. 键入pip --version以确保已安装。

To install six and yahoo_finance, type: 要安装六个和yahoo_finance,请输入:

pip install six

and

pip install yahoo-finance

If something goes wrong update your question. 如果出现问题,请更新您的问题。

From Installing Python Modules : 安装Python模块开始

pip is the preferred installer program. pip是首选的安装程序。 Starting with Python 3.4, it is included by default with the Python binary installers. 从Python 3.4开始,它默认包含在Python二进制安装程序中。

Emphasis mine 重点矿

If you already installed it by default you should be able to use it. 如果默认情况下已经安装了它,则应该可以使用它。 Just open the command line and type python -m pip install SomePackage . 只需打开命令行并输入python -m pip install SomePackage

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

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