安装基本Python模块

时间:2013-07-29 17:18:40

标签: python python-3.3 distribute

我首先下载了Python 3.3,目的是添加xlrd和xlwt以与excel一起使用。我无法安装easy_installdistribute或上述任何一种。

这是我从IDLE下载分发,解压缩并运行distribute_setup.py后收到的错误消息:

Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
Extracting in c:\users\t\appdata\local\temp\tmpecnfj9
Now working in c:\users\t\appdata\local\temp\tmpecnfj9\distribute-0.6.49
Installing Distribute
Something went wrong during the installation.
See the error message above.
Traceback (most recent call last):
  File "C:\Python33\Lib\site-packages\distribute-0.6.49\distribute_setup.py", line 556, in <module>
    sys.exit(main())
SystemExit: 2 

总的来说,我无法安装和使用任何模块。我想我错过了一个非常基本的步骤。

3 个答案:

答案 0 :(得分:1)

在Python 3.3中,setuptools取代distribute。下载并安装setuptools,你应该很高兴。安装setuptools后,您可能还需要考虑安装pip。按照setuptoolspippypi的说明进行操作。

答案 1 :(得分:0)

在已下载.msi格式的Python源的驱动器中安装Python,或者您可以更改该源文件的驱动器,然后尝试安装它。只是一个简单的安装过程,没什么典型的。

答案 2 :(得分:0)

不用担心。确保您已完成以下操作

  1. 确保您安装了 python 和 pip 并且可以从命令行访问。键入这两个命令以确保安装了 python 和 pip3: 一种。 pip3python3 如果您收到任何消息,告诉您您的系统上没有安装它们

  2. 在终端/cmd 中使用 pip3 install PACKAGE_NAME_HERE 命令来安装模块/包

  3. 如果您收到 pip3 命令未找到错误,请输入相应的命令 a) 如果您使用的是 mac 设备,请安装 brew:brew install python3。然后安装 pip3:brew postinstall python3。然后调用 pip3 -V 看看它是否有效。 b) 如果您使用的是 Linux 设备,请使用 sudo apt install python3-pip 安装 pip

相关问题