Open Ceasy opened 2 years ago
Hello!
Could you attach the script you are trying to translate? Without that I'm looking a bit in the dark as to what would cause this error.
Thanks,
This is a module from the "pythontolua" library. Its name is "nodevisitor.py ". I followed your guide step by step and when I type "python PyWC3 map.w3x --build" I get this error. I downloaded the "pythontolua" library from the link: "https://github.com/Blimba/python-lua "
I meant the mapscript. Or is the mapscript also the standard one? I'll check it out asap.
Yes, mapscript is standart
Thanks. I'm waiting. And I really want to make maps in python =( I'm glad that I found your way, and I hope you can help me.
I just cloned a new PyWC3 with the current versions, and I can't reproduce your issue. Can you send me a zip of your folder? Also, which version of python are you using?
1) I open this project in Pycharm. 2) I go along the path: "E:\Files\WarcraftIII\Jetbrains\projects". 3) Next, I run the command: "python PyWC3 test.w3x --build". While executing the command, I get an error (which I wrote about above): ...... " File "E:\Files\WarcraftIII\Jetbrains\projects\PyWC3\pythonlua\nodevisitor.py", line 621, in visit_Subscript node.slice.value, ast.Tuple): AttributeError: 'Name' object has no attribute 'value'
your file builds without any problems on my system (py3.7, [yea I should update]), both from within pycharm, or commandline. Can you use pythonlua directly without PyWC3? for example, if you run "runtests.py"?
Do you have the requirements of python-lua installed?
i just copied the pythonlua folder to the pywc3 folder. I didn't install any dependencies. Can you please tell me how to install dependencies? Maybe that's why I'm having problems. When I run the command "python runtests.py" it says: "C:\Users\User\AppData\Local\Programs\Python\Python39\python.exe: can't open file 'E:\Files\WarcraftIII\Jetbrains\pr ojects\runtests.py': [Errno 2] No such file or directory"
just open runtests.py (in the python-lua directory) in pycharm and run it. according to the requirements.txt file, you need: colorama>=0.3.7 PyYAML>=3.12 so you can install those using pip: python -m pip install colorama python -m pip install pyyaml I suppose.. but they should come with anaconda. Did you install python with anaconda?
Now I deleted the whole project and installed everything again, including the installation of "Anaconda". After all the instructions, I ran the command "python PyWC3 test.w3x --build" ---> got an error:
" File "E:\Files\WarcraftIII\Jetbrains\projects\PyWC3\PyWC3\map.py", line 5, in
In general, I managed to fix the error: I removed the 'value' value in the "nodevisitor.py" module, line 615, which caused the error. Now at startup, everything is fine assembled and launched. Thank you very much for your help and for taking the time to solve my problem =)
Perhaps there is a difference in how python 3.9 looks at stuff compared to python 3.7.. hmm. I'll look into if the line should be changed to not have the .value. Thanks for getting back after (hopefully) fixing it. Let me know how you get along with pywc3 :)
Cheers
Of course! I'm going to gain experience in the building, thanks again to you =)
In general, I managed to fix the error: I removed the 'value' value in the "nodevisitor.py" module, line 615, which caused the error. Now at startup, everything is fine assembled and launched. Thank you very much for your help and for taking the time to solve my problem =)
Thanks, I got the same problen on python 3.10, And I fixed it followed your steps!
Perhaps there is a difference in how python 3.9 looks at stuff compared to python 3.7.. hmm. I'll look into if the line should be changed to not have the .value. Thanks for getting back after (hopefully) fixing it. Let me know how you get along with pywc3 :)
Cheers
Cheers!
Hello! Please tell me, when building the map "python PyWC3 map.w3x --build" gives an error:
File "E:\Files\WarcraftIII\Jetbrains\projects\PyWC3\pythonlua\nodevisitor.py", line 615, in visit_Subscript
if not isinstance(node.slice,ast.Slice) and not isinstance(node.slice,ast.ExtSlice) and isinstance(node.slice.va lue,ast.Tuple): AttributeError: 'Name' object has no attribute 'value'
What do I need to do?