nuno-faria / tiler

👷 Build images with images
MIT License
5.89k stars 423 forks source link

Starting Tiler Error #34

Closed carterlasalle closed 3 years ago

carterlasalle commented 3 years ago

File "tiler.py", line 1, in import cv2 ImportError: No module named cv2

nuno-faria commented 3 years ago

You have to install opencv2, among other dependencies. You can use pip to acomplish this task: pip install -r requirements.txt

carterlasalle commented 3 years ago

It says requirement satisfied for all three of them

nuno-faria commented 3 years ago

Are you using the same versions? Run pip --version and python --version and check if they are the same. You might need to use pip3/python3.

carterlasalle commented 3 years ago

pip 20.2.4 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

nuno-faria commented 3 years ago

What about the python one?

carterlasalle commented 3 years ago

Python 2.7.16

I have python 3. Why is it using 2.7.16

nuno-faria commented 3 years ago

Are you using pythonor python3to run the commands?

carterlasalle commented 3 years ago

python

nuno-faria commented 3 years ago

Try using python3.

carterlasalle commented 3 years ago

is there a way i can have it default to python 3

nuno-faria commented 3 years ago

What OS are you using? If you are using a Linux-based one you can set an alias.

carterlasalle commented 3 years ago

MacOS

nuno-faria commented 3 years ago

You can try this. Although I would recommend just leaving it as python3, as is common practice.

carterlasalle commented 3 years ago

Last login: Mon Nov 16 12:54:36 on ttys000 xr:~ xr$ cd tiler xr:tiler xr$ pip3 install -r requirements.txt Collecting opencv-python Downloading opencv_python-4.4.0.46-cp39-cp39-macosx_10_13_x86_64.whl (52.4 MB) |████████████████████████████████| 52.4 MB 22 kB/s Collecting numpy Downloading numpy-1.19.4-cp39-cp39-macosx_10_9_x86_64.whl (15.4 MB) |████████████████████████████████| 15.4 MB 1.1 MB/s Collecting tqdm Downloading tqdm-4.52.0-py2.py3-none-any.whl (71 kB) |████████████████████████████████| 71 kB 2.7 MB/s Installing collected packages: numpy, opencv-python, tqdm Successfully installed numpy-1.19.4 opencv-python-4.4.0.46 tqdm-4.52.0 WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available. You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m pip install --upgrade pip' command. xr:tiler xr$ python tiler.py desktop/smexy tiles/tiles/minecraft Traceback (most recent call last): File "tiler.py", line 1, in import cv2 ImportError: No module named cv2 xr:tiler xr$

nuno-faria commented 3 years ago

You need to run the command python3 tiler.py desktop/smexy tiles/tiles/minecraft (replace pythonwith python3).

carterlasalle commented 3 years ago

ah ok thank you so much. it is just stuck at processing boxes

carterlasalle commented 3 years ago

Gettting and processing boxes 0%| | 0/5 [00:00<?, ?it/s]

nuno-faria commented 3 years ago

Depending on the resolution of the image and the size of the tiling regions, it can take a while. Since you are using the minecraft tiles I recommend setting PIXEL_SHIFT = None, in the conf.py file.

carterlasalle commented 3 years ago

what will that do/turn off?

nuno-faria commented 3 years ago

It will set the tiling region to the same size as the tiles. This means that the image will be tiled in a grid way. You can find more in the README. imagem