noteness
Dec 02 2015

Install Python modules without root
5  2K+ {{tagitem.name}}
Python is a very easy-to-learn programming language yet very powerful. So many people code in python. and python has so much libraries for you to use, that you will need them, but can't use them because you are not root, right? but python has its own container for that, it's virtualenv. So let's see how we can install them: first download it's source, the latest one is 13.1.2, so we will use that
type
wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-13.1.2.tar.gz
then extrace it:
tar -xvf virtualenv-13.1.2.tar.gz
then cd into the directory:
cd virtualenv-13.1.2
then install the virtual env binaries: we will be installing that to a directory named proj in home so
./virtualenv.py ~/proj
and then cd to home:
cd ~
then activate the virtualenv:
source ~/proj/bin/activate
Voila! Your python container is active! So now to install your packages just use pip, eg:
pip install pika
:D
So the thing is that you will have to do the `source ~/proj/bin/activate` everytime you login, to avoid that type this:
echo "source ~/proj/bin/activate" >> ~/.bashrc
So now, your virtualenv will be activated eveytime you login :D Cheers! And send me ponies!
Again, this should be in Tutorials section.
Staff StephenS    Dec 07 2015
Great guide!
RoMBot    Oct 29 2016
I'm getting:

<code>Command "python setup.py egg_info" failed with error code 1 in /home/K/KiDo/.tmp /pip-build-XcBMuj/aiohttp/ </code>

when I try:


pip install -U discord.py[voice]
KiDo    Jun 26 2017
any idea on how to install pip3 ??? because pip install xxx only works with python2
Frostbite    May 06 2018
tar -xvf virtualenv-13.1.2.tar.gz

I am getting this:

tar: This does not look like a tar archive

gzip: stdin: unexpected end of file

tar: Child returned status 1

tar: Error is not recoverable: exiting now
dreambb    Dec 26 2023

Please Login or Sign Up to leave a reply.