Search code examples
pythonpython-2.7pybrain

What is this message when installing Pybrain


I checked out the latest version of Pybrain from github

Running sudo python setup.py install on my mac gives me:

Extracting PyBrain-0.3.1-py2.7.egg to /Library/Python/2.7/site-packages
  File "/Library/Python/2.7/site-packages/PyBrain-0.3.1-py2.7.egg/build/lib/build/lib/pybrain/optimization/distributionbased/fem.py", line 235
    updateSize = self._computeUpdateSize(self._computeDensities(sample), k)
             ^
SyntaxError: invalid syntax

  File "/Library/Python/2.7/site-packages/PyBrain-0.3.1-py2.7.egg/build/lib/pybrain/optimization/distributionbased/fem.py", line 235
    updateSize = self._computeUpdateSize(self._computeDensities(sample), k)
             ^
SyntaxError: invalid syntax

  File "/Library/Python/2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/optimization/distributionbased/fem.py", line 235
    updateSize = self._computeUpdateSize(self._computeDensities(sample), k)
             ^
SyntaxError: invalid syntax

What is this; should I worry about it?


Solution

  • The problem is in line 233, which is:

    print(len(self.allsamples), min(self.fitnesses), max(self.fitnesses)#, self.alphas)
    

    it comments out the self.alphas part, but it is also commenting out the closing parenthesis of the print function, so the error occurs.

    I'll submit a pull request, meanwhile, you can fix it yourself by fixing the parenthesis.