Move python folder on linux
<p>I have compiled python sources with the <code>--prefix</code> option. After running <code>make install</code> the binaries are copied to a folder of my account's home directory.</p>

<p>I needed to rename this folder but when I use pip after the renaming it says that it can't find the python interpreter. It shows an absolute path to the previous path (before renaming).</p>

<p>Using grep I found out multiple references to absolute paths relative to the <code>--prefix</code> folder.</p>

<p>I tried to override it by setting the <code>PATH</code>,<code>PYTHONPATH</code> and <code>PYTHONHOME</code> environment variables but it's not better.</p>

<p>Is there a way to compile the python sources in a way that I can freely moves it after ?</p>

<p>Pip is a python script. Open it and see : </p>

<p>it begins with <code>#!/usr/bin/python</code></p>

<p>You can either create a symbolic link in the old path to point to the new one, or replace the shebang with the new path. You can also keep your distrib interpreter safe by leaving it be and set the compiled one into a new <strong>virtualenv</strong>.</p>

python linux python-3.5