如何使用pip在Windows 7上使用MinGW-w64编译器来安装包?

时间:2022-02-03 07:00:40

I'm using Python 3.4.1 64 bit on Windows 7. When I tried to install scikit-image using pip, I ran into the popular problem: "unable to find vcvarsall.bat". I made sure that I have both Visual Studio 2009 and 2010 redistributable installed and also added VS90COMNTOOLS and VS100COMNTOOLS to environment variable. But that didn't help. The same error persisted.

我在Windows 7上使用了Python 3.4.1 64位。当我试图用pip安装scikitimage时,我遇到了一个流行的问题:“找不到vcvarsall.bat”。我确保了Visual Studio 2009和2010的redistributable已安装,并将VS90COMNTOOLS和VS100COMNTOOLS添加到环境变量中。但这并没有帮助。同样的错误依然存在。

Then I decided to give MinGW-w64 a try. So I installed it. Add the bin folder to PATH. Then create a distutils.cfg file that has this code

然后我决定试一试。所以我安装它。将bin文件夹添加到路径中。然后创建一个distutils。包含此代码的cfg文件。

[Build]
compiler = mingw-w64

Then I get this error message: "don't know how to compile C/C++ code on platform 'nt' with 'mingw-w64' compiler". How should I solve this?

然后我得到了这个错误信息:“不知道如何在‘nt’上编译C/ c++代码和‘mingw-w64’编译器”。我该怎么解决这个问题?

P.S I know I can download binaries from Christoph Gohlke's page, but I'd still like to know how to do this on my own.

P。我知道我可以从Christoph Gohlke的页面下载二进制文件,但是我仍然想知道如何自己做。

4 个解决方案

#1


0  

You can try to install unofficial whl for Windows listed here http://www.lfd.uci.edu/~gohlke/pythonlibs/

您可以尝试在这里的Windows中安装非官方的whl,这是http://www.lfd.uci.edu/~gohlke/pythonlibs/。

Got you link and search for "scikit-image"

找到链接,搜索“scikitimage”

#2


0  

Not an exact answer to your question, but you might want to take a look at Anaconda. It it allows you to install packages without compiling them and already comes with several useful packages such as NumPy, Pandas, SciPy, Matplotlib, and Jupyter.

这不是你的问题的确切答案,但你可能想看看水蟒。它允许您在不编译它们的情况下安装包,并且已经提供了一些有用的包,如NumPy、熊猫、SciPy、Matplotlib和Jupyter。

You can install scikit-image with one command:

您可以使用一个命令安装scikitimage:

conda install scikit-image

Or to update it:

或者更新:

conda update scikit-image

I always recommend Anaconda to anyone who is starting to use Python on Windows - saves you a lot of headaches.

我总是向任何开始在Windows上使用Python的人推荐Anaconda,省去了很多麻烦。

#3


0  

You can try installing scikit-image from the cmd prompt from Windows: Scikit-image installation.

您可以尝试从Windows: scikitimage安装的cmd提示中安装scikit-image。

#4


0  

All I did to install using pip was go into the command prompt and type the following. For my example, I'm installing numpy, but you can use it to install whatever you need.

我使用pip安装的所有操作都是进入命令提示符并输入以下命令。对于我的示例,我正在安装numpy,但是您可以使用它来安装您需要的任何东西。

>pip install numpy

Simple as that. Hope it helps!

就这么简单。希望它可以帮助!

#1


0  

You can try to install unofficial whl for Windows listed here http://www.lfd.uci.edu/~gohlke/pythonlibs/

您可以尝试在这里的Windows中安装非官方的whl,这是http://www.lfd.uci.edu/~gohlke/pythonlibs/。

Got you link and search for "scikit-image"

找到链接,搜索“scikitimage”

#2


0  

Not an exact answer to your question, but you might want to take a look at Anaconda. It it allows you to install packages without compiling them and already comes with several useful packages such as NumPy, Pandas, SciPy, Matplotlib, and Jupyter.

这不是你的问题的确切答案,但你可能想看看水蟒。它允许您在不编译它们的情况下安装包,并且已经提供了一些有用的包,如NumPy、熊猫、SciPy、Matplotlib和Jupyter。

You can install scikit-image with one command:

您可以使用一个命令安装scikitimage:

conda install scikit-image

Or to update it:

或者更新:

conda update scikit-image

I always recommend Anaconda to anyone who is starting to use Python on Windows - saves you a lot of headaches.

我总是向任何开始在Windows上使用Python的人推荐Anaconda,省去了很多麻烦。

#3


0  

You can try installing scikit-image from the cmd prompt from Windows: Scikit-image installation.

您可以尝试从Windows: scikitimage安装的cmd提示中安装scikit-image。

#4


0  

All I did to install using pip was go into the command prompt and type the following. For my example, I'm installing numpy, but you can use it to install whatever you need.

我使用pip安装的所有操作都是进入命令提示符并输入以下命令。对于我的示例,我正在安装numpy,但是您可以使用它来安装您需要的任何东西。

>pip install numpy

Simple as that. Hope it helps!

就这么简单。希望它可以帮助!