Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Diretório com caracteres especiais #76

Open
ViniNathan opened this issue Jul 1, 2023 · 6 comments
Open

[BUG] - Diretório com caracteres especiais #76

ViniNathan opened this issue Jul 1, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@ViniNathan
Copy link

*Descrição do bug
Após instalar todas as bibliotecas necessárias e o poetry, assim como solicitado pelos devs, ao realizar o comando 'poetry run python main.py' recebo o seguinte erro:

[ WARN:0@32.218] global loadsave.cpp:244 cv::findDecoder imread_('C:\Users\Usuário\Documents\PyTibia\src\repositories\radar/images/floor-0.png'): can't open/read file: check file path/integrity
Traceback (most recent call last):
File "C:\Users\Usuário\Documents\PyTibia\main.py", line 2, in
from src.gameplay.threads.pyTibia import PyTibiaThread
File "C:\Users\Usuário\Documents\PyTibia\src\gameplay\threads\pyTibia.py", line 3, in
from src.gameplay.cavebot import resolveCavebotTasks, shouldAskForCavebotTasks
File "C:\Users\Usuário\Documents\PyTibia\src\gameplay\cavebot.py", line 2, in
from src.repositories.gameWindow.creatures import hasTargetToCreature
File "C:\Users\Usuário\Documents\PyTibia\src\repositories\gameWindow\creatures.py", line 8, in
from src.repositories.radar.config import walkableFloorsSqms
File "C:\Users\Usuário\Documents\PyTibia\src\repositories\radar\config.py", line 19, in
loadFromRGBToGray(
File "C:\Users\Usuário\Documents\PyTibia\src\utils\image.py", line 62, in loadFromRGBToGray
return np.array(RGBtoGray(load(path)), dtype=np.uint8)
File "C:\Users\Usuário\Documents\PyTibia\src\utils\image.py", line 78, in load
return np.array(cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB), dtype=np.uint8)
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

Desktop (please complete the following information):

  • OS: [Windows 10]
  • Tibia Version [Global]
@ViniNathan ViniNathan added the bug Something isn't working label Jul 1, 2023
@lucasmonstrox
Copy link
Owner

lucasmonstrox commented Jul 10, 2023

O erro está relacionado com caracteres especiais no file path, certo?

@lucasmonstrox lucasmonstrox changed the title [BUG] - [BUG] - Diretório com caracteres especiais Jul 10, 2023
@felipetnh
Copy link

Tenta mover o projeto pra C:/PyTibia.
O erro mostra a pasta "Usuário" como "Usu├írio".

@lucasmonstrox
Copy link
Owner

@ViniNathan e @felipetnh alguma sugestão?

@felipetnh
Copy link

Creio que só mover pra um lugar que o PATH não contenha caracteres especiais já vai resolver.
O Python é notório em não saber lidar com caracteres especiais corretamente.

@lucasmonstrox
Copy link
Owner

Creio que só mover pra um lugar que o PATH não contenha caracteres especiais já vai resolver. O Python é notório em não saber lidar com caracteres especiais corretamente.

Poderia rolar um escape, etc. Tenho de ver algo cross compatível em todos OS.

@felipetnh
Copy link

Dá pra tentar, mas nunca tive muito sucesso com isso.
Tinha projetos que alguns colegas tinham que trocar de pasta porque o usuário deles tinha caracteres especiais, e ninguém nunca conseguiu resolver corretamente.
Mas talvez seja possível algum escape ou algo do tipo. Outra coisa a se testar seria pastas com espaço no nome, por exemplo: "C:/Py Tibia/", ao invés de "C:/PyTibia". Lembro que o espaço também causava problemas pro Python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants