1

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

4

1 回答 1

2

有几件事:

  1. 您的sudo密码可能是您服务器上用户帐户的密码,但是您的用户帐户可能无权sudo访问。该命令是否提供任何输出?
  2. 您使用的是 RedHat,但是您的apt-get install命令是特定于 Debian/Ubuntu 的。您正在寻找的等价物是yum install
  3. 但是yum使用 Python 2.6 并且您从yum存储库安装的任何 python 包都将安装在此版本的 python 中,并且不适用于 python 2.7。

为了解决这个问题,您有几个选择:

  1. 使用类似的东西pythonbrew可以让你在你的系统上切换 python 解释器(你仍然不能,yum install python-setuptools但可以让你在 Python 2.6/2.7/3.3 之间轻松切换)
  2. 只要给你python2.7setuptools就用网站下面的命令wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python安装python
  3. 之后,easy_install pip安装pip在你的系统上(希望是 python 2.7)
  4. 使用virtualenv's - 他们可以解决你所有的sudo问题。
于 2013-10-02T10:27:37.893 回答