Skip to content

Unable to compile gco #22

Open
Open

Description

@GeorgeCodeHub

Hello there,

I'm trying to use pygco and I'm stuck in trying to compile it. I tried compiling in both Windows and Ubuntu but with no luck.
Is there a guide on how I should compile the whole folder or which files to compile? I tried starting from GCOptimization but I got too many errors.

Note: I'm using it for a python project where I try to colorize an image by using the graph cut method. My gcc version is 5.4.0

I also tried using pip and it installed pygco=0.0.1 but when I try to import it, it doesn't recognize it.

It gives: No module named 'pygco'

I import it like so:
import pygco

Activity

  1. amueller commented on Oct 2, 2020

    @amueller
    Owner

    I think using pip will be the easiest method. Make sure that you're using the pip that belongs to the environment you're executing in.
    If pip throws any errors, please post them here.
    Also, this code should probably be considered unmaintained, I haven't worked on or with this for several years.

  2. leronjulian commented on Dec 9, 2020

    @leronjulian

    I'm getting the same issue as above after installing it using pip.

    It gives: No module named 'pygco'

    I import it like so:
    import pygco

  3. amueller commented on Dec 9, 2020

    @amueller
    Owner

    are you sure that the executing environment is the same as the environment that pip installed into?
    Are you executing a script? If so, try which python and which pip. You can also do python -m pip install pygco

  4. leronjulian commented on Dec 9, 2020

    @leronjulian

    Yes they are. I am trying to execute example.py. When I try which python and which pip I get:

    /Users/Shared/miniconda3/envs/myenv/bin/python and
    /Users/Shared/miniconda3/envs/myenv/bin/pip

  5. amueller commented on Dec 10, 2020

    @amueller
    Owner

    hm that looks ok. what's the output of pip install pygco?

  6. leronjulian commented on Dec 10, 2020

    @leronjulian

    Requirement already satisfied: pygco in /Users/Shared/miniconda3/envs/myenv/lib/python3.7/site-packages (0.0.1)
    Requirement already satisfied: numpy in /Users/Shared/miniconda3/envs/myenv/lib/python3.7/site-packages (from pygco) (1.16.6)
    Requirement already satisfied: cython in /Users/Shared/miniconda3/envs/myenv/lib/python3.7/site-packages (from pygco) (0.29.21)

  7. amueller commented on Dec 10, 2020

    @amueller
    Owner

    and pygco exists in /Users/Shared/miniconda3/envs/myenv/lib/python3.7/site-packages?

  8. leronjulian commented on Dec 10, 2020

    @leronjulian

    Screen Shot 2020-12-10 at 5 49 50 PM

    Yes it does

  9. amueller commented on Dec 10, 2020

    @amueller
    Owner

    There should be a folder that's just called pygco in addition to the dist-info folder. Remove the dist-info folder and do the pip install again. It looks like you did some partial install or uninstall at some point.

  10. leronjulian commented on Dec 10, 2020

    @leronjulian

    I did that, now I'm trying to reinstall it using pip and I'm getting the error
    gco_python.cpp:626:10: fatal error: 'ios' file not found #include "ios"

  11. amueller commented on Dec 10, 2020

    @amueller
    Owner

    make sure you have the standard libraries for C++ installed. As a warning the GCO code has been unmaintained for many years so you're mostly on your own there.

  12. leronjulian commented on Dec 11, 2020

    @leronjulian

    I got it working. Thanks!

  13. hfpro commented on Nov 6, 2021

    @hfpro

    please share how you managed to install this library

  14. rfmac-perceptus commented on Jan 18, 2023

    @rfmac-perceptus

    I just got a simple fix and I'm going to let it here for the next people with the same problem.

    First explaining, I was with exactly the same problem than in this issue, that is, I installed pygco with:

    $ pip install pygco

    But when running a script the result was:

    No module named 'pygco'
    

    Then running pip install pygco again I got into the site-packages folder and could find the pygco-0.0.1.dist-info sub-folder.

    Then to solve I simply ran:

    $ pip install -U pygco

    Which upgraded pygco version from 0.0.1 to 0.0.16 and the problem was solved.

    Hope that it helps someone! 😊

  15. genuineotkau commented on Dec 13, 2024

    @genuineotkau

    I just got a simple fix and I'm going to let it here for the next people with the same problem.

    First explaining, I was with exactly the same problem than in this issue, that is, I installed pygco with:

    $ pip install pygco

    But when running a script the result was:

    No module named 'pygco'
    

    Then running pip install pygco again I got into the site-packages folder and could find the pygco-0.0.1.dist-info sub-folder.

    Then to solve I simply ran:

    $ pip install -U pygco

    Which upgraded pygco version from 0.0.1 to 0.0.16 and the problem was solved.

    Hope that it helps someone! 😊

    It worked! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions