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 don't have a root server, so I canβt place uuid.pys in the / usr / lib / python 2.4 / site-packages folder ... is there any way I can use .py from another place? how is my ~?
There are several ways to do this. The fastest is a simple command:
export PYTHONPATH=path/to/module/directory
, virtualenv. sudo apt-get install python-virtualenv (?). , , Python.
, . - (, , ..), sys.path(, Django, ) -, .pth ( Python). , PYTHONPATH sys.path .
pth:
http://bob.pythonmac.org/archives/2005/02/06/using-pth-files-for-python-development/
, Python. uuid.py , . , uuid.py . "import uuid" ( Python). , .
, , uuid- Python 2.5 .
Python sys.path. , , . , python, - .
sys.path
, [PEP 370] [1], , [http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/][2].
, [virtualenv] [3] [pip] [4], .
Source: https://habr.com/ru/post/1714076/More articles:pygtk: Draw lines on gtk.gdk.Pixbuf - pythonGetting an array of an object from a web form using a Spring structure - javaHow can I pass console output to an ASP.NET page, how does it appear? - c #Creating XML from joining multiple tables in SQL Server - joinScala listing and reflection - reflectionHow was car physics implemented in carmageddon 2? - physicsPHP pfsockopen in session - phpInternet Explorer - how to avoid single quotes - internet-explorerASP.NET routing: missing RouteCollection class - asp.netHow to make vim recognize CJK characters and display them more than ASCII? - vimAll Articles