我希望有人可以提供一个资源,帮助我在Bluehost的共享主机帐户上安装python 3.6.0。我已经尝试使用python 2.7的文档但是迄今为止都没有成功。现在机器的当前状态是如果我运行python –V
它说2.6.6。但是,如果我放置:
export PATH=$HOME/python/Python-3.6.0/:$PATH
在我的主目录中的.bashrc文件中然后运行python -V它说3.6.0但是我无法让pip工作。我还注意到在python安装过程中,许多文件都拒绝了权限。
我真的很茫然,因为在共享托管环境中如何执行此操作的文档似乎很少。非常感谢您的帮助。
这是指示我跟踪python
的说明的链接我认为pip会被安装,因为它说已经安装了pip 9.0.2但是当我尝试运行它时它说找不到cxommand。当我尝试easy_install pip时,我收到了以下错误消息:
[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/
答案 0 :(得分:1)
您无法安装该软件包,因为它正在尝试将它们安装在系统目录中,并且您没有写访问权。
如果可以,请使用virtualenv。当然这需要安装virtualenv。
将virtualenv放在您具有写权限的位置。例如,使用these instructions。
答案 1 :(得分:0)
您也可以要求系统管理员为您安装软件包。如果还没有安装virtualenv,这可能是唯一真正的选择。请管理员安装virtualenv。
答案 2 :(得分: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