Closed malt3 closed 7 years ago
Did you just recently update Python?
Same here with macOS 10.11.6 and Profanity 0.6.0dev.master.b768c8b.
I un- and reinstalled python a few times recently, so there might have been an update.
@pfannie Did you restart your machine in between or at least your bash?
@ReneVolution Yes, I did.
When I run /plugins python_version
inside Profanity it shows Python 2.7.10, which is the one that originally shipped with the OS, neither Python 2.7.13 or Python 3.6.0 which I installed through homebrew. Even though python
and python3
link to those respectively.
On the other hand, when trying to load the plugin, the error message says it's using the homebrew python.
By the way, I'm using iTerm2 Build 3.0.14, and zsh 5.3.1.
A quick google search resulted in http://stackoverflow.com/questions/34861128/osx-using-bash-to-find-python-is-different-than-using-usr-bin-env-python.
Could you try that and report back?
OK, so I followed python
all the way back to /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
. I guess that's normal for the homebrew installation.
$ ls -l /usr/local/bin/python
lrwxr-xr-x 1 admin 34B Feb 5 19:18 /usr/local/bin/python -> ../Cellar/python/2.7.13/bin/python
$ ls -l /usr/local/Cellar/python/2.7.13/bin/python
lrwxr-xr-x 1 admin 54B Dec 17 21:05 /usr/local/Cellar/python/2.7.13/bin/python -> ../Frameworks/Python.framework/Versions/2.7/bin/python
$ ls -l /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python
lrwxr-xr-x 1 admin 7B Dec 17 21:05 /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python -> python2
$ ls -l /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2
lrwxr-xr-x 1 admin 9B Dec 17 21:05 /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2 -> python2.7
$ ls -l /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
-rwxr-xr-x 1 admin 13K Feb 5 19:18 /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
These other things all result in the same output:
$ /usr/local/bin/python -c "import sys; print sys.executable; print sys.version_info"
/usr/local/opt/python/bin/python2.7
sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0)
$ /usr/bin/env python -c "import sys; print sys.executable; print sys.version_info"
/usr/local/opt/python/bin/python2.7
sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0)
$ python -c "import sys; print sys.executable; print sys.version_info"
/usr/local/opt/python/bin/python2.7
sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0)
Did you also try hash -r python
as stated in the accepted answer?
Yes. This is what hash | grep python
returns:
python=/usr/local/bin/python
python-config=/usr/local/bin/python-config
python2=/usr/local/bin/python2
python2-config=/usr/local/bin/python2-config
python2.6=/usr/bin/python2.6
python2.6-config=/usr/bin/python2.6-config
python2.7=/usr/local/bin/python2.7
python2.7-config=/usr/local/bin/python2.7-config
python3=/usr/local/bin/python3
python3-config=/usr/local/bin/python3-config
python3.6=/usr/local/bin/python3.6
python3.6-config=/usr/local/bin/python3.6-config
python3.6m=/usr/local/bin/python3.6m
python3.6m-config=/usr/local/bin/python3.6m-config
pythontex=/Library/TeX/texbin/pythontex
pythonw=/usr/local/bin/pythonw
pythonw2=/usr/local/bin/pythonw2
pythonw2.6=/usr/bin/pythonw2.6
pythonw2.7=/usr/local/bin/pythonw2.7
I also had a look at this question at SO: http://stackoverflow.com/questions/34386527/symbol-not-found-pycodecinfo-getincrementaldecoder. But for me python -c "import io"
works fine, I guess, as I don't get any output.
Weird ... what is the output of type python
?
type python
returns python is /usr/local/bin/python
.
I did some testing and by now I'm pretty sure that this is either an issue with homebrew or with profanity. I installed it from source and compared the config.log files with the homebrew installation and you can clearly see where the homebrew install "goes wrong":
configure:12411: Symlinking Python.framework to /Library/Frameworks/Python.framework
configure:12418: checking for python-config
configure:12434: found /usr/bin/python-config
configure:12446: result: yes
configure:12463: checking for python
configure:12481: found /usr/bin/python
configure:12493: result: /usr/bin/python
configure:12509: checking for a version of Python >= '2.1.0'
configure:12535: result: yes
configure:12566: checking for the distutils Python package
configure:12570: result: yes
configure:12584: checking for Python include path
configure:12600: result: -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
configure:12607: checking for Python library path
configure:12684: result: -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib -lpython2.7
configure:12691: checking for Python site-packages path
configure:12697: result: /Library/Python/2.7/site-packages
configure:12704: checking python extra libraries
configure:12711: result: -ldl -framework CoreFoundation
configure:12718: checking python extra linking flags
configure:12725: result: -u _PyMac_Error /System/Library/Frameworks/Python.framework/Versions/2.7/Python
configure:12732: checking consistency of all components of python development environment
For some reason it finds the system python stuff, which is rather strange, but doesn't have anything to do with this plugin.
Fixed this in a sense that OmemoState now comes with source of this plugin.
When trying to start profanity with the plugin loaded I get this error in my log:
Using macos 10.12.3 with profanity 0.6.0dev.master.b768c8b