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

not working with brew python on macOS #530

Closed
chew-z opened this issue Mar 2, 2018 · 7 comments
Closed

not working with brew python on macOS #530

chew-z opened this issue Mar 2, 2018 · 7 comments

Comments

@chew-z
Copy link

chew-z commented Mar 2, 2018

General informations

I have noticed this morning that brew update && brew upgrade changed/linked 'python' to 'python3'. This is good perhaps but it resulted in offlineimap not working anymore on my system because 'commands' had been removed from python3.

Logs, error

$ offlineimap
OfflineIMAP 7.1.5
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v2.57 (bundled), Python v3.6.4, OpenSSL 1.0.2n  7 Dec 2017
ERROR: No module named 'commands'
ERROR: Exceptions occurred during the run!
ERROR: No module named 'commands'

$ python --version
Python 3.6.4
@nicolas33
Copy link
Member

Yes, the support for Py3 is not ready and stalled. I have no idea why these brew commands are changing python to python3. Is there something we can do?

@arolle
Copy link

arolle commented Mar 2, 2018

Could it be an option to change the header in libexec/offlineimap.py to #!/usr/bin/env python2?
One fix is to issue

 ln -sf "$(which python2)" "$(which python)"

@chris001
Copy link
Member

chris001 commented Mar 2, 2018

I'm nearly complete building the first real automatic tests of live email sync to run here on github for offlineimap, including support to test on MacOS, and python3. This makes updating to compatible with python3 much easier because the new code changes are verified in just 1-2 minutes on linux, macos, python 2.7 and python 3.6.

nicolas33 added a commit that referenced this issue Mar 3, 2018
The python executable will likely be set to python3 by default on more and more
distributions. Fix it to Python 2.

Github-ref: #530
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33
Copy link
Member

The idea of fixing the shebang is nice. Change applied on the current "next" branch. Hope this will help. Other than that I don't see what we could do, though.

Thank you all.

@sjktje
Copy link

sjktje commented Mar 4, 2018

Anyone know how to fix this temporarily until the next offlineimap release?

@chris001
Copy link
Member

chris001 commented Mar 4, 2018

@sjktje

  • You just need to edit 2 files, bin/offlineimap and offlineimap.py.
  • Edit the first line in each file, from #!/usr/bin/env python, to #!/usr/bin env python2. Save each file and that's it!

nicolas33 added a commit that referenced this issue Mar 4, 2018
Expect more and more distributions to use python3 as default python binary.

This was previously done for bin/offlineimap but I forgot this file in the move,
as suggested by Chris.

Github-ref: #530
Suggested-by: Chris Coleman <christocoleman@yahoo.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33
Copy link
Member

@chris001 Good point. I forgot this second file in my previous patch. Fixed for offlineimap.py, too.

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

5 participants