Installing Jinja2 on a server without root access
I am trying to install Jinja2 on a web server. I tried running the command "easy_install Jinja2" as they suggested and got an error:
[Errno 13] Permission denied: '/usr/lib/python2.5/site-packages/test-easy-install-15897.write-test'
I tho开发者_高级运维ught that since this was a permission problem, I tried the same thing with "sudo". I was asked for a password and told I don't have permission.
I tried installing Jinja2 with "python setup.py" and ran into similar problems.
I contacted my web hosting company (DreamHost, in case that matters), and they said I had to pay for their VPS service to get root access. I would prefer to install this without paying extra. They said I may have some luck installing it to my home directory, but they wouldn't guarantee anything. Does anyone here know how to do this? I have never used Jinja2, easy_install, or setuptools in my life until just now, so I don't know much about any of these things.
You can probably use virtualenv for solve this.
easy_install --user Jinja2
I know this is an old thread, but since I have just done what you were asking, here is how. You only need python installed for this method.
Download the get-pip file on your home directory:
wget https://bootstrap.pypa.io/get-pip.py
Run this command to install pip on your ~/.local:
python get-pip.py --user
To add your new ~/.local/bin folder to your path, run or add to .bash_profile:
export PATH=$PATH:~/.local/bin
To install Jinja2, run:
pip install --user Jinja2
Remember to always put --user when using pip.
精彩评论