pyReScene installation

This page describes how to start using pyReScene from source on Windows.

Install Python 2.7

Download

Versions 0.1 - 0.5 need Python 2.7 to run. Later versions also support Python 3. We suggest using ActiveState Python.

ActivePython is the leading commercial-grade distribution of the open source Python scripting language. Download ActivePython Community Edition free binaries for your development projects and internal deployments.

Download the latest 2.7 version from http://www.activestate.com/activepython/downloads. You can choose between x86 and 64-bit, x64. For just using pyReScene, this should not make a difference. You may skip the quick survey.

NOTE: NumPy isn't a dependency anymore.
If you want to install NumPy later on, use the 32 bit version.

There could be a small chance you see this error:

Product: ActiveState ActivePython 2.7.5.6 (32-bit) — Error 1935. An error occurred during the installation of assembly 'Microsoft.VC90.MFC,version="9.0.30729.1",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="x86",type="win32"'. Please refer to Help and Support for more information. HRESULT: 0x80070BC9. assembly interface: IAssemblyCacheItem, function: Commit, component: {CB438DD9-2B1B-32E0-9AA6-D6DA82CE9D97}

If this is the case, try using the regular Python distribution from http://www.python.org/getit/.

You might want to use other Python distributions too. e.g. those with NumPy already included: Which Python to use on Windows for Numpy and friends?

Install

  • Run the .msi file. ActivePython-2.7.5.6-win64-x64.msi in my case.
  • Next
  • Accept the terms in the Licence Agreement, Next
  • Keep all suggested options. You may skip the 12MB documentation though. Keep C:\Python27\ as destination.
  • Install
  • Click Yes when the User Account Control pops up.
  • Finish. You may disable Open User Guide.

Test

After installation, typing python in the cmd window will show the following:

C:\Users\Me>python
ActivePython 2.7.8.10 (ActiveState Software Inc.) based on
Python 2.7.8 (default, Jul  2 2014, 19:50:44) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Type exit() to quit.

If this doesn't work, start up a terminal or try rebooting. Otherwise you'll have to add C:\Python27 to your path manually.

Download pyReScene

Choose one of the following three download methods. If you've been asked to use the latest code, use the second or third option.

Download released sources

This file is only 196.0 KB for version 0.5.1.

Download latest sources from web

This file will contain everything from the repository. This is more than 18 MB at the time of writing. This may contain untested stuff!

bitbucket_pyrescene_download.png
  • Extract the containing folder to C:\ or an other destination to your liking.

Download latest sources from the repository and keep up to date

tortoisehg_clone_rightclickmenu.png tortoisehg_clone.png
  • Wait until it finishes.

Result

If you did all the above steps (one is enough) on the C:-drive of a clean install, it would look like this:

Gfy-pyrescene-22dbaa07d661     <- Web download latest version repository
PerfLogs
Program Files
Program Files (x86)
pyrescene                      <- Hg (Mercurial) clone
pyReScene-0.5.1                <- Offered sources in downloads
Python27
Users
Windows

Test pyReScene a first time

This step is optional. Start a console. (Win+R and enter cmd or find it in the Start menu)
Typing c:\pyReScene-0.5.1\bin\pyrescene.py --help will show the help if Python is correctly installed.
first_test.png
If you have multiple Python versions installed, try C:\Python27\python.exe C:\pyReScene-0.5.1\bin\pyrescene.py.

Configure pyReScene

Create shortcuts

You don't want to specify the full path each time you use pyrescene, srr, or srs.
Place the .bat files from the pyrescene/bin/windows directory in a folder from the PATH.
In my case that would be in one of the following folders:

C:\Python27\;C:\Python27\Scripts;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseHg

Better yet, add pyrescene/bin/windows to the PATH! This can be done by running pyrescene/bin/windows/add_to_path.bat, but it'll overwrite your current User PATH variable.

windows_path.png

I will create a bin folder in the hidden directory C:\Users\MyReallyLongUsername\AppData and add this to my user PATH variable by appending ;C:\Users\MyReallyLongUsername\AppData\bin. This is just a preference.

After copying the .bat files, edit them to point to the right locations:

python.exe srr %*

will become

C:\Python27\python.exe C:\pyrescene\bin\srr %*

If you always use the -c parameter on pyrescene for example, you can add it to these .bat scripts before the %* so it will always be used.
Add a third file for pyReScene Auto: C:\Python27\python.exe C:\pyrescene\bin\pyrescene.py %*.

After these steps, you can see the following files:

pyrescene.bat
pysrr.bat
pysrs.bat

Test shortcuts

If everything went well, you can now just type pyrescene, pysrr and pysrs in your terminal. You might need to restart it.

Install Chromaprint

Install NumPy

NOPE! The NumPy dependency has been removed by Martin Panter!
https://bitbucket.org/Gfy/pyrescene/commits/314ffdb32ff154da0eeafe8cae2b12470f08785f

You can see the following note:

NOTE: install NumPy to speed up the reconstruction of RARs
      with a Recovery Record.

Install NumPy as follows:

c:\>c:\Python27\Scripts\pypm.exe install numpy
Get: [pypm-be.activestate.com] :repository-index:
Get: [pypm-free.activestate.com] :repository-index:
autosync: synced 2 repositories
Expanding "%APPDATA%\Python\Scripts" in user's %PATH%; please launch a new Command Window
The following packages will be installed into "%APPDATA%\Python" (2.7):
 as.mklruntime-1.3 numpy-1.7.1
error: Can't install as.mklruntime-1.3: requires Business Edition subscription

Nope, that's why you should use the 32 bit ActivePython version!

c:\Python27\Scripts\pip.exe install numpy

Didn't work immediately either, so I tried numpy-MKL-1.8.0.win-amd64-py2.7.exe from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and that works.

Install UnRAR

This step is not necessary if you have WinRAR. UnRAR will be used for creating SRRs of vobsubs.

  • Download UnRAR for Windows
  • Keep the default C:\Program Files (x86)\Unrar folder
  • Click Yes when the User Account Control pops up.
  • No idea what should be done here. Pick one. I choose the top one and I get this when entering unrar:
'unrar' is not recognized as an internal or external command,
operable program or batch file.

unrar_install_error.png

Setting up development environment

  • Choose the default workspace: C:\Users\MyReallyLongUsername\workspace
  • File -> New -> Project… -> PyDev -> PyDev Project
  • Choose a Project name. e.g. pyReScene
  • Project contents: C:\pyrescene
  • Grammar Version: 2.6
  • Configure an interpreter: Quick Auto-Config. Wait.
  • Finish. Yes to opening PyDev perspective.
  • Right click pyReScene in PyDev Package Explorer -> Team -> Share Project… -> Mercurial -> Next -> Finish

Building files to distribute

The first command will generate a ZIP with the source code. The second command will create executables.

python setup.py sdist
python setup.py py2exe

Py2exe needs to be installed for that last option. e.g. py2exe-0.6.9.win32-py2.7.exe from http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/ or use the ActiveState PyPM package manager if you are using 32 bit Python.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License