cnr-isti-vclab / TagLab

A CNN based image segmentation tool oriented to marine data analysis
https://taglab.isti.cnr.it/
GNU General Public License v3.0
84 stars 33 forks source link

No module named 'pycocotools' after UPDATE #58

Closed ihuanh closed 2 years ago

ihuanh commented 2 years ago

After the update, cannot open TagLab again and it shows up:

Traceback (most recent call last): File "taglab.py", line 78, in from source.NewDataset import NewDataset File "C:\Users\user\OneDrive\Documents\TagLab-main\source\NewDataset.py", line 20, in from pycocotools import mask as maskcoco ModuleNotFoundError: No module named 'pycocotools'

Did anyone found this happening also? How can I solve this problem?

ihuanh commented 2 years ago

In the bottom part of indatll TagLab: [Known problems and how to solve them If PyQt not work properly under WIndows (e.g. import problems when TagLab is launched) perhaps the Microsoft Visual C++ Redistributable is not installed on your machine. ]

And I Download and install from here instead (https://visualstudio.microsoft.com/zh-hant/vs/features/cplusplus/) install taglab again and it works for new update.

maxcorsini commented 2 years ago

Hi ihuanh,

yes, indeed. After the last update we need to install Microsoft Visual C++ Build Tools and re-run install.py due to a new component used to export dataset in COCO format (pycocotools).

We will update the installation Wiki with this information.

mlopezp commented 2 years ago

You can also install pycocotools on windows with the following command without having Microsoft Visual Tools installed:

pip install pycocotools-windows

Jordan-Pierce commented 2 years ago

@mlopezp after doing so, did you need to adjust any import statements to reflect the change from pycocotools-windows instead of pycocotools?

In addition, there's also the ability to install pycocotools via Conda, though unless you remove the pip install pycocotools from install.py, it will still attempt to install it via pip.

I followed @mlopezp's suggestion and so far TagLab appears to be working properly. @maxcorsini It might be worth switching to pycocotools-windows to avoid having to install Microsoft Visual Tools and the messiness associated.

maxcorsini commented 2 years ago

Unfortunately, pycocotools-windows it is not available for Python 3.9. But it is a good solution for people using python 3.7 and 3.8.

mlopezp commented 2 years ago

@mlopezp after doing so, did you need to adjust any import statements to reflect the change from pycocotools-windows instead of pycocotools?

In addition, there's also the ability to install pycocotools via Conda, though unless you remove the pip install pycocotools from install.py, it will still attempt to install it via pip.

I followed @mlopezp's suggestion and so far TagLab appears to be working properly. @maxcorsini It might be worth switching to pycocotools-windows to avoid having to install Microsoft Visual Tools and the messiness associated.

@Jordan-Pierce I didn't have to adjust any import statements. I am running Python 3.8.10. I haven't had any issues with the installation so far.