kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

python pip and manual module install error out

henryrgithub opened this issue ยท 7 comments

commented

Using VSCode, Python 3.10.1, windows.

PS D:\ksp\autopilot\ksp_autopilot\krpc-1.0> python -m pip install krpc Collecting krpc Using cached krpc-0.4.8.zip (64 kB) ERROR: Command errored out with exit status 1: command: 'C:\Users\yakol\AppData\Local\Programs\Python\Python310\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\yakol\\AppData\\Local\\Temp\\pip-install-53lcaui5\\krpc_1d54a2c58f4947009d7e75d53bcd4823\\setup.py'"'"'; __file__='"'"'C:\\Users\\yakol\\AppData\\Local\\Temp\\pip-install-53lcaui5\\krpc_1d54a2c58f4947009d7e75d53bcd4823\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\yakol\AppData\Local\Temp\pip-pip-egg-info-tyt6is_o' cwd: C:\Users\yakol\AppData\Local\Temp\pip-install-53lcaui5\krpc_1d54a2c58f4947009d7e75d53bcd4823\ Complete output (1 lines): error in krpc setup command: use_2to3 is invalid. ----------------------------------------

Apparently SetupTools dropped support for use_2to3 in version 58.0.0 on Sept 4 2021. I'm pretty unfamiliar with the Python toolchain, but I'll start digging around in the next couple of days if nobody else knows of something quick and easy.

I assume this won't be super easy as KRPC documentation says pretty early on that it supports both version 2 and 3 of Python. The SetupTools' suggestion of specifying an older version of setuptools using PEP518 seems to be a good starting point though.

commented

i guess it wont work even if u managed to install it. since no one update this repo for years. abandoned

commented

@djungelorm I see you're the author for the five .py files that contain use_2to3. I also see in a few of these that you check for certain dependencies if python is below certain versions.

Would it be better to do the suggested PEP518 thing (I have no idea where to start, but I can sure try to figure it out) or to simply require a min python build?

commented

I was able to manually install the package by renaming all doubles (I think that was the type, not sure, but it was UINT64s and SINT64s) to int. I assume the int type is now 64b by default now, hopefully it won't break anything.

I still think it would be great to update something in the build path to either force use of old versions of SetupTools (and possibly more?) and thus probably risk forward compatibility, or drop support for python2 and update types.

commented

@henryrgithub thank you for hunting down this bug. I ran into it as well but worked around it by using a conda environment with setuptools pinned to 57.5.0 just before the use_2to3 breaking change.

commented

@Ajam1997 the solution I mentioned in December got it working. I miiiiiight find time this weekend to fork it and make a merge request with the fix. People really hate dropping Python 2 support, though, so it would likely stay a fork, and honestly a krpc fork is not something I'm interested in maintaining.

commented

Any solution to installing the python package?

commented

Thanks for looking back on this! I still love KRPC and am happy to see it updated to what should be at least close to the final version of OG KSP!