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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:22:57+00:00 2026-06-13T03:22:57+00:00

Possible Duplicate: Python – It is possible to install another version of Python to

  • 0

Possible Duplicate:
Python – It is possible to install another version of Python to Virtualenv?

Within my (virtualenv activated) env folder, it appears as though the python2.7 folder has symlinks to absolute paths for my system python installation.

This is not ideal.

Even when I install from a local path, and use virtualenv to set and environment in a folder env, the paths to Python are absolute, and a dependency on the OS environment is established. I want to rid this dependency and make the python interpreter, as well as all software relying upon it, completely independent.

Let’s imagine that I want python2.6 to be included IN the env tree as a STAND-ALONE installation without symlinks to my system folders.

How does one accomplish this feat of extraordinary non-linkage?

$ > pwd 
/Users/foo/development/v1/bar/env
(env)
$ > ls -l lib/python2.7/
total 920
lrwxr-xr-x  1 foo  staff     82 Oct 15 16:48 UserDict.py -> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py
...
lrwxr-xr-x  1 foo  staff     85 Oct 15 16:48 _weakrefset.py -> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py

Thank you for your help.

EDIT: Moreover, it will be most ideal to have the virtualenv (including the local python install) relocatable.

  • 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-13T03:22:58+00:00Added an answer on June 13, 2026 at 3:22 am

    UPDATE: Please ALSO refer to Is it possible to install another version of Python to Virtualenv?

    Big thanks to @millimoose, et al.

    Here’s what I ended up doing, very specifically. I will update if I encounter problems in the future.

    1. Set up environment folders.

      $ mkdir env
      $ mkdir pyenv
      $ mkdir dep
      
    2. Get Python-2.7.3, and virtualenv without any form of root OS installation.

      $ cd dep
      $ wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
      $ wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py
      
    3. Extract and install Python-2.7.3 into the pyenv dir. make clean is optional if you are doing this a 2nd, 3rd, Nth time…

      $ tar -xzvf Python-2.7.3.tgz
      $ cd Python-2.7.3
      $ make clean
      $ ./configure --prefix=/path/to/pyenv
      $ make && make install
      $ cd ../../
      $ ls
      dep    env    pyenv
      
    4. Create your virtualenv

      $ dep/virtualenv.py --python=/path/to/pyenv/bin/python --verbose env
      
    5. Fix the symlink to python2.7 within env/include/

      $ ls -l env/include/
      $ cd !$
      $ rm python2.7
      $ ln -s ../../pyenv/include/python2.7 python2.7
      $ cd ../../
      
    6. Fix the remaining python symlinks in env. You’ll have to delete the symbolically linked directories and recreate them, as above. Also, here’s the syntax to force in-place symbolic link creation.

      $ ls -l env/lib/python2.7/
      $ cd !$
      $ ln -sf ../../../pyenv/lib/python2.7/UserDict.py UserDict.py
      [...repeat until all symbolic links are relative...]
      $ cd ../../../
      
    7. Test

      $ python --version
      Python 2.7.1
      $ source env/bin/activate
      (env)
      $ python --version
      Python 2.7.3
      

    Aloha.

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

Sidebar

Related Questions

Possible Duplicate: Way to have compiled python files in a separate folder? When python
Possible Duplicate: Python : how to append new elements in a list of list?
Possible Duplicate: Python: What is the best way to check if a list is
Possible Duplicate: Python: Get object by id Typically when you see the string representation
Possible Duplicate: Python: Behaviour of increment and decrement operators >>> a=2 >>> ++a 2
Possible Duplicate: python: how to jump to a particular line in a huge text
Possible Duplicate: Python ‘==’ vs ‘is’ comparing strings, ‘is’ fails sometimes, why? Is a
Possible Duplicate: Python ‘==’ vs ‘is’ comparing strings, ‘is’ fails sometimes, why? In Python,
Possible Duplicate: Python or Ruby Interpreter on iOS I just discovered this apps pypad
Possible Duplicate: Python, compute list difference I have two lists For example: A =

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.