Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

pip install nupic throws error #3897

Open
arb-git opened this issue Apr 24, 2021 · 1 comment
Open

pip install nupic throws error #3897

arb-git opened this issue Apr 24, 2021 · 1 comment

Comments

@arb-git
Copy link

arb-git commented Apr 24, 2021

Hi!

I was trying to get acquainted with nupic library, but it does not work from the very beginning, the "pip install nupic" command.

Running this in a Google Colab notebook (and locally), I get the following error log:
Using cached https://files.pythonhosted.org/packages/86/e8/f31a7c9a3b471f6125abc8addd37c17760e00affb45d6db088394a360086/unittest2-0.5.1.tar.gz
Added unittest2==0.5.1 from https://files.pythonhosted.org/packages/86/e8/f31a7c9a3b471f6125abc8addd37c17760e00affb45d6db088394a360086/unittest2-0.5.1.tar.gz#sha256=aa5de8cdf654d843379c97bd1ee240e86356d3355a97b147a6f3f4d149247a71 (from nupic) to build tracker '/tmp/pip-req-tracker-f2clgsrs'
Running setup.py (path:/tmp/pip-install-1j0aqyyp/unittest2/setup.py) egg_info for package unittest2
Running command python setup.py egg_info
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-1j0aqyyp/unittest2/setup.py", line 12, in
from unittest2 import version as VERSION
File "/tmp/pip-install-1j0aqyyp/unittest2/unittest2/init.py", line 40, in
from unittest2.collector import collector
File "/tmp/pip-install-1j0aqyyp/unittest2/unittest2/collector.py", line 3, in
from unittest2.loader import defaultTestLoader
File "/tmp/pip-install-1j0aqyyp/unittest2/unittest2/loader.py", line 92
except Exception, e:
^
SyntaxError: invalid syntax
Cleaning up...
Removing source in /tmp/pip-install-1j0aqyyp/nupic
Removing source in /tmp/pip-install-1j0aqyyp/asteval
Removing source in /tmp/pip-install-1j0aqyyp/mock
Removing source in /tmp/pip-install-1j0aqyyp/ordereddict
Removing source in /tmp/pip-install-1j0aqyyp/psutil
Removing source in /tmp/pip-install-1j0aqyyp/pytest
Removing source in /tmp/pip-install-1j0aqyyp/pytest-cov
Removing source in /tmp/pip-install-1j0aqyyp/pytest-xdist
Removing source in /tmp/pip-install-1j0aqyyp/python-dateutil
Removing source in /tmp/pip-install-1j0aqyyp/PyYAML
Removing source in /tmp/pip-install-1j0aqyyp/unittest2
Removed unittest2==0.5.1 from https://files.pythonhosted.org/packages/86/e8/f31a7c9a3b471f6125abc8addd37c17760e00affb45d6db088394a360086/unittest2-0.5.1.tar.gz#sha256=aa5de8cdf654d843379c97bd1ee240e86356d3355a97b147a6f3f4d149247a71 (from nupic) from build tracker '/tmp/pip-req-tracker-f2clgsrs'
Removed build tracker '/tmp/pip-req-tracker-f2clgsrs'
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/base_command.py", line 153, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/commands/install.py", line 382, in run
resolver.resolve(requirement_set)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
self._resolve_one(requirement_set, req)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for
req, self.session, self.finder, self.require_hashes
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/operations/prepare.py", line 224, in prepare_linked_requirement
req, self.req_tracker, finder, self.build_isolation,
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/operations/prepare.py", line 49, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/distributions/source/legacy.py", line 39, in prepare_distribution_metadata
self.req.prepare_metadata()
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/req/req_install.py", line 563, in prepare_metadata
self.metadata_directory = metadata_generator(self)
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/operations/generate_metadata.py", line 124, in _generate_metadata_legacy
command_desc='python setup.py egg_info',
File "/usr/local/lib/python3.7/dist-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Is there anything that can be done about it? Honestly, if I can't even install it, what use is it to me. But maybe I am missing something simple. Any help would be much appreciated!

Regards,
A.

@eihli
Copy link

eihli commented Aug 16, 2021

Notice the error message.

File "/tmp/pip-install-1j0aqyyp/unittest2/unittest2/loader.py", line 92
except Exception, e:
^
SyntaxError: invalid syntax

It's pointing out a syntax error on the line that contains except Exception, e:.

Python3 exceptions are of the format except Exception as e:. https://docs.python.org/3/reference/compound_stmts.html#except

Python2 exceptions allow a comma or an "as". https://docs.python.org/2.7/reference/compound_stmts.html#except

You're trying to install it with Python3.7. The repo lists 2.7 as a dependency. https://github.com/numenta/nupic

Dependencies
The following dependencies are required to install NuPIC on all operating systems.
    Python 2.7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants