在Windows上安装python的最佳方法是什么 [英] What is the best way to install python on Windows

查看:115
本文介绍了在Windows上安装python的最佳方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows中已经安装了python3,但实际上配置不正确.主要问题归结于安装新软件包.我支持身份验证代理,而我安装软件包的方法是手动下载它们并运行python setup.py install.这对于某些软件包来说效果很好,但是有些软件包使用easy_install自动下载依赖项,这些依赖项卡在了代理服务器上,因此我必须找到所有依赖项并手动下载并安装它们.这也使得跟踪我自己的依赖关系真的很困难.

I have an existing python3 installation in Windows, but things aren't really configured right. The main problem comes down to installing new packages. I am behind an authenticating proxy and the way I install packages is by manually downloading them and running python setup.py install. This works fine for some packages, but then there are some which use easy_install to automatically download dependencies, and these get stuck at the proxy, so I have to find all the dependencies and manually download and install them. This also makes it really difficult to track my own dependencies.

在接下来的几周内,我的计算机将被重新安装,因此,当发生这种情况时,我希望可以进行更好的设置.所以我的问题是:

In the next few weeks my computer will be re-installed, so when that happens I would like to get a much better setup working. So my questions are:

  1. virtualenv,分发,setuptools,pip ...我应该在Windows中为python3安装以下哪些(或我错过的其他产品)?
  2. 如何让他们在身份验证代理后面工作?

推荐答案

大多数程序在使用普通代理时效果更好,因此请提供尝试.

Most programs are working better with plain proxies, so give Cntlm a try.

关于第一个问题,请安装Python 3,然后制作包含以下内容的单行v.cmd文件:

As for the first question, install Python 3 then make an one-line v.cmd file with this content:

@X:\full\path\to\python.exe y:\full\path\to\virtualenv.py --distribute --unzip-setuptools %*

当您需要虚拟环境时,转到所需的文件夹并运行:

When you need an virtual envinronment, go to the desired folder and run:

v.cmd .

或提供该文件夹的完整路径作为参数,而不是.

or provide the full path to that folder as the argument instead of .

当然,激活pip缓存将使事情变得更快.只需将这些内容放入%APPDATA%\pip\pip.ini:

Of course, activating the cache for pip will make things faster. Just put this content in %APPDATA%\pip\pip.ini:

[install]
download-cache=z:/full/path/to/your/pip/cache

这篇关于在Windows上安装python的最佳方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆