gtimelog can't find pygtk installed via Homebrew on Mac OS - python

I have installed Python via Homebrew. I also installed pygtk via Homebrew
I went to install gtimelog via pip but it tells me it's already installed, it appears to have come down with Python in Homebrew
When I attempt to run gtimelog I get ImportError: No module named pygtk
It appears to be a $PYTHONPATH issue but I can't seem to resolve it.

I run into the same issue. Read the Homebrew log:
==> Installing pygtk
==> Downloading http://ftp.acc.umu.se/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/pygtk/2.24.0
==> make install
==> Caveats
For non-Homebrew Python, you need to amend your PYTHONPATH like so:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
==> Summary
The problem is that even with the right PYTHONPATH I'm getting an error when running gtimelog:
$ gtimelog
Traceback (most recent call last):
File "/usr/local/bin/gtimelog", line 8, in <module>
load_entry_point('gtimelog==0.8.0dev', 'gui_scripts', 'gtimelog')()
File "/Library/Python/2.7/site-packages/gtimelog-0.8.0dev-py2.7.egg/gtimelog/main.py", line 2208, in main
tray_icon = icon_class(main_window)
File "/Library/Python/2.7/site-packages/gtimelog-0.8.0dev-py2.7.egg/gtimelog/main.py", line 1148, in __init__
'style-updated', self.on_style_set) # Gtk+ 3
TypeError: <gtk.Window object at 0x10b443cd0 (GtkWindow at 0x7fe09aacd1d0)>: unknown signal name: style-updated
**Update:
For Mountain Lion you need to install XQuarks as apple doesn't ship X11 with their OS anymore..
As per why gtimelog wasn't opening, It is a gtimelog bug and if you edit ~/.gtimelog/gtimelogrc and set show_tray_icon to False you will get it working!

Related

Errors by installing Python modules Pygame and Pygame Zero

I've succesfully installed Python version 3.8.1 and also PIP.
After that i want to install Pygame and Pygame Zero with the commands
pip install pygame
or
pip install pgzero
But I get the following error:
C:\>pip install pygame
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python38\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable
Also with the --user command it doesn't succeed:
pip install pygame --user
or
pip install pgzero --user
What am I doing wrong here now?
I also got that problem long ago.
You can try this:
pip uninstall pygame
pip uninstall pgzrun
then download it by:
pip install pygame
pip install pgzrun
Info of your assets are little low.. But if you have Python 2 and 3, try manage your alias on CMD by checking your current python variables from /usr/bin and from CMD type "python --version" to see current default. If it says Python2.7 you can chance that with "alias" command below (reason to do that, is 2.7 support is ending 1.1.2020 and old pip for it too. So in future, you should upload new modules just for Python3.7). If you have 2.7 in your PC and you have been using it for some time, you should not try to remove it.
So just in case:
$ alias python="/usr/bin/python3.7"
Then use command
$ sudo pip3 install pygame
This should work. If not, there is some setting problems on your module site.
Give a hit with this and if it doesn't work, let us know. I can give instruction to get it to work. It requires few steps at (in my case:)
/home/usr/Python-3.7.4/Modules/Settings.
It can (I'm not sure with these modules but..) require to set SSL connection too, but it can be done from there too, without any coding.
Thank you for the quick arswers!
It is succeeded by giving the commands:
py -3 -m pip install pygame --user
py -3 -m pip install pgzero --user
The only warnings i got by installing pgzero were:
Collecting pgzero
Downloading .....
Installing collected packages: numpy, pgzero
WARNING: The script f2py.exe is installed in 'C:\Users\Han\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script pgzrun.exe is installed in 'C:\Users\Han\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.18.0 pgzero-1.2
Oh.. I didn't know, you are using Windows.. My last answer dried down with that. It was for Linux.
Either way, when you installed python, did you mark the PATH in installation process?
It shows when installation windows pops up.
I'm little noob with windows, but I expect it to be as same as in any operation systems.
If you didn't, its easier to remove Python and install it again, than try to mark the PATH after installing. After all its just 1/2 min job.

Failure: Centos 6.4 python easy_install is broken

I've looked at quite a lot of related questions here - no help for me. I need to repair easy_install, so that I can update distribute to a version >=0.6.28, so that I can update python matplotlib using pip and not yum.
In the process of trying to update python matplotlib from 0.99 (the default with Centos64) to 1.4.x, I got into this trouble:
pip install --upgrade matplotlib tells me this:
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.10 (/usr/lib/python2.6/site-packages))
So I followed the suggestion and saw that some 0.7.x version of distribute was installed (so it seemed). Re-ran the pip command and got the exact same complaint.
Trouble with easy_install?
It was either now, or maybe after performing yum remove, then install python-setuptools that I discovered easy_install is thoroughly broken. Now when I try to run easy_install, I get this stacktrace:
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 9, in <module>
load_entry_point('distribute', 'console_scripts', 'easy_install')()
File "/usr/local/lib/python3.3/site-packages/setuptools-18.2-py3.3.egg/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.3/site-packages/setuptools-18.2-py3.3.egg/pkg_resources/__init__.py", line 2681, in load_entry_point
raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found
Look at that - why is it referring to python3.3? I don't think I've got that installed. My default python is 2.6.6.
Any ideas? TIA.
Fixed it. The python3.3 bit was my clue. I found the python script for easy_install, in /usr/local/bin. The very first line designated /usr/bin/python3.3 to execute the script. Changed to 2.6 and then was good to go.
In the end I was not able to upgrade matplotlib from 0.99 to 1.4.3, because I could not upgrade basemap from 0.99 and some conflicts arose. Rather than punish myself with trying to build from source, I think I should simply upgrade my entire VM to Centos7 and I will then have much newer matplotlib.

Emacs deferred errors

I have installed the Emacs package jedi-emacs using M-x package install
and the following Python packages:
Jedi
EPC
argparse
using:
pip install --install-option="--prefix=~/.my_python_packages/" jedi
pip install --install-option="--prefix=/.my_python_packages/" epc
pip install --install-option="--prefix=/.my_python_packages/" argparse
since I do not have root priviledges.
When I open a Python file, I get the following error in the minibuffer, no matter where I place the cursor:
deferred error : (error Server may raise an error : Traceback (most recent call last):
File "/home/avazquez/.emacs.d/elpa/jedi-20130119.830/jediepcserver.py", line 261, in <module>
)
What could be causing it?
This is with Emacs 24.2.1
I found the solution to my problem. I did not have PYTHONPATH set up correctly (it should include the corresponding paths for /path/to/custom-packages).
For more info on this issue see the corresponding ticket in the package repository for emacs-jedi.

Easy_install and Pip doesn't work

Easy_install and Pip doesn't work anymore on python 2.7, when I try to do:
sudo easy_install pip
I get:
Traceback (most recent call last):
File "/usr/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 2713, in <module>
parse_requirements(__requires__), Environment()
File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.15
And when I try:
sudo pip install [package]
I get:
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 2713, in <module>
parse_requirements(__requires__), Environment()
File "/usr/bin/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==0.8.2
I've already install both of them (and yes, first deleted them), but no result...
Thanks!
(I tried already this post)
I had this issue where python's distribute package wasn't installed for some reason. After following the instructions on python-distribute, i got it working.
install the distribute package as follows:
$ wget https://web.archive.org/web/20100225231201/http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
EDIT: http://python-distribute.org/distribute_setup.py no longer works:
hopefully this will resolve your problem with running
$ sudo easy_install
Happy Coding!
If you installed a new version of easy_install through Distribute, the new command may have been installed in another directory, most likely /usr/local/bin/. But the traceback shows you were using /usr/bin/easy_install. Try this:
sudo /usr/local/bin/easy_install ...
Try
sudo easy_install Distribute
and if that exists, but is too old
sudo easy_install -U Distribute
Looks like either Distribute/setuptools (it's old name) is messed up or Python package settings. If either of these do not help, try removing the full Python 2.7 installation and reinstall everything from the scratch.
Possible reasons for the mess is that you have used both sudo easy_install / sudo pip and Linux distribution packages to mix and match system-wide installation packages. You should use virtualenv instead if you use pip/easy_install (no sudo needed)
http://pypi.python.org/pypi/virtualenv
I had a similar problem, but things were working fine as root. In my case, I found that the permissions on the python packages were not readable by the ID I was running the command under.
To correct it, I ran the following command to open the permission for read and execute to all users:
sudo chmod o+rx -R /usr/local/lib/python2.7/dist-packages/*.egg
I had similar issue when trying to install package via pip with python 3.6 on windows. (pip is supposed to work out of the box with this install)
The problem was not running as administrator.
Running cmd as administrator and then installing my package worked:
python -m pip install pylint
I was trying to get pip to work on the 2.7.0 version, but it seems like it doesn't come with the easy_install/pip files (Script folder in main directory), installing 2.7.13 solved the problem for me.

Problems installing MySQL-python-1.2.3c1 on Mac Snow Leopard

I am having a problem installing the Python MySQL connector (MySQL-python-1.2.3c1) on my Mac OSX Snow Leopard.
System State
I have manually compiled an installed:
mysql-5.1.41
This seems to work fine, as I can create and query a database from the commandline.
I have compiled:
MySQL-python-1.2.3c1
I first set the following in the site.cfg file:
mysql_config = /usr/local/mysql/bin/mysql_config
I then built and compiled MySQL-python-1.2.3c1 following their guide:
sudo python setup.py build
sudo python setup.py install
I now test the installation with Python:
python -c "import MySQLdb"
Error Message
This then gives me the following error, and I'm stumped as to how to fix it:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/username/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so, 2): Symbol not found: _mysql_affected_rows
Referenced from: /Users/username/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so
Expected in: flat namespace
in /Users/username/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so
mymac: username$
Things I've Tried
I've looked at this blog antoniocangiano.com but it is for an older version of MySQL-python and is not really applicable. But I tried adding the soft link it mentions.
I then looked at this blog post: http://blog.some-abstract-type.com/2009/09/mysql-python-and-mac-os-x-106-snow.html. And tried building compiling with the ARCHFLAGS settings - but no joy.
Please Help
If you have any ideas please let me know.
Many thanks
Ben...
First, I would suggest using the MySQL binaries for MacOS X 10.5 64-bit (x86_64). The tar ball works on MacOS X 10.6.
You said you used ARCHFLAGS.. however, try it again like this:
shell> ARCHFLAGS="-arch x86_64" python setup.py build
shell> sudo python setup.py install
Thus building as normal user, installing as root. (It's good to remove the source, and unpack correcting the site.cfg file again).
What does
otool -L /Users/username/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so
report?

Categories