我如何在 python 3.5.2 上安装 pip?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38905980/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how do i install pip on python 3.5.2?
提问by user6554254
i downloaded python 3.5.2, i am planning on making a keylogger i need to install pyhook and pywin but i dont know how. every body recommends me to install it by pip but i dont seem to have that module. i open up the idle and import pip, but it gives me the error message saying i dont have that module installed even though people say pip comes with versions 3.4+.. where and how do i install this pip module? i am on a windows ver. 10, 64 bits, python 3.5. any help is aprecciated.. i am new by the way go easy on me..
我下载了 python 3.5.2,我打算制作一个键盘记录器,我需要安装 pyhook 和 pywin,但我不知道如何安装。每个人都建议我通过 pip 安装它,但我似乎没有那个模块。我打开空闲并导入 pip,但它给了我错误消息,说我没有安装该模块,即使人们说 pip 带有 3.4+ 版本..我在哪里以及如何安装这个 pip 模块?我在 Windows 版本上。10、64 位、python 3.5。任何帮助都值得赞赏..顺便说一下,我是新手..
回答by gr1zzly be4r
You need to make sure the pip
executable is in your %PATH%
variable. For me, the pip
executable is located in the Scripts
directory of my Python installation. That turned out to be C:\Python34\Scripts
. So you should find out where this location is for you and then add it to your path variable.
您需要确保pip
可执行文件在您的%PATH%
变量中。对我来说,pip
可执行文件位于Scripts
我的 Python 安装目录中。原来是这样C:\Python34\Scripts
。因此,您应该找出该位置适合您的位置,然后将其添加到您的路径变量中。
回答by user9103228
Sometimes when pip is not installed by default, use this:
有时默认情况下未安装 pip 时,请使用以下命令:
python -m ensurepip --default-pip
回答by bgreen
I am using Python 3.4 and was getting the error that it didn't exist. I ran this upgrade and I can now import pyperclip which was one of the packages in that module.
我正在使用 Python 3.4 并收到它不存在的错误。我运行了此升级,现在可以导入 pyperclip,它是该模块中的包之一。
C:\Python35-32\Scripts>python -m pip install --upgrade pip
Output:
输出:
Collecting pip
Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
100% |################################| 1.2MB 259kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-8.1.2