pyod: pyod fails to install using pip
When attempting to install without nose, I receive the following error:
(PyVi) Michael:PyVi michael$ pip install pyod
Collecting pyod==0.5.0 (from -r requirements.txt (line 18))
Using cached https://files.pythonhosted.org/packages/c9/8c/6774fa2e7ae6fe9c2c648114d15ba584f950002377480e14183a0999af30/pyod-0.5.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/j4/_68f6f3j4d51_2smq2mh5hyh0000gn/T/pip-install-gjdzzane/pyod/setup.py", line 2, in <module>
from pyod import __version__
File "/private/var/folders/j4/_68f6f3j4d51_2smq2mh5hyh0000gn/T/pip-install-gjdzzane/pyod/pyod/__init__.py", line 4, in <module>
from . import models
File "/private/var/folders/j4/_68f6f3j4d51_2smq2mh5hyh0000gn/T/pip-install-gjdzzane/pyod/pyod/models/__init__.py", line 2, in <module>
from .abod import ABOD
File "/private/var/folders/j4/_68f6f3j4d51_2smq2mh5hyh0000gn/T/pip-install-gjdzzane/pyod/pyod/models/abod.py", line 17, in <module>
from .base import BaseDetector
File "/private/var/folders/j4/_68f6f3j4d51_2smq2mh5hyh0000gn/T/pip-install-gjdzzane/pyod/pyod/models/base.py", line 27, in <module>
from ..utils.utility import precision_n_scores
File "/private/var/folders/j4/_68f6f3j4d51_2smq2mh5hyh0000gn/T/pip-install-gjdzzane/pyod/pyod/utils/__init__.py", line 2, in <module>
from .utility import check_parameter
File "/private/var/folders/j4/_68f6f3j4d51_2smq2mh5hyh0000gn/T/pip-install-gjdzzane/pyod/pyod/utils/utility.py", line 18, in <module>
from sklearn.utils.testing import assert_equal
File "/Users/michael/anaconda3/envs/PyVi/lib/python3.6/site-packages/sklearn/utils/testing.py", line 49, in <module>
from nose.tools import raises
ModuleNotFoundError: No module named 'nose'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/j4/_68f6f3j4d51_2smq2mh5hyh0000gn/T/pip-install-gjdzzane/pyod/
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 18 (7 by maintainers)
Commits related to this issue
- Merge pull request #6 from tam17aki/tam17aki-patch-6 add test script for sampling method. — committed to yzhao062/pyod by tam17aki 2 years ago
@LLh-lihan, @Lotus-Lian: What is the name of your python file? If it is ‘pyod.py’, rename it. In this case you are importing your own script.
Make sure that python file name is not
pyod.py
. if package name and file name are same, will face this kind of error.The issue you saw is specific to the virtual env Qt problem on mac, which is caused by matplotlib, and it is a lingering issue. The problem can be reproduced by:
import matplotlib.pyplot as plt
It throws error if you install the matplotlib with pip command in a mac conda virtual env… There are several fixes though.Using workaround 1, I managed to install pyod in mac virtual env and also succeeded in running examples. See the screenshot below:
To facilitate the installation, I also removed the use of matplotlib in the code (I do not remove it from dependency since example codes still need it) and publish a new version 0.5.2. You may want to give it a shot…
Let me know if the problem persists.