如何在 Windows 上安装 Python 包? [英] How do I install Python packages on Windows?

查看:42
本文介绍了如何在 Windows 上安装 Python 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难设置 python 包.SetupTools 的 EasyInstall 应该可以帮助解决这个问题,但他们没有 Python 2.6 的可执行文件.

I'm having a hard time setting up python packages. EasyInstall from SetupTools is supposed to help that, but they don't have an executable for Python 2.6.

例如要安装 Mechanize,我只是应该根据 INSTALL.txt 将 Mechanize 文件夹放在 C:Python24Libsite-packages 中,但是运行测试不起作用.有人可以帮助阐明这一点吗?谢谢!

For instance to install Mechanize, I'm just supposed to put the Mechanize folder in C:Python24Libsite-packages according to INSTALL.txt, but runnning the tests does not work. Can someone help shed some light on this? Thanks!

推荐答案

已接受的答案已过时.所以首先,pip 优于 easy_install,(为什么使用 pip 而不是 easy_install?).然后按照这些步骤在Windows上安装pip,非常简单.

The accepted answer is outdated. So first, pip is preferred over easy_install, (Why use pip over easy_install?). Then follow these steps to install pip on Windows, it's quite easy.

  1. 安装setuptools:

curl https://bootstrap.pypa.io/ez_setup.py | python

  • 安装pip:

    curl https://bootstrap.pypa.io/get-pip.py | python
    

  • 或者,您可以将路径添加到您的环境,以便您可以在任何地方使用 pip.它类似于 C:Python33Scripts.

    这篇关于如何在 Windows 上安装 Python 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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