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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:33:55+00:00 2026-05-31T08:33:55+00:00

I can create a .pth file and put it in my virtualenv lib\site-packages to

  • 0

I can create a .pth file and put it in my virtualenv lib\site-packages to bring the MySQLdb that is installed by the windows installer into my virtualenv. But so far the only way I have been able to get this to work is if I use this path in the .pth file:

C:\python27\lib\site-packages

This of course now brings in the ENTIRE lib\site-packages into the virtualenv.

How do I add ONLY MySQLdb to the virtual environment?

Yes, it’s on Windows. No, I can’t switch to a real OS for this so I could use add2virtualenv from virtualenvwrapper.

  • 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-31T08:33:56+00:00Added an answer on May 31, 2026 at 8:33 am

    After way too much wasted time I’ve become convinced it is too hard to get mysqldb into a virtualenv with symbolic links on windows. However it is possible to fix it like so:

    xcopy c:\python27\lib\site-packages\MySQLdb c:\Python\VirtualENV\lib\site-packages\MySQLdb /s/e
    

    And tell it that this is a directory (not a file)

    xcopy c:\python27\lib\site-packages\MySQL_python-1.2.3-py2.7.egg-info c:\Python\VirtualENV\lib\site-packages\ MySQL_python-1.2.3-py2.7.egg-info /s/e
    

    And tell it that this is a directory (not a file)

    copy c:\python27\lib\site-packages_mysql*.* c:\Python\VirtualENV\lib\site-packages

    You may at some point have to deal with 1.2.3 being something else, and of course VirtualENV is the virtualENV you need the support in.

    You can get the mysql stuff from this link.

    http://www.codegood.com/archives/129

    Part of the problem comes from the fact that not all the mysql files are in the mysql directories. If they were, then a couple of symbolic links would work, but they aren’t and it isn’t worth fixing for windows.

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

Sidebar

Related Questions

I can create a menu item in the Windows Explorer context menu by adding
I can create a contact that is not mail enabled, but how do I
One can create an anonymous object that is initialized through constructor parameters, such as
I can create an array of buttons in Windows Form but how can i
I can create .o file with g++ -c test.cpp -std=c++0x , but cant link
How can create multilingual Django site? Is it a good idea to create template
I can create a image folder when I create a category, so that I
How can create a mask input for number that have percent by jQuery? Do
I can create a page from a file with: Page page = BuildManager.CreateInstanceFromVirtualPath( virtualPath,
I can create a block that will extract hash elements and turn them into

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.