Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to utilize a python module that isnt installed into the python directories in linux?

Tags:

python

linux

I have a python application that depends on the uuid module, but on the server where I need to run it, uuid is not installed. I do not have root on the server so I cannot place the uuid .pys in the /usr/lib/python2.4/site-packages folder... is there a way that I can utilize the .py's from elsewhere? like my ~ ?

like image 918
Ryan Avatar asked Feb 27 '26 03:02

Ryan


1 Answers

There are several ways to do this. The fastest is the simple command:

export PYTHONPATH=path/to/module/directory

Alternatively, you can use virtualenv. Just sudo apt-get install python-virtualenv (?). It's a very common development tool used for using modules that you don't necessarily want installed in your local Python installation.

like image 115
Owen Pierce Avatar answered Feb 28 '26 16:02

Owen Pierce



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!