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

查看:77
本文介绍了如何在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:\ Python24 \ Lib \ site-packages中,但运行测试无效.有人可以帮忙阐明一下吗?谢谢!

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

推荐答案

接受的答案已过时.因此,首先, pip 优于easy_install,((

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 :

  • Install pip:

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

  • (可选),您可以将路径添加到您的环境,以便可以在任何地方使用pip.就像C:\Python33\Scripts一样.

  • Optionally, you can add the path to your environment so that you can use pip anywhere. It's somewhere like C:\Python33\Scripts.

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

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