简体   繁体   English

pip freeze 在 Windows 安装中没有显示任何内容?

[英]pip freeze doesn't show anything in Windows installation?

I have Python27 installed in Windows 7我在 Windows 7 中安装了 Python27

I am trying to build a reddit bot using this tutorial我正在尝试使用本教程构建一个 reddit 机器人

I found instructions on how to install pip for windows from here我从这里找到了有关如何为 Windows 安装 pip 的说明

The page says that after installing pip, I can use pip freeze to check if the installation went correctly页面说安装pip后,我可以使用pip freeze来检查安装是否正确

It says pip freeze should display some information as shown below它说 pip freeze 应该显示一些信息,如下所示

Microsoft Windows [Version 6.2.9200] (c) 2012 Microsoft Corporation. Microsoft Windows [版本 6.2.9200] (c) 2012 Microsoft Corporation。 All rights reserved.版权所有。

C:\\Users\\Username>cd c:\\Python27\\Scripts C:\\Users\\Username>cd c:\\Python27\\Scripts

c:\\Python27\\Scripts>pip freeze c:\\Python27\\Scripts>pip freeze
antiorm==1.1.1反形式==1.1.1
enum34==1.0 enum34==1.0
requests==2.3.0 virtualenv==1.11.6请求==2.3.0 virtualenv==1.11.6

However pip freeze doesn't show me anything at all但是 pip freeze 根本没有显示任何内容在此处输入图片说明

Did pip install correctly, or is there any problem? pip 安装正确,还是有什么问题? Is there any other way i can test proper installation?有没有其他方法可以测试正确安装?

If you want to test it thoroughly, you can use your actual pip installation to install something.如果你想彻底测试它,你可以使用你的实际 pip 安装来安装一些东西。 For example, numpy would be a good sized example that can rule many problems out.例如,numpy 将是一个很好的示例,可以排除许多问题。

> pip install numpy

Now, run pip freeze again to check if pip is working as expected.现在,再次运行pip freeze以检查 pip 是否按预期工作。 It should then have something to show.然后它应该有一些东西可以展示。

If you want to test it even further, you can open a terminal and如果你想进一步测试它,你可以打开一个终端并

> python
> import numpy

That should be the complete test of your pip installation.这应该是对 pip 安装的完整测试。

Additionally, whenever I install a new tool in my stack, I like to validate its path with where <executable name> (on Windows) and which <executable name> (on Linux).此外,每当我在堆栈中安装新工具时,我喜欢使用where <executable name> (在 Windows 上)和which <executable name> (在 Linux 上)来验证其路径。 There are some compilers like Java that are always conflicting with other installations (like crazy, to the point that a complex setup may sometimes have to inject an absolute path to enforce the use of the correct version).有一些像 Java 这样的编译器总是与其他安装冲突(就像疯了一样,复杂的设置有时可能不得不注入绝对路径来强制使用正确的版本)。

Also, asking the executable for its version can rule many other problems out.此外,询问可执行文件的版本可以排除许多其他问题。 In your case, you can use pip --version to check which version you got and compare it to the stable or latest, according to what you want to use.在您的情况下,您可以使用pip --version来检查您获得的版本,并将其与稳定版或最新版进行比较,具体取决于您要使用的内容。

如果您来自 Linux 背景,windows 是一个令人困惑的软件......对我有用的解决方案如下

pip list

The problem you are facing is that if you only have de default packages in your installation lets say pip, wheel, pip freeze does not have anything to freeze at the moment so that's why dont show anything.您面临的问题是,如果您的安装中只有默认包,可以说 pip,wheel,pip freeze 目前没有任何可以冻结的内容,所以这就是为什么不显示任何内容的原因。 try to install a new package then run the command again.尝试安装新软件包,然后再次运行该命令。

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

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