2017-02-28 118 views
-1

我希望有人能够提供一个资源,它可以帮助我在Bluehost的共享主机帐户上安装python 3.6.0。我已经尝试使用python 2.7的文档,但迄今为止一直没有成功。现在机器的当前状态是如果我运行python –V它说2.6.6。但是如果我把:无法让pip在共享主机环境中工作

export PATH=$HOME/python/Python-3.6.0/:$PATH 

在.bashrc文件在我的主目录,然后运行python -V它说3.6.0但是我无法得到点子工作。我还注意到,在python安装过程中,许多文件的权限被拒绝。

我真的很迷茫,因为似乎只有很少的文档介绍如何在共享主机环境中执行此操作。你的帮助将不胜感激。

这里对指令的链接我也跟着python

我想,因为它说的是安装PIP画中画9.0.2将安装,但是当我尝试运行它,它说cxommand没有找到。当我尝试的easy_install点子我回到了以下错误消息:

[Errno 30] Read-only file system: '/usr/lib/python2.6/site-packages/test-easy-install-13141.write-test' 

The installation directory you specified (via --install-dir, --prefix, or 
the distutils default setting) was: 

/usr/lib/python2.6/site-packages/ 

回答

1

,因为它试图在系统目录下安装,否则无法安装该程序包,你没有写访问。

如果可以,请使用virtualenv。当然这需要安装virtualenv。

把virtualenv放在你有写权限的地方。例如,使用these instructions

0

您也可以让系统管理员为您安装软件包。如果没有安装virtualenv,这可能是唯一的选择。请管理员安装virtualenv。

0

输入以下命令,将Python 3.6下载并提取到您的托管帐户。

mkdir ~/python 

cd ~/python 

wget http://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz 

tar zxfv Python-3.6.0.tgz 

find ~/python -type d | xargs chmod 0755 

cd Python-3.6.0 

Install Python 

Once extracted you can use the following commands to 
configure and install Python. 

./configure --prefix=$HOME/python 

make 

make install 

Modify the .bashrc 

For your local version of python to load you will need to add 
it to the .bashrc file. 
vim ~/.bashrc 

Press i 

Enter: 
export PATH=$HOME/python/Python-3.6.0/:$PATH 
export PYTHONPATH=$PYTHONPATH:$HOME/python/python3.6/site-packages/ 


Write the changes (press ESC) and close vim: 
:wq 

Press Enter 
source ~/.bashrc 

现在使用PIP:

python -m pip install package-of-interest