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

bugjar fails to install on Ubuntu 17.04+ #25

Open
pxc3113 opened this issue Aug 17, 2017 · 12 comments
Open

bugjar fails to install on Ubuntu 17.04+ #25

pxc3113 opened this issue Aug 17, 2017 · 12 comments

Comments

@pxc3113
Copy link

pxc3113 commented Aug 17, 2017

Running on Ubuntu 17.04:
zhiwei@zhiwei-Lenovo-Rescuer-15ISK:~/instaloader$ bugjar instaloader.py
bugjar: command not found

@Xoristzatziki
Copy link

Same problem.
Running on a fresh ubuntu 18.04 installation (in native Greek language) fully updated (in a vbox machine, guest machine with 2 CPUs, 4GB RAM, 128MB for screen)
Only synaptic and python3-pip installed.
Installed with pip3 install bugjar (without sudo).
pip3 freeze shows: bugjar==0.1.0

@Xoristzatziki
Copy link

uninstalled bugjar.
using synaptic installed idle (transition package, installed idle for 3.6)
Installed with sudo pip3 install bugjar
Now runs but throws no module named Tkinter (in line 4)

@freakboy3742
Copy link
Member

Looks like Ubuntu has changed their packaging of Python - again - and once again they've broken tkinter. You'll need to consult Ubuntu's documentation on how to install all of Python, not just the parts that they think are important this month.

When you work out what they've broken, please let us know - or submit a PR updating the instructions for ubuntu.

@freakboy3742 freakboy3742 changed the title bugjar: command not found bugjar fails to install on Ubuntu 17.04+ Dec 11, 2018
@emansije
Copy link

emansije commented Dec 12, 2018

Hmm... I don't think that pointing the finger at Canonical is fair. I took a peek at the pip version of bugjar and it seems to be older than the commit where Python 3 compatibility is introduced.

@freakboy3742
Copy link
Member

@emansije I think it's entirely fair. I haven't met a single version of Ubuntu that didn't screw up the packaging of Python somehow. Removing packages that should be part of the distribution; changing locations; breaking "Python" into multiple parts, and then changing the name (and composition) of those parts between releases; actively frustrating attempts to make virtual environments work... the list goes on.

On Mac, I can say "install Python, and run". On Windows, I can say "install Python, and run". On Ubuntu... it's a crap shoot. And every Ubuntu release is different.

And this isn't a problem of Python's making. It's a problem of Ubuntu's making. The PSF releases a single thing - Python. That's not what Ubuntu provides. They "repackage" Python to meet their exacting standards. And policy consistently make the life of everyone using Python difficult. I will absolutely hold them accountable for the fact that their policies makes my life, as a Python package developer, much harder than it should be.

@Xoristzatziki
Copy link

Xoristzatziki commented Dec 13, 2018

In my installation (with pip3 install bugjar) installs a bugjar without the check for python 3 (aka without a try-import). Is this ubuntu's error? Also distinguish between pip3-pip and python3-python exists at least from ubuntu 16.04.

By the way, @freakboy3742 , is unclear what you mean with: you say "install Python, and run". There is no such thing neither in Mac nor in Windows. At least Windows, with which I am familiar with, do not have such an option.

@emansije
Copy link

@freakboy3742, I get it that you have strong feelings about Ubuntu's Python packaging and I'm sure you have reasons to be so (although I've personally never had such problems as an Ubuntu user), but you totally missed my point. If you re-read my post and the following @Xoristzatziki's post, you'll see that the problem is distribution agnostic. I've tested it in other distributions, including Arch based ones, and the error is exactly the same.

@freakboy3742
Copy link
Member

@emansije @Xoristzatziki So - here's my problem.

tkinter is part of the Python standard library. That means the documented behavior of Python is that if you install Python 3, and install nothing else, the following code should display a GUI window with a single text label in it:

from tkinter import *
root = Tk()
w = Label(root, text="hello")
w.pack()
root.mainloop()

If you have a Mac, and you go to python.org, download a Python3 installer, run the installer, start the Python interpreter, and run that code, it works.

If you have a Windows machine, and you go to python.org, download a Python3 installer, run the installer, start the Python interpreter, and run that code, it works.

If your experience is anything other than "it works" - then your operating system has not packaged Python correctly. Your operating system does not comply with the documented interface that Python provides.

Your operating system may have legitimate reasons for doing this. That's a decision for that operating system. But it's also up to the operating system vendor to document those requirement, and communicate them effectively to their users. And Linux distros have, in my experience, a hideously bad track record on this front.

@Xoristzatziki's original report said the error was "No module named tkinter". If that is the error you're seeing, that means Ubuntu's Python install is incomplete or incorrect. If you're seeing the same error on Arch, then Arch's install is also incomplete or incorrect. The problem isn't the code in Bugjar. The code in bugjar is complete and correct, and is 100% legal Python. If the code doesn't run, It's a bug in your operating system.

That said - I'm more than happy to add/alter the instructions to include the list of required packages for any given distribution. I'm even willing to add helper error messages to make the user experience nicer for people on platforms that are affected (for example giving platform-specific hints on system packages they may need to install). However, I don't use Linux on a regular basis, so I need the help of people who are invested in tracking the various Linux ecosystems to fill in these gaps.

But most of all - I need users of these platforms to be aware of what the vendors of their operating systems are doing to the tools that they package. The problematic packaging of tkinter is not an isolated example. ensurepip doesn't work. pystone isn't included in the standard library. django-admin.py is renamed to django-admin. There are countless other examples I could give. I can tell you what the behavior should be. I can help diagnose the underlying source of a problem. I can't tell you how to fix an operating system that I don't use.

@Xoristzatziki
Copy link

@freakboy3742 both python 2.x and python 3.x are currently in wide usage. This is a healthy behavior. Also, after installing a version of python (either 2 or 3) in a computer (ex. in Mac) does not change «magically» by time. In addition, as elsewhere stated(February 22, 2018), some Mac come with python 2.7 support.

The problem, in my case at least, occurred because pip installed a version without the "magic" try-except for Tkinter-tkinter and not because of some incomplete or incorrect (in this, specific point) Python installation. The problem may not exists if I used the code here, but I personally prefer install packages using pip, in a user space, instead of installing them by downloading or cloning the code from their repository, which may lead in future false checks. Also, when checking a new project, I like to create a VM and install a clean OS, in order not to mix my messy installations (either python specific or OS related).

@emansije
Copy link

@freakboy3742, you're still missing the point and I figured that it's because the report wasn't clear from the beginning as there were actually two problems. The first one was the fact that some distributions keep tkinter as a separate installation from python and the second one is that the pip installation of bugjar isn't the latest version that includes python 3 compatibility. IMHO the original issue should have been closed with a simple solution:

sudo apt install python-tk

or

sudo apt install python3-tk

The second issue, however, should have been opened as a separate issue and it is something that is in this project's maintainers capabilities to solve.

When I mentioned that several other Linux distributions, including Arch, had the same problem, I meant the second issue, not the first one. It was an example to illustrate that any installation of bugjar done with pip will fail because it isn't a Linux distribution problem but a problem with the pip packaging of bugjar.

@freakboy3742
Copy link
Member

Ok - so, in a ticket labeled "Fails to install on Ubuntu", where the only error message mentioned is "no module named tkinter"... I'm meant to guess that the bug report is somehow partially about the fact that there isn't a version on PyPI that supports Python3?

There's also nothing about the "PyPI version doesn't support Python3" problem that is Linux specific, either.

If nothing else, can all we please take away from this that clear bug reports save everyone time?

@emansije, you are correct - Python 3 support is in the GitHub repository, but I haven't pushed a version of that code to PyPI. I haven't pushed any code from this project for over 4 years. Building Bugjar revealed problems with Tk that I couldn't resolve, so I started working on an alternative. I'm hesitant to push a new version to PyPI because it suggests the project is more active than it is. FWIW, I'd very much like to get back to working on Bugjar, but for the moment, Toga & the rest of BeeWare is getting the bulk of my (very limited) attention.

@emansije
Copy link

Ok - so, in a ticket labeled "Fails to install on Ubuntu", where the only error message mentioned is "no module named tkinter"... I'm meant to guess that the bug report is somehow partially about the fact that there isn't a version on PyPI that supports Python3?

Actually, that was the second error message mentioned. The first one was mentioned by @pxc3113, in his post:

 bugjar: command not found

... which wasn't very helpful because there weren't any details on the installation procedure used.

But I owe everyone an apology for throwing an unrelated issue in the mix. It wasn't on purpose and I promise to be more careful next time.

There's also nothing about the "PyPI version doesn't support Python3" problem that is Linux specific, either.

I'm not sure I follow you on this one. It might not have been clear, but on my first post I said that it seemed to be a Bugjar's PyPI problem. Your following response seems to indicate that you either didn't understand what I meant or didn't read it at all.

@Xoristzatziki hit the same problem that I had with the PyPI version of Bugjar and reinforced my comment on that, but you kept in tune with the Tkinter issue and never realized that we were discussing the PyPI issue.

If nothing else, can all we please take away from this that clear bug reports save everyone time?

Totally agree.

@emansije, you are correct - Python 3 support is in the GitHub repository, but I haven't pushed a version of that code to PyPI. I haven't pushed any code from this project for over 4 years. Building Bugjar revealed problems with Tk that I couldn't resolve, so I started working on an alternative. I'm hesitant to push a new version to PyPI because it suggests the project is more active than it is.

Well... it's broken for Python 3, as it is, so it would make sense to push a more current version to PyPI, IMHO.

FWIW, I'd very much like to get back to working on Bugjar, but for the moment, Toga & the rest of BeeWare is getting the bulk of my (very limited) attention.

Since it's open source you can always ask for help in porting Bugjar to using Toga. I might even take a stab at it, if I find the time.

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

4 participants