Bertrand Bertrand - 13 days ago 4
Linux Question

Move python folder on linux

I have compiled python sources with the

option. After running
make install
the binaries are copied to a folder of my account's home directory.

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).

Using grep I found out multiple references to absolute paths relative to the

I tried to override it by setting the
environment variables but it's not better.

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


Pip is a python script. Open it and see :

it begins with #!/usr/bin/python

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 virtualenv.