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

Twisted Issue Completely Breaks Mark2 #119

Closed
mattboy9921 opened this issue Apr 30, 2020 · 5 comments
Closed

Twisted Issue Completely Breaks Mark2 #119

mattboy9921 opened this issue Apr 30, 2020 · 5 comments

Comments

@mattboy9921
Copy link

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
Copy link
Author

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
Copy link
Collaborator

Column01 commented May 18, 2021

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
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants