Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P pyod
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Yue Zhao
  • pyod
  • Merge requests
  • !12

Fix circular dependency in setup.py

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/ucabvas/vv/fix-circualr-dependency-version into master Jul 09, 2018
  • Overview 4
  • Commits 2
  • Pipelines 0
  • Changes 5

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/
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/ucabvas/vv/fix-circualr-dependency-version