Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8365985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:47:48+00:00 2026-06-09T12:47:48+00:00

I’m guessing my question is pretty basic, but after 15-20 minutes on Google and

  • 0

I’m guessing my question is pretty basic, but after 15-20 minutes on Google and YouTube, I am still a little fuzzy. I am relatively new to both Linux and Python, so I am having some difficulty comprehending the file system tree (coming from Windows).

From what I’ve found digging around the directories in Ubuntu (which is version 12.04, I believe, which I am running in VBox), I have ID’d the following two directories related to Python:

  1. /usr/local/lib/python2.7 which contains these two subdirectories:

    dist-packages
    site-packages

    both of which do not show anything when I type “ls” to get a list of the files therein, but show “. ..” when I type “ls -a”.

  2. /usr/lib/python2.7 which has no site-packages directory but does have a dist-packages directory that contains many files and subdirectories.

So if I want to install a 3rd party Python module, like, say, Mechanize, in which one of the above directories (and which subdirectory), am I supposed to install it in?

Furthermore, I am unclear on the steps to take even after I know where to install it; so far, I have the following planned:

  1. Download the tar.gz (or whatever kind of file the module comes in) from whatever site or server has it
  2. Direct the file to be unzipped in the appropriate subdirectory (one of the 2 listed above)
  3. Test to make sure it works via import mechanize in interactive mode.

Lastly, if I want to replace step number 1 above with a terminal command (something like sudo apt-get), what command would that be, i.e., what command via the terminal would equate to clicking on a download link from a browser to download the desired file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:47:50+00:00Added an answer on June 9, 2026 at 12:47 pm

    virtualenv is the de facto Python standard for installing third party library cleanly. Read more about it here:
    http://www.virtualenv.org/

    Usage example:

    daniel@redhotcar:~/tmp$ virtualenv myenv
    New python executable in myenv/bin/python
    Installing distribute....................................................................................................................................................................................done.
    Installing pip...............done.
    daniel@redhotcar:~/tmp$ cd myenv/
    daniel@redhotcar:~/tmp/myenv$ bin/pip install mechanize
    Downloading/unpacking mechanize
      Downloading mechanize-0.2.5.zip (445Kb): 445Kb downloaded
      Running setup.py egg_info for package mechanize
    
    Installing collected packages: mechanize
      Running setup.py install for mechanize
    
    Successfully installed mechanize
    Cleaning up...
    daniel@redhotcar:~/tmp/myenv$ bin/python
    Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
    [GCC 4.6.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import mechanize
    >>> mechanize
    <module 'mechanize' from '/home/daniel/tmp/myenv/local/lib/python2.7/site-packages/mechanize/__init__.pyc'>
    >>> 
    

    On Ubuntu, install virtualenv via apt-get install python-virtualenv

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to construct a data frame in an Rcpp function, but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.