mark2devel / mark2

Minecraft Multi Server Wrapper Written in Python with Twisted; Pull Requests HIGHLY Encouraged, Collaborators Needed Discord: https://discord.gg/zymJygHNpv
Other
207 stars 44 forks source link

Twisted Issue Completely Breaks Mark2 #119

Closed mattboy9921 closed 3 years ago

mattboy9921 commented 4 years ago

Installing Mark2 on Ubuntu 18.04.4 following the instructions on the INSTALL.md here, I get the following error:

Traceback (most recent call last):
  File "./mark2", line 3, in <module>
    from mk2.launcher import main
  File "/home/matt/mark2/mk2/launcher.py", line 14, in <module>
    from . import manager
  File "/home/matt/mark2/mk2/manager.py", line 5, in <module>
    from twisted.internet import reactor
ImportError: No module named twisted.internet

No commands work. Any advice?

mattboy9921 commented 4 years ago

I've found what appears to be an actual solution to this. I'm not sure if this is correct but it is working for me. The version of Python installed via the INSTALL.md is Python 2. The version of Pip installed indicates it is for Python 3. So when I install python modules, Python 2 doesn't see them because they're in a Python 3 directory.

So what I've done is uninstalled python3-pip, then ran sudo apt autoremove to get rid of anything else unneeded from it. Then I ran curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py followed by sudo python get-pip.py. This installs a version of Pip that is Python 2 compatible. Then, I can enter the mark2 directory and run sudo pip install -r requirements.txt which will get the necessary python modules.

After that, it works as it should. I tested this on a fresh installation of Ubuntu Server 18.04.4 with no other software installed aside from Java.

Column01 commented 3 years ago

I know this is an old issue, but I discovered the issue myself as well and have since submitted a pull request to remedy it. I also see you commented with the same instructions I'm about to give but I digress.

Back in April last year, a pull request was made to update mark2's install documentation, this PR changed the install commands to use python3-pip and pip3, which of course will not work with python 2 (which mark2 requires). The above solution does work to fix it, but the underlying cause should be addressed. I just tested the small change of just using python-pip and not installing python3-pip, and it installs with no issues.

So if anyone has this issue installing on debian/ubuntu and doesn't have the fixed documentation yet, do the following:

sudo apt-get install git libssl-dev python-dev python-pip
sudo pip install -r requirements.txt

and then just follow the rest of the guide to install it normally.

mattboy9921 commented 3 years ago

Since it's been a while, I don't recall exactly what my reasoning for using curl to get pip. Perhaps things have changed or I overlooked the simpler solution. I can report at least that since my last post, the solution I posed is still working on that same instance (and a few others) and has persisted many apt updates.

I have no clue if mark2 will ever see consistent development again, nor do I think I am capable enough to modify it myself. Regardless, it still works for my needs as a basic wrapper. Thank you for your work @Column01, I hope your PR gets merged!

Column01 commented 3 years ago

PR was merged thankfully. As for development/porting to newer python, I've thought about it a few times but I have no real incentive to do it. Others have attempted it and I assume they failed for a reason that I don't want to discover :P

Column01 commented 3 years ago

(Can probably close this now? Shouldn't be an issue anymore)