-1

I was hoping someone might be able to provide a resource that will help me install python 3.6.0 on a shared hosting account at Bluehost. I’ve tried using the documentation for python 2.7 but have been unsuccessful to date. The current state of the machine now is if I run python –V it says 2.6.6 . If, however I place:

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

in the .bashrc file in my home directory and then run python –V it says 3.6.0 However I am unable to get pip to work. I also noticed that during the python setup procedure permission was denied on a number of files.

I am really at a lost as there seems to be very little documentation for how to do this on a shared hosting environment. Your help would be greatly appreciated.

here's a link to the instructions I followed python

I thought pip would be installed as it said pip 9.0.2 was installed but when I try to run it it say cxommand not found. When I tried easy_install pip I got back the following error message:

[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/
DCR
  • 14,737
  • 12
  • 52
  • 115

3 Answers3

1

You cannot install the package because it is trying to install them in the system directory, and you do not have write access.

If you can, use a virtualenv. Of course this requires virtualenv be installed.

Put the virtualenv somewhere you have write access to. For example, use these instructions.

Community
  • 1
  • 1
Penguin Brian
  • 1,991
  • 14
  • 25
1

Enter the following commands to download and extract Python 3.6 to your hosting account.

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

Now to use pip:

python -m pip install package-of-interest
DCR
  • 14,737
  • 12
  • 52
  • 115
-1

You could also ask the system administrator to install the package for you. This might be the only real option if virtualenv hasn't been installed. Ask the administrator to install virtualenv.

Penguin Brian
  • 1,991
  • 14
  • 25