简体   繁体   English

我如何安装 Pip

[英]How Do I Install Pip

I have tried several methods but i can't install pip, which i need in order to make my .py files into .exe files.我尝试了几种方法,但我无法安装 pip,这是我将 .py 文件转换为 .exe 文件所需要的。

I have downloaded the get-pip.py and tried to run it in command prompt, it says it has installed but when i type: pip -V, it is not recognised.我已经下载了 get-pip.py 并尝试在命令提示符下运行它,它说它已经安装,但是当我输入:pip -V 时,它没有被识别。 I have also tried editing environment variables in "My PC" properties.我还尝试在“我的电脑”属性中编辑环境变量。

py Desktop\\get-pip.py I have also tried it without the py Desktop\\get-pip.py py Desktop\\get-pip.py 我也试过没有 py Desktop\\get-pip.py

It says it is successfully installed but i cant use pip install pyinstaller for example and when i try pip -V it says pip isn't recognised它说它已成功安装,但例如我不能使用 pip install pyinstaller,当我尝试 pip -V 时,它说无法识别 pip

Im not sure which version of python you are using but you need to add the location of the executable to your system environmental variables.我不确定您使用的是哪个版本的 python,但您需要将可执行文件的位置添加到系统环境变量中。 For python 2.7 you would click the start menu, search for environmental variables, open up the menu for that, click on the Path variable like this: enter image description here对于 python 2.7,您将单击开始菜单,搜索环境变量,打开该菜单,单击 Path 变量,如下所示:在此处输入图像描述

and then add a new record for C:\\Python27\\ (for python.exe to be found by the shell) as well as C:\\Python27\\Scripts\\ (which is where pip.exe should reside)然后为 C:\\Python27\\(用于 shell 找到的 python.exe)以及 C:\\Python27\\Scripts\\(这是 pip.exe 应该驻留的位置)添加新记录

  1. Uninstall python and dependency卸载python和依赖
  2. download python (for windows choose exicutable installer )下载 python(对于 windows 选择 exicutable 安装程序)
  3. click on install and wait点击安装并等待
  4. when first wizard screen appear make sure u check the install pip check box in bottom当第一个向导屏幕出现时,请确保您选中底部的安装 pip 复选框
  5. and remain process is same as u do和保持过程和你一样

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

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