Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This procedure installs Python2.7 <strong>anywhere and eliminates any absolute path references</strong> within your <code>env</code> folder <em>(managed by virtualenv)</em>. Even virtualenv isn't installed absolutely. </p> <p>Thus, theoretically, you can drop the top level directory into a tarball, distribute, and run anything configured within the tarball on a machine that doesn't have Python <em>(or any dependencies)</em> installed.</p> <p>Contact me with any questions. This is just part of an ongoing, larger project I am engineering. Now, for the drop...</p> <ol> <li><p>Set up environment folders.</p> <pre><code>$ mkdir env $ mkdir pyenv $ mkdir dep </code></pre></li> <li><p>Get Python-2.7.3, and virtualenv <strong>without</strong> any form of root OS installation.</p> <pre><code>$ 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 </code></pre></li> <li><p>Extract and install Python-2.7.3 into the <code>pyenv</code> dir. <code>make clean</code> is optional if you are doing this a 2nd, 3rd, Nth time...</p> <pre><code>$ tar -xzvf Python-2.7.3.tgz $ cd Python-2.7.3 $ make clean $ ./configure --prefix=/path/to/pyenv $ make &amp;&amp; make install $ cd ../../ $ ls dep env pyenv </code></pre></li> <li><p>Create your virtualenv</p> <pre><code>$ dep/virtualenv.py --python=/path/to/pyenv/bin/python --verbose env </code></pre></li> <li><p>Fix the symlink to python2.7 within <code>env/include/</code></p> <pre><code>$ ls -l env/include/ $ cd !$ $ rm python2.7 $ ln -s ../../pyenv/include/python2.7 python2.7 $ cd ../../ </code></pre></li> <li><p>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.</p> <pre><code>$ 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 ../../../ </code></pre></li> <li><p>Test</p> <pre><code>$ python --version Python 2.7.1 $ source env/bin/activate (env) $ python --version Python 2.7.3 </code></pre></li> </ol> <p>Aloha.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload