Python PIP 10.0.1 - 警告“考虑将此目录添加到 PATH 或...”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/49966547/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 19:20:12  来源:igfitidea点击:

PIP 10.0.1 - Warning "Consider adding this directory to PATH or..."

pythonpip

提问by T D

The script flake8.exe is installed in 'c:\users\me\appdata\local\programs\python\python36-32\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Did some research on this and it seems like some sort of recurring issue.

对此进行了一些研究,这似乎是某种反复出现的问题。

One fix recommends removing trailing slashes from the environment variable.

一种修复建议从环境变量中删除尾部斜杠。

Any other ideas?

还有其他想法吗?

This occurs every time I install via PIP

每次我通过 PIP 安装时都会发生这种情况

I am running python 3.6

我正在运行 python 3.6

回答by Zin Minn

If removing trailing slashes from the environment variables don't work, please try the following. It works fine for me. I am using window 10 and python3.7.0

如果从环境变量中删除尾部斜杠不起作用,请尝试以下操作。这对我来说可以。我正在使用窗口 10 和 python3.7.0

Advanced system settings -> Environment Variables -> Path

Select Edit

Select Move Up button for both pythonand Scriptsdirectory.

高级系统设置 -> 环境变量 -> 路径

选择编辑

pythonScripts目录选择 Move Up 按钮。

enter image description here

在此处输入图片说明

Finally your path will be as the following.

最后,您的路径将如下所示。

enter image description here

在此处输入图片说明

If you are using other windows(In the case of not having move up button), put your python and Scripts directory at the beginning of the path.

如果您使用的是其他窗口(在没有向上移动按钮的情况下),请将您的 python 和 Scripts 目录放在路径的开头

回答by Danh Tran

I fixed this (on windows) by adding full control permission to the folder where i installed python. i installed it in "C:\Program Files\Python38-32"

我通过向我安装 python 的文件夹添加完全控制权限来解决这个问题(在 Windows 上)。我将它安装在“C:\Program Files\Python38-32”中

回答by Steve Barnes

Removing trailing back slashes from those path elements is a good idea.

从这些路径元素中删除尾部斜杠是一个好主意。

There may also be a problem that pip is written in python which uses case sensitive compares by default, (as is the default on every commonly used platform that I am aware of other than windows). You should also make sure that your pathvariable matches the case expected by pip, (the actual case of the path elements on windows does nothave to match).

可能还有一个问题,pip 是用 python 编写的,默认情况下使用区分大小写的比较,(这是我知道的除 windows 之外的每个常用平台上的默认值)。你还应该确保你的路径变量由PIP预期的情况下,(在Windows路径元素的实际情况不相匹配具有匹配)。

To do this go into the control panel, system settings, advanced poperties, advanced, Environmental Variables and edit the path elements that are giving the problem. (Windows has a nasty habit of capitalizing things even when you don't).

为此,请进入控制面板、系统设置、高级属性、高级、环境变量并编辑出现问题的路径元素。(Windows 有一个讨厌的习惯,即使你没有大写的东西)。