0

I'm on a Shared hosting, with a limited SSH access.

don't have sudo privileges.

And there are some limitations on some folders, as the following:

This is the output of the termial ls -al :

drwx--x--x  17  myusername  myusername  4096    May 23 03:02    .
drwxr-xr-x  3   root        root        4096    Mar 27 11:02    ..
lrwxrwxrwx  1   myusername  myusername  34      Mar 27 01:31    access-logs -> /usr/local/apache/domlogs/myusername
-rw-------  1   myusername  myusername  640     Mar 29 23:56    .bash_history
-rw-r--r--  1   myusername  myusername  18      Oct 14  2014    .bash_logout
-rw-r--r--  1   myusername  myusername  176     Oct 14  2014    .bash_profile
-rw-r--r--  1   myusername  myusername  124     Oct 14  2014    .bashrc
drwxrwx--x  4   myusername  myusername  4096    Mar 27 11:02    .cagefs
drwxr-xr-x  2   myusername  myusername  4096    Mar 27 01:21    .cl.selector
-rw-------  1   myusername  myusername  21      Mar 27 01:21    .contactemail
drwx------  5   myusername  myusername  4096    Mar 31 18:49    .cpanel
-rw-r-----  1   myusername  myusername  1       Mar 31 18:14    cpbackup-exclude.conf
drwxr-x---  2   myusername  mail        4096    Mar 31 20:25    etc
-rw-------  1   myusername  myusername  16      Apr 29 02:50    .ftpquota
-rw-r--r--  1   myusername  myusername  140     Mar 27 01:21    .gemrc
drwxr-x---  2   myusername  nobody      4096    Mar 27 01:21    .htpasswds
-rw-------  1   myusername  myusername  13      Mar 31 18:46    .lastlogin
drwx------  2   myusername  myusername  4096    May 17 02:05    logs
drwxr-x---  8   myusername  myusername  4096    Mar 27 01:21    mail
-rw-------  1   myusername  myusername  44      Mar 27 16:26    .my.cnf
drwxrwxr-x  2   myusername  myusername  4096    Mar 29 11:33    perl5
drwxr-x---  3   myusername  myusername  4096    Mar 27 01:21    public_ftp
drwxr-xr-x  6   myusername  nobody      4096    May 25 20:23    public_html
drwx--x--x  4   myusername  myusername  4096    Mar 27 01:54    .softaculous
drwx------  2   myusername  myusername  4096    Mar 29 11:30    .ssh
drwxr-xr-x  5   myusername  myusername  4096    Mar 31 18:14    ssl
drwxr-xr-x  8   myusername  myusername  4096    Mar 29 20:24    tmp
drwx------  2   myusername  myusername  4096    Mar 27 16:22    .trash
lrwxrwxrwx  1   myusername  myusername  11      Mar 27 01:21    www -> public_html

My goal is installing Python packages using PIP & Virutalenv.

And because of limitations, I'm trying to use a sudo-free method to install PIP and Virtualenv into the user local, following this tutorial!

=============

These steps went alright:

$wget https://bootstrap.pypa.io/ez_setup.py -O - | python - --user

and response from the server was:

...........
...........    
Processing setuptools-16.0-py2.6.egg
Copying setuptools-16.0-py2.6.egg to /home/myusername/.local/lib/python2.6/site-packages
Adding setuptools 16.0 to easy-install.pth file
Installing easy_install script to /home/myusername/.local/bin
Installing easy_install-2.6 script to /home/myusername/.local/bin

Installed /home/myusername/.local/lib/python2.6/site-packages/setuptools-16.0-py2.6.egg
Processing dependencies for setuptools==16.0
Finished processing dependencies for setuptools==16.0

And this step also:

$wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py -O - | python - --user


............
............
Installing collected packages: pip, argparse, wheel
Successfully installed argparse-1.3.0 pip-7.0.1 wheel-0.24.0

Now, my question is:

How can I RUN these packages? :D

as you see, I don't have access to folder ~/.local/ , It do NOT appear in the ls -al as you have seen above!

And writing pip in the SSH terminal gives me:

$ pip
-bash: pip: command not found

$ python pip
python: can't open file 'pip': [Errno 2] No such file or directory

$ cd /.local/
-bash: cd: /.local/: No such file or directory

$ /.local/bin/pip
-bash: /.local/bin/pip: No such file or directory

$ python /.local/bin/pip
python: can't open file '/.local/bin/pip': [Errno 2] No such file or directory

Sorry, if my question was confusing or wasn't clear enough!

0

For use the pip install

$ mkdir my_project_folder
$ cd my_project_folder
$ curl -L -o virtualenv.py https://raw.github.com/pypa/virtualenv/master/virtualenv.py
$ python virtualenv.py venv
$ source venv/bin/activate

In this point, you have you virtualenv ready, if you want install more packages, you can this:

$ pip install YOUR_PACKAGE --user

So, you can installing packages without touching the system Python directories, typically in ~/.local/

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.