Can't find module "pync"?
See original GitHub issueHey there,
I’ve installed the plugin (and have python 2.7.10
installed via pyenv
) as well as done a pip install pync
, but on load of the plugin, this happens:
python: stdout/stderr: Traceback (most recent call last):
python: stdout/stderr: File "/Users/colby/.weechat/python/autoload/notification_center.py", line 6, in <module>
python: stdout/stderr: from pync import Notifier
python: stdout/stderr: ImportError: No module named pync
python: unable to parse file "/Users/colby/.weechat/python/autoload/notification_center.py"
I’m assuming it’s because it can’t find the pync
package I’ve installed? What can I do to get it to recognize my pyenv
Python install? It definitely is installed, because when I try it out via the Python REPL, I get this (with the notification appearing properly):
Hope you can help me out! Let me know if you need anything else from me.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to install pync on mac - python - Stack Overflow
It seems that the package for pync in the Python Package Index does not work properly. Installing directly from the pync github repo...
Read more >pync · PyPI
A simple Python wrapper around the terminal-notifier command-line tool (version 2.0.0), which allows you to send User Notifications to the Notification ...
Read more >Python can't find module, even after pip install - Reddit
Python can't find module, even after pip install. I'm trying to import/use an ETL package, PETL, with import petl as etl.
Read more >Why Can't Python Find My Modules? - Real Python
A common error that new Pythonistas will come across is that the packages they think they've installed are not actually being recognized by ......
Read more >Notify yourself from Python — Javorové lístky - Honza Javorek
Then I often found myself watching funny cat gifs one hour later, ... With the pync library, you can send native macOS notifications ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@leoj3n I was about to give up on getting OS X notifications from Weechat! Thanks, you put me on the right track!
The trick is: “python” from homebrew must be installed BEFORE you install weechat via homebrew. Otherwise weechat links to macOS “python2” install, which lacks the ability to load all libraries.
I don’t use pyenv. Instead, I always use “python2/python3/pip2/pip3” prefixes to specify which version I want.
Here’s how I fixed my weechat which had been installed before I had homebrew’s python2:
After that, my weechat worked and was able to use pync!
So all that remained was to do this in weechat:
Success!
I have found this same issue with
zsh
+pyenv
+weechat
installed via Homebrew.WeeChat is built using
cmake
: https://github.com/weechat/weechat/blob/master/Makefile.am#L58I don’t really know much about
cmake
, but my guess is it “finds” thesystem
python instead ofpyenv
.Maybe we need to tell WeeChat’s
cmake
to usepyenv
like this?Can someone with more knowledge on the subject confirm whether or not the problem is indeed in how WeeChat builds itself, or maybe is it a problem with how Homebrew builds WeeChat? Certainly it’s not a problem with
weechat-notification-center
but not sure where to go next.Also note that WeeChat recommends python version 2.7 over 3.x.
https://github.com/Homebrew/brew/blob/master/Library/Homebrew/language/python.rb#L20 https://github.com/Homebrew/brew/blob/master/Library/Homebrew/requirements/python_requirement.rb#L22
http://stackoverflow.com/questions/32018969/coexistence-of-homebrew-and-pyenv-on-macosx-yosemite
If I force the env var
PYTHONPATH
:It finds
pync
but the error changes fromImportError: No module named pync
to:https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Homebrew-and-Python.md#homebrew-provided-python-bindings
https://docs.python.org/2/using/cmdline.html#envvar-PYTHONHOME
Finally:
I just gave up on that and used Homebrew’s
python
andpip
:Works. 👍