首页 文章

Python Setuptools,easy_install setup mac

提问于
浏览
5

好的,所以我不确定这里发生了什么 . 我刚拿到我的MAC,我正在尝试下载并安装setuptools,所以我可以下载不同的python包(使用easy_install) . 所以,按照这里的说明(http://pypi.python.org/pypi/setuptools):

  • 我目前有2.6版

  • 我下载了以下鸡蛋:setuptools-0.6c11-py2.6.egg(md5)

  • 我把文件放在桌面上(文件名:setuptools-0.6c11-py2.6.egg.sh)

  • 我导航到目录上的桌面,并使用以下命令行,如上面的链接所示:sh setuptools-0.6c11-py2.6.egg

  • 我收到一个错误:没有这样的文件或目录,所以我使用另一个命令sh setuptools-0.6c11-py2.6.egg.sh

  • 然后,我收到以下错误:setuptools-0.6c11-py2.6.egg.sh不是此egg文件的正确名称 . 请将其重命名为setuptools-0.6c11-py2.6.egg,然后重试 .

我真的不确定在这里做什么 . 任何帮助,将不胜感激!谢谢!

2 回答

  • 6

    edit Try this from a command line

    这是一个更容易做的事情,可能对你更好 . 打开终端(Applications-> Utilities-> Terminal)并将其作为shell脚本运行 . 您还可以运行各个命令 .

    #!/bin/sh
    
    cd ~
    
    # Downloads python setuptools for 2.6
    curl -o setuptools-0.6c11-py2.6.egg http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086
    
    # installs it, will probably prompt you for password
    sudo sh setuptools-0.6c11-py2.6.egg
    
    # clean up and delete egg
    rm setuptools-0.6c11-py2.6.egg
    

    Stuff below was original response

    我只是在我自己的Mac机器上做了这个,安装没有问题 . 你打开一个终端来做这个吗?

    我将setuptools下载到我的Downloads文件夹,然后打开一个终端,并执行了以下操作:

    > cd ~/Downloads
    > sudo sh setuptools-0.6c11-py2.6.egg 
    Password:
    Processing setuptools-0.6c11-py2.6.egg
    Removing /Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg
    Copying setuptools-0.6c11-py2.6.egg to /Library/Python/2.6/site-packages
    setuptools 0.6c11 is already the active version in easy-install.pth
    Installing easy_install script to /usr/local/bin
    Installing easy_install-2.6 script to /usr/local/bin
    
    Installed /Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg
    Processing dependencies for setuptools==0.6c11
    Finished processing dependencies for setuptools==0.6c11
    
  • 1

    试试这个

    mv setuptools-0.6c11-py2.6.egg.sh setuptools-0.6c11-py2.6.egg
    sh setuptools-0.6c11-py2.6.egg
    

相关问题