简体   繁体   English

在Windows上安装python的最佳方法是什么?

[英]What is the best way to install python on Windows

I have an existing python3 installation in Windows, but things aren't really configured right. 我在Windows中安装了一个python3,但事情并没有真正配置好。 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 . 我是一个身份验证代理,我安装软件包的方式是手动下载并运行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. 这适用于某些软件包,但有一些使用easy_install自动下载依赖项,并且这些依赖于代理,因此我必须找到所有依赖项并手动下载并安装它们。 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, distribute, setuptools, pip... Which of these (or any others I've missed) should I install for python3 in Windows, and in what order? virtualenv,distribute,setuptools,pip ...我应该在Windows中为python3安装以下哪些(或其他任何我错过的),以什么顺序?
  2. How can I get them working behind an authenticating proxy? 如何让他们在身份验证代理后面工作?

Most programs are working better with plain proxies, so give Cntlm a try. 大多数程序使用普通代理更好地工作,所以试试Cntlm

As for the first question, install Python 3 then make an one-line v.cmd file with this content: 至于第一个问题,安装Python 3然后用这个内容制作一个单行的v.cmd文件:

@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 . 或提供该文件夹的完整路径作为参数而不是.

Of course, activating the cache for pip will make things faster. 当然,为pip激活缓存会使事情变得更快。 Just put this content in %APPDATA%\\pip\\pip.ini : 只需将此内容放在%APPDATA%\\pip\\pip.ini

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

You might try using pip , which has support for proxies (including authentication): 您可以尝试使用支持代理(包括身份验证)的pip

http://pypi.python.org/pypi/pip http://pypi.python.org/pypi/pip

我不知道这是否会对你有所帮助,但是这个网站有很多捆绑为二进制文件的软件包http://www.lfd.uci.edu/~gohlke/pythonlibs/

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

相关问题 在OS X上安装python 2的最佳方法是什么? - What is the best way to install python 2 on OS X? 使用Enthought Canopy Python在Windows上安装OpenCV的最佳方法? - Best way to install OpenCV on Windows with Enthought Canopy Python? 在 Mac 上安装 Python 的最佳(和安全)方法是什么? - What is really the best (and secure) way to install Python on a Mac? 在 Windows 上彻底重新安装 Python 的最佳方法是什么? - What is the best way to make a clean reinstall of Python on Windows? 使用Python映射Windows驱动器的最佳方法是什么? - What is the best way to map windows drives using Python? 在TeamCity服务器上安装软件包的最佳方法是什么? - What is the best way to install packages on TeamCity server? 使用 anaconda 安装 fipy 的最佳方法是什么? - What is the best way to install fipy with anaconda? 在本地安装 python 包进行开发的最佳方式 - Best way to install python packages locally for development 在 conda 环境(运行 Python 3.8)中安装 rpy2 3.3.2 的最佳方法是什么? - What is the best way to install rpy2 3.3.2 in a conda environment (running Python 3.8)? 在没有 sudo 或 wget 的情况下,以用户(本地)身份安装 python 3.7.7 的最佳方法是什么? - What is the best way to install python 3.7.7 as a user (locally) without sudo or wget?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM