linux redhat 6和安装easy_install [英] linux redhat 6 and installing 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
推荐答案
以下几点:
- 您的
sudo
密码可能是服务器上用户帐户的密码,但是您的用户帐户可能没有sudo
访问权限.该命令是否提供任何输出? - 您正在使用RedHat,但是您的
apt-get install
命令是Debian/Ubuntu特定的.您要寻找的等效项是yum install
- 但是,
yum
使用Python 2.6,并且将从yum
存储库安装的所有python软件包都将为此版本的python安装,而python 2.7不可用.
- Your
sudo
password is likely the password for the user account on your server, however your user account may not havesudo
access. Does the command provide any output? - You're using RedHat however your
apt-get install
command is Debian/Ubuntu specific. The equivalent you are looking for isyum install
- However,
yum
uses Python 2.6 and any python package you install from theyum
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:
- 使用类似
pythonbrew
之类的东西,它允许您在系统上切换python解释器(您仍然不会能够yum install python-setuptools
,但允许您在Python 2.6/2.7/3.3之间轻松切换) - 从
setuptools
网站wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
使用以下命令来只要python
给您python2.7,就安装 - 完成此操作后,
easy_install pip
即可在系统上安装pip
(希望适用于python 2.7) - 使用
virtualenv
,它们会解决您所有的sudo
问题./li>
- Use something like
pythonbrew
which allows you to switch python interpreters on your system (you still wont be able toyum install python-setuptools
but allows you to easily switch between Python 2.6/2.7/3.3) - Use the following command from the
setuptools
websitewget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
to install as long aspython
gives you python2.7 - After doing that,
easy_install pip
to getpip
installed on your system (hopefully for python 2.7) - Use
virtualenv
's - they get round all yoursudo
problems.
这篇关于linux redhat 6和安装easy_install的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!