linux redhat 6和安装easy_install [英] linux redhat 6 and installing easy_install

查看:117
本文介绍了linux redhat 6和安装easy_install的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,需要一些帮助.

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

我有一个位于/usr/local/bin/python2.7的托管服务器,该服务器运行Linux Redhat 6并使用Python 2.7(这是Python 2.6的默认设置)

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

我正在尝试在服务器上设置easy_install,但不确定在运行的bash屏幕上是否正确执行了操作:sudo apt-get install python-setuptools

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

但是它一直要求输入一个sudo密码,我假设这是我用来通过SSH登录的普通管理员密码?我已经使用了管理员密码和root密码,但似乎都无法使用,请问有什么可以帮助的吗?从我的角度来看(也许是个新手)可能是一个遥不可及的事情. 谢谢加雷斯(Gareth)

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. 您的sudo密码可能是服务器上用户帐户的密码,但是您的用户帐户可能没有sudo访问权限.该命令是否提供任何输出?
  2. 您正在使用RedHat,但是您的apt-get install命令是​​Debian/Ubuntu特定的.您要寻找的等效项是yum install
  3. 但是yum使用Python 2.6,并且将从yum存储库安装的所有python软件包都将为此版本的python安装,而python 2.7不可用.
  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. 使用类似 pythonbrew 之类的东西,它允许您在系统上切换python解释器(您仍然不会能够yum install python-setuptools,但允许您在Py​​thon 2.6/2.7/3.3之间轻松切换)
  2. setuptools 网站wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python使用以下命令来只要python给您python2.7,就安装
  3. 完成此操作后,easy_install pip即可在系统上安装pip(希望适用于python 2.7)
  4. 使用 virtualenv ,它们会解决您所有的sudo问题./li>
  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.

这篇关于linux redhat 6和安装easy_install的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆