makehumancommunity / makehuman

This is the main repository for the MakeHuman application as such.
http://www.makehumancommunity.org
Other
1.18k stars 244 forks source link

download_assets_git.py Traceback #182

Closed rwbaer closed 2 years ago

rwbaer commented 2 years ago

MakeHuman source 1.2.1 alpha (master:b80494ad) on Windows 11

I'm sure this is just me being uninformed, but when I tried to download assets with download_assets_git.py I got a traceback that I don't understand. Any help?

D:\ProgramData\Anaconda3\envs\MakeHuman\python.exe C:/Users/rbaer/PycharmProjects/makehuman/makehuman/download_assets_git.py Traceback (most recent call last): File "C:\Users\rbaer\PycharmProjects\makehuman\makehuman\download_assets_git.py", line 180, in DownloadAssetsGit() File "C:\Users\rbaer\PycharmProjects\makehuman\makehuman\download_assets_git.py", line 91, in init if not os.path.isfile(self._git_command): File "D:\ProgramData\Anaconda3\envs\MakeHuman\lib\genericpath.py", line 30, in isfile st = os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Process finished with exit code 1

rwbaer commented 2 years ago

If it helps, I tried running this in Pycharm with debug mode and got:

exception = {tuple: 3} (<class 'TypeError'>, TypeError('stat: path should be string, bytes, os.PathLike or integer, not NoneType'), <traceback object at 0x000001B141ECC140>) 0 = {type} <class 'TypeError'> 1 = {TypeError} stat: path should be string, bytes, os.PathLike or integer, not NoneType 2 = {traceback} <traceback object at 0x000001B141ECC140> len = {int} 3 path = {NoneType} None

Aranuvir commented 2 years ago

Hi Rob, slightly weird error message, there is no file genericpath.py in my lib folder. Is this a result of packing MH and Python for Windows? Can you make sure installing the app went correctly? And can you check git is installed and can be found? I suppose this to be the root of your problem.

joepal1976 commented 2 years ago

Stupid question, but is "git" or "git.exe" in your PATH variable?

If "self._git_command" is None, then I can see how this problem might arise.

For reference, "genericpath" is the cpython implementation of os.path, see https://github.com/python/cpython/blob/main/Lib/genericpath.py

rwbaer commented 2 years ago

Okay. I just tried on a new computer. I downloaded from source and ran it but it failed. The machine did not have release makehuman installed. I then installed the release version of makehuman and tried running download_assets_git again and now it works fine? Haven't checked the code yet but could the failure have occurred because the path didn't exist???

Aranuvir commented 2 years ago

Haven't checked the code yet but could the failure have occurred because the path didn't exist???

(Most likely) Yes.

To a certain extent we should consider this a bug...

rwbaer commented 2 years ago

This problem was repeatable on another new Windows 10 computer. It turns out Joel was probably right that it was not that the directory didn't exist, but that it was I hadn't installed git. This time I checked and the directory was there. Still wouldn't run. Checked whether I had installed scm-git. Didn't respond at the command prompt (lesson - I was using the git menu in pycharm to fetch from the repository; guess it has its own git :-( Anyway, I installed git and now its working. I've got to say the error message didn't convey that to a rookie like me. Is it worth adding a check? On the other hand, I guess it is a module for devs who are SUPPOSED to know what they are doing. I'll let you guys decide.

: C:\ProgramData\Anaconda3\envs\MH_3.8\python.exe C:/Users/rbaer/PycharmProjects/makehuman/makehuman/download_assets_git.py Traceback (most recent call last): File "C:/Users/rbaer/PycharmProjects/makehuman/makehuman/download_assets_git.py", line 180, in DownloadAssetsGit() File "C:/Users/rbaer/PycharmProjects/makehuman/makehuman/download_assets_git.py", line 91, in init if not os.path.isfile(self._git_command): File "C:\ProgramData\Anaconda3\envs\MH_3.8\lib\genericpath.py", line 30, in isfile st = os.stat(path) TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Process finished with exit code 1

Aranuvir commented 2 years ago

Guess it's fixed. Got something wrong...