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 4324370
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:07:24+00:00 2026-05-21T09:07:24+00:00

Assume I have a virtualenv installation that does not use –no-site-packages . I run

  • 0

Assume I have a virtualenv installation that does not use --no-site-packages. I run bin/pip install somepackage==1.0.0, but it’s already present in my site-packages so it’s not installed. Later, the copy installed site-packages is updated to somepackage==2.0.0.

What will happen in my virtualenv? Will it use the version 2, or download version 1 for itself?

  • 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-05-21T09:07:25+00:00Added an answer on May 21, 2026 at 9:07 am

    It depends. If none of the packages that are importing somepackage use the setuptools API, then it works as described above. If any packages in your virtualenv use setuptools (or Distribute) to specify specific version requirements for somepackage, setuptools will search for a version of somepackage that meets the requirements. If it can’t find a suitable installed version at install time, it will search externally and attempt to install it. If it can’t find one at runtime, the program fails with an exception.

    from setuptools import setup
    setup(
        name = "HelloWorld",
        version = "0.1",
        scripts = ['say_hello.py'],
        install_requires = ['somepackage == 1.0.0'],
    )
    

    For example, if somepackage 1.0.0 was already installed in the system site-packages, everything is fine. If you then update the system site-packages to somepackage 2.0.0 with pip, which uninstalls the old version, the script will fail at runtime with:

    pkg_resources.DistributionNotFound: somepackage==1.0.0
    

    If you installed both versions of somepackage with easy_install instead of pip, things would normally be different. By default, easy_install does not uninstall packages and it supports multiple versions of packages (multi-version eggs). So both versions of somepackage would be available in the system site-packages and the script would not fail.

    setuptools (and the Distribute clone of it) has to jump through many hoops to make the multiple version support work reasonably. Many developers frown on all that extra complexity and argue that it is easier and more transparent to support multiple versions of packages with separate virutalenv‘s and, for that, the simpler model of pip is more appropriate. (In fairness to setuptools, virtualenv came along later.)

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

Sidebar

Related Questions

Assume we have an ASP.NET MVC3 Web site that makes use of Entity Framework
Assume I have an ASP.NET MVC app that's not doing anything too fancy (no
Assume I have a class foo, and wish to use a std::map to store
Assume you have five products, and all of them use one or more of
Assume I have 2 controllers that handle 2 parts of the page - header
Assume we have a website that asks the user for his name. The website
Assume I have a table that has the following structure: ================= | Id |
Assume I have a List<SomeObject> a . Now also assume that I have another
Assume we have legacy classes, that can't be modified: class Foo { public void
Assume I have an array $arr. It's possible that it has an element with

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.