linux redhat 6 and installing easy_install

て烟熏妆下的殇ゞ 提交于 2019-12-01 10:12:48

问题


I'm completely new at this and needed a bit of help.

I've got a hosted server running Linux Redhat 6 and using Python 2.7 (which has just been set as the default from Python 2.6) located at /usr/local/bin/python2.7

I'm trying to setup easy_install on the server, but I'm not sure if i'm doing it correctly, on the bash screen i'm running: sudo apt-get install python-setuptools

But it keeps asking for a sudo password, which i'm assuming is my normal admin password that i've used to login via SSH? I've used my admin password and my root password which both don't seem to work, can any one help? Maybe it's an over sight from my side (being a newbie). Thanks Gareth


回答1:


A couple of things:

  1. Your sudo password is likely the password for the user account on your server, however your user account may not have sudo access. Does the command provide any output?
  2. You're using RedHat however your apt-get install command is Debian/Ubuntu specific. The equivalent you are looking for is yum install
  3. However, yum uses Python 2.6 and any python package you install from the yum repository will be installed for this version of python and not available to python 2.7.

To get around this you have a couple of options:

  1. Use something like pythonbrew which allows you to switch python interpreters on your system (you still wont be able to yum install python-setuptools but allows you to easily switch between Python 2.6/2.7/3.3)
  2. Use the following command from the setuptools website wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python to install as long as python gives you python2.7
  3. After doing that, easy_install pip to get pip installed on your system (hopefully for python 2.7)
  4. Use virtualenv's - they get round all your sudo problems.


来源:https://stackoverflow.com/questions/19134782/linux-redhat-6-and-installing-easy-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!