2017-02-28 72 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