bash linux redhat 6 并安装easy_install
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19134782/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
linux redhat 6 and installing easy_install
提问by ggomersall
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
我有一个运行 Linux Redhat 6 并使用 Python 2.7(刚刚从 Python 2.6 设置为默认值)的托管服务器,位于 /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
我正在尝试在服务器上设置 easy_install,但我不确定我是否做得正确,在我正在运行的 bash 屏幕上: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
但它一直要求提供 sudo 密码,我假设这是我用来通过 SSH 登录的普通管理员密码?我使用了我的管理员密码和 root 密码,这两个密码似乎都不起作用,有人可以帮忙吗?也许这是我身边的视线(作为新手)。谢谢加雷斯
回答by Ewan
A couple of things:
几件事:
- 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.
- 您的
sudo
密码可能是您服务器上用户帐户的密码,但您的用户帐户可能没有sudo
访问权限。该命令是否提供任何输出? - 您使用的是 RedHat,但是您的
apt-get install
命令是特定于 Debian/Ubuntu 的。您正在寻找的等价物是yum install
- 但是,
yum
使用 Python 2.6 并且您从yum
存储库安装的任何 python 包都将为此版本的 python 安装,但不适用于 python 2.7。
To get around this you have a couple of options:
要解决这个问题,您有几个选择:
- 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.
- 使用类似的东西
pythonbrew
,它允许你在你的系统上切换 python 解释器(你仍然不能,yum install python-setuptools
但允许你在 Python 2.6/2.7/3.3 之间轻松切换) - 只要给你python2.7,使用
setuptools
网站下面的命令wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
安装即可python
- 这样做之后,
easy_install pip
得到pip
安装在系统上(希望为Python 2.7) - 使用
virtualenv
's - 它们可以sudo
解决您的所有问题。