How to install setuptools?

前端 未结 4 1023
悲&欢浪女
悲&欢浪女 2020-12-09 23:42

I\'m trying to install setuptools. When I run \"sh setuptools-0.6c9-py2.4.egg\" I get the following message:

Permission denied: \'/usr/lib/python2.4

相关标签:
4条回答
  • 2020-12-09 23:51

    Virtualenv comes with setuptools pre-installed, I believe. I know that it at least comes with easy_install. You should then be able to run:

    /home/myname/bin/easy_install setuptools
    

    This should install the newest version of setuptools on your virtualenv.

    0 讨论(0)
  • 2020-12-09 23:59

    Just adding extra detail to what already have been said.

    1. Download tar.gz of the latest version of virtualenv.
    2. Unpack it.
    3. You don't even need to install it, just run virtualenv.py, for example:
      virtualenv-1.3.3/virtualenv.py mypyenv
      mypyenv virtual Python environment will be created in your current directory and it will contain easy_install ready to use.
    4. Activate it:
      source mypyenv/bin/activate
      or on Windows do:
      mypyenv\Scripts\activate.bat
      Now, your PATH is set to point at Python executables under mypyenv. From this shell session, you will be able to easy_install whatever you want, and resulting stuff will be installed in the guts of mypyenv instead of your default Python location, thus obviating any need for admin privileges.

    OS X Snow Leopard caveat:
    For some reason, virtualenv-1.3.3 does not play well with built-in Python under /System/Frameworks. I had to build a separate version of Python from source, and installed it under /usr/local/python_2_6_2.
    With that done, I used --python /usr/local/python_2_6_2/bin/python option with virtualenv.

    0 讨论(0)
  • 2020-12-10 00:04

    You have to activate your virtualenv first, else you just have a bunch of folders. Use the full path to the scripts in your virtual env's bin or do source bin/activate

    0 讨论(0)
  • 2020-12-10 00:16

    On linux you can run next command

    wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python

    0 讨论(0)
提交回复
热议问题