Created by: ucabvas
Installing this package in a new virtualenv fails because setup.py tries to import pyod which in turn tries to import all its dependencies (numpy is in the error message in particular). However, it's setup.py's responsibility to install numpy and it gets imported before it's installed.
Fixing this by decoupling the version string from the pyod init file. For reference, this is the error we were seeing prior to the fix:
(env_pyod) ☁ ~VIRTUAL_ENV pip install pyod
Collecting pyod
Downloading https://files.pythonhosted.org/packages/08/bf/05bef83df97f81a6492818e0a42034e1bcc222894fd66bd4ce66c23a8654/pyod-0.5.4.tar.gz (44kB)
100% |████████████████████████████████| 51kB 2.3MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/v3/d3h954156117rd5xdlfh8c0d081dvn/T/pip-install-G3JNoB/pyod/setup.py", line 2, in <module>
from pyod import __version__
File "pyod/__init__.py", line 4, in <module>
from . import models
File "pyod/models/__init__.py", line 2, in <module>
from .abod import ABOD
File "pyod/models/abod.py", line 12, in <module>
import numpy as np
ImportError: No module named numpy
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/v3/d3h954156117rd5xdlfh8c0d081dvn/T/pip-install-G3JNoB/pyod/