Monday, April 29, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2754  / 1 Year ago, sat, march 11, 2023, 5:48:45

I mostly understand apt-get and the Ubuntu Software Center, but one thing that I can't get at all is manually installing packages for which apt-get does not work. The file structure and layout of Ubuntu is really odd to me.


I am running Ubuntu 12.10 and have a Python library that I need to install. It's not one that you can get through apt-get or pip.


I have downloaded the zip file without any problem. As far I can tell I have to then extract it to usr/share/doc (at least this is where my other libraries store files to install for Python through apt-get).


I have no idea how to do this though since the GUI doesn't let me do anything that's not in my account folder. As far as I can tell, the usr is some completely disconnected file structure when it comes to a terminal (I can't simply back up a level from my user account to usr for instance).


What's the right way to install this Python library?


More From » software-installation

 Answers
7

You should not put the file (or, actually, anything) into /usr... manually - this area is managed by Ubuntu's package manager.



I suppose you need the library because you want to write some Python script/program, right?



In this case you can just put it in the same folder as your program/script and do



from clientsubnetoption import ClientSubnetOption


Note that the library has a dependency on dnspython which, luckily, is in Ubuntu repositories so you can install it with



sudo apt-get install python-dnspython


(as a side-note: normally Python libraries are distributed as "python eggs" which are published in the central "store" called Python Package Index: https://pypi.python.org . From there they can be installed using special tools, such as easy_install, pip or zc.buildout. You can also create isolated Python environments using virtualenv and zc.buildout so there's absolutely no need to install even complex libraries system-wide)


[#27357] Sunday, March 12, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
exceeeelh

Total Points: 21
Total Questions: 109
Total Answers: 120

Location: Marshall Islands
Member since Wed, Jan 5, 2022
2 Years ago
exceeeelh questions
Sun, Nov 20, 22, 17:08, 1 Year ago
Sat, Jan 1, 22, 08:04, 2 Years ago
Wed, May 12, 21, 05:11, 3 Years ago
;