@@ -0,0 +1,1208 @@
+#!/usr/bin/env python%0A%0Aimport os%0Aimport sys%0Afrom builtins import FileExistsError%0A%0Atry:%0A    venv = os.environ%5B'VIRTUAL_ENV'%5D%0Aexcept KeyError:%0A    print('Virtual environment is not detected.')%0A    raise%0A%0Apython_venv_version = sys.version_info%5B:2%5D%0Asite_version = str(python_venv_version%5B0%5D) + '.' + str(python_venv_version%5B1%5D)%0Aif python_venv_version in %5B(3, 5), (3, 6)%5D:%0A    dist_version = '3'%0A    sip = 'sip.cpython-35m-x86_64-linux-gnu.so'%0Aelif python_venv_version in %5B(2, 7)%5D:%0A    dist_version = '2.7'%0A    sip = 'sip.x86_64-linux-gnu.so'%0Aelse:%0A    error_message = ' '.join(%5B'Python', site_version, 'is not supported.'%5D)%0A    sys.exit(error_message)%0A%0Ausr_lib = '/usr/lib'%0Asite_packages_dir = os.path.join(venv, 'lib', 'python'+site_version, 'site-packages')%0Adist_packages_dir = os.path.join(usr_lib, 'python'+dist_version, 'dist-packages')%0A%0Apyqt4 = 'PyQt4'%0Apyqt4_site = os.path.join(site_packages_dir, pyqt4)%0Asip_site = os.path.join(site_packages_dir, sip)%0Apyqt4_dist = os.path.join(dist_packages_dir, pyqt4)%0Asip_dist = os.path.join(dist_packages_dir, sip)%0A%0Aargs = %5B%5Bpyqt4_dist, pyqt4_site%5D, %5Bsip_dist, sip_site%5D%5D%0Afor arg in args:%0A    try:%0A        os.symlink(*arg)%0A    except FileExistsError:%0A        continue%0A

Add Python code for making symlinks for PyQt4 and SIP into a virtualenv