Saturday, October 27, 2012

setuptools (easy_install) on Synology DiskStation

DS 212+
DSM 2647
Python package 2.7.2-006, from Synology

using tar.gz or egg

== tar.gz

  1. Download tar.gz file of setuptools from http://pypi.python.org/pypi/setuptools. The version when I test is "setuptools-0.6c11.tar.gz".
  2. Extract tar.gz file. In command line, you can type "tar xvf setuptools-0.6c11.tar.gz"
  3. In the setuptools folder, type "python setup.py install"
  4. Create symbolic link for easy_install "ln -s /var/packages/Python/target/usr/bin/easy_install /usr/bin/"


== egg

  1. Download setuptools egg file from http://pypi.python.org/pypi/setuptools, choose py2.7 version. The version when I test is "setuptools-0.6c11-py2.7.egg".
  2. Here comes tricky part. Due to setuptools egg use python2.7 to exec the following action, but Synology Python package only creates symbolic link in /usr/bin/python. So run "sh setuptools-0.6c11-py2.7.egg" will get 「setuptools-0.6c11-py2.7.egg: exec: line 8: python2.7: not found」. So we need to modify the egg file. Type "vi setuptools-0.6c11-py2.7.egg" and change the python2.7 to python.
  3. Run "sh setuptools-0.6c11-py2.7.egg". 
  4. Create symbolic link for easy_install "ln -s /var/packages/Python/target/usr/bin/easy_install /usr/bin/"
Now we can use easy_install to install other Python package.

No comments:

Post a Comment