I looked somewhere on the internet to find out why I get this problem and it looks like is a problem of python versions, but I didn't find a way to fix it.. Here it is the error, maybe someone else got the same problem here... Thanks
Traceback (most recent call last): File "", line 7, in File "/Users/andrea/Library/Application Support/TextMate/Pristine Copy/Bundles/Python.tmbundle/Support/DocMate/docmate.py", line 7, in import urllib2 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 91, in import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/hashlib.py", line 133, in md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5
On Nov 19, 2008, at 11:51 AM, Andrea Crotti wrote:
Traceback (most recent call last): File "", line 7, in File "/Users/andrea/Library/Application Support/TextMate/Pristine Copy/Bundles/Python.tmbundle/Support/DocMate/docmate.py", line 7, in import urllib2 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/urllib2.py", line 91, in import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/hashlib.py", line 133, in md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5
The python dist you got from macports is *broken*. You need to adjust your PATH so textmate finds your system python *first*. I have a feeling that the symlinks in /usr/bin/ all point to your macports python. Then you can use TM_PYTHON to get the correct python for your scripts run via CMD+R.
I have the following symlinks in /usr/bin/
lrwxr-xr-x 1 root wheel 72 Mar 24 2008 /usr/bin/python -> ../../ System/Library/Frameworks/Python.framework/Versions/2.5/bin/python lrwxr-xr-x 1 root wheel 79 Mar 24 2008 /usr/bin/python-config -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
python-config lrwxr-xr-x 1 root wheel 75 Mar 24 2008 /usr/bin/python2.5 -> ../../ System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 lrwxr-xr-x 1 root wheel 82 Mar 24 2008 /usr/bin/python2.5-config -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
python2.5-config lrwxr-xr-x 1 root wheel 73 Mar 24 2008 /usr/bin/pythonw -> ../../ System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw lrwxr-xr-x 1 root wheel 76 Mar 24 2008 /usr/bin/pythonw2.5 -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
pythonw2.5
—alex
Alex Ross-8 wrote:
On Nov 19, 2008, at 11:51 AM, Andrea Crotti wrote:
Traceback (most recent call last): File "", line 7, in File "/Users/andrea/Library/Application Support/TextMate/Pristine Copy/Bundles/Python.tmbundle/Support/DocMate/docmate.py", line 7, in import urllib2 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/urllib2.py", line 91, in import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/hashlib.py", line 133, in md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5
The python dist you got from macports is *broken*. You need to adjust your PATH so textmate finds your system python *first*. I have a feeling that the symlinks in /usr/bin/ all point to your macports python. Then you can use TM_PYTHON to get the correct python for your scripts run via CMD+R.
I have the following symlinks in /usr/bin/
lrwxr-xr-x 1 root wheel 72 Mar 24 2008 /usr/bin/python -> ../../ System/Library/Frameworks/Python.framework/Versions/2.5/bin/python lrwxr-xr-x 1 root wheel 79 Mar 24 2008 /usr/bin/python-config -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
python-config lrwxr-xr-x 1 root wheel 75 Mar 24 2008 /usr/bin/python2.5 -> ../../ System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 lrwxr-xr-x 1 root wheel 82 Mar 24 2008 /usr/bin/python2.5-config -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
python2.5-config lrwxr-xr-x 1 root wheel 73 Mar 24 2008 /usr/bin/pythonw -> ../../ System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw lrwxr-xr-x 1 root wheel 76 Mar 24 2008 /usr/bin/pythonw2.5 -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
pythonw2.5
I solved with a simple python_select, going back to the default apple python2.5. I also had to set the proxy, the best way to create a "button" to switch between more proxies?? It would be even better if textmate could take the setting of the proxy globally from the operating system.
Is this possible? Are plugins for that?
On Nov 25, 2008, at 1:57 PM, Andrea Crotti wrote:
Alex Ross-8 wrote:
On Nov 19, 2008, at 11:51 AM, Andrea Crotti wrote:
Traceback (most recent call last): File "", line 7, in File "/Users/andrea/Library/Application Support/TextMate/Pristine Copy/Bundles/Python.tmbundle/Support/DocMate/docmate.py", line 7, in import urllib2 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/urllib2.py", line 91, in import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/hashlib.py", line 133, in md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5
The python dist you got from macports is *broken*. You need to adjust your PATH so textmate finds your system python *first*. I have a feeling that the symlinks in /usr/bin/ all point to your macports python. Then you can use TM_PYTHON to get the correct python for your scripts run via CMD+R.
I have the following symlinks in /usr/bin/
lrwxr-xr-x 1 root wheel 72 Mar 24 2008 /usr/bin/python -> ../../ System/Library/Frameworks/Python.framework/Versions/2.5/bin/python lrwxr-xr-x 1 root wheel 79 Mar 24 2008 /usr/bin/python-config -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
python-config lrwxr-xr-x 1 root wheel 75 Mar 24 2008 /usr/bin/python2.5 -
../../
System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 lrwxr-xr-x 1 root wheel 82 Mar 24 2008 /usr/bin/python2.5- config -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
python2.5-config lrwxr-xr-x 1 root wheel 73 Mar 24 2008 /usr/bin/pythonw -> ../../ System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw lrwxr-xr-x 1 root wheel 76 Mar 24 2008 /usr/bin/pythonw2.5 -
../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/
pythonw2.5
I solved with a simple python_select, going back to the default apple python2.5. I also had to set the proxy, the best way to create a "button" to switch between more proxies?? It would be even better if textmate could take the setting of the proxy globally from the operating system.
Is this possible? Are plugins for that?
I'm not sure what you mean? You want to set the python version that Textmate uses without setting symlinks? Then you can set the TM_PYTHON variable in your preferences to whichever python you'd like to use.
—Alex
On 25 Nov 2008, at 13:57, Andrea Crotti wrote:
[…] I also had to set the proxy, the best way to create a "button" to switch between more proxies?? It would be even better if textmate could take the setting of the proxy globally from the operating system.
Is this possible? Are plugins for that?
What is this proxy for? I assume this is when fetching http resources via the Python network library? In that case, it would be Python which should “take the global proxy setting”.
That said, some shell commands (like curl) support reading the proxy settings from the environment. I did write a shell command (placed in Support/bin) to dump the OS proxy settings with the intention of bridging the global preferences UI and shell environment, but it seems proxy stuff can be quite complex, so I never got anywhere with it (and not using a proxy server myself).
Ok I solved the problem of the proxy but not the problem of the python version. Now I still get the same error if I use the python installation from macports.
Maybe it is broken but it's there that I installed all my additional modules, if I use the apple version I can't use all the additional modules I installed from macports...
Have you tried updating your python module? Perhaps you got a newer version with the port package.
On Thu, Dec 25, 2008 at 7:09 AM, Andrea Crotti kerny404@gmail.com wrote:
Ok I solved the problem of the proxy but not the problem of the python version. Now I still get the same error if I use the python installation from macports.
Maybe it is broken but it's there that I installed all my additional modules, if I use the apple version I can't use all the additional modules I installed from macports... -- View this message in context: http://www.nabble.com/Problems-with-python-bundle-tp20577401p21167231.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Dana Rea wrote:
Have you tried updating your python module? Perhaps you got a newer version with the port package.
Well no I got the last, and reinstalled it a few times.. Now I even don't understand why pymate is not working (with all the python versions). If I run something like that
#!/usr/bin/env python if __name__ == '__main__': a = raw_input("kjld")
I get kjld EOFError: EOF when reading a line
Instead of a windows asking me for the input...
You're example works ok for me (using cmd-R). Python gives the following version number in one of the output windows:
PyMate r8111 running Python 2.5.1 (/usr/bin/env python)
Does this differ from what you see?
Also, keep in mind that the macports python installs to /opt/local/bin if that's the version you need to be using. That version is 2.5.2 r252:60911 for me.
On Thu, Dec 25, 2008 at 12:37 PM, Andrea Crotti kerny404@gmail.com wrote:
Dana Rea wrote:
Have you tried updating your python module? Perhaps you got a newer version with the port package.
Well no I got the last, and reinstalled it a few times.. Now I even don't understand why pymate is not working (with all the python versions). If I run something like that
#!/usr/bin/env python if __name__ == '__main__': a = raw_input("kjld")
I get kjld EOFError: EOF when reading a line
Instead of a windows asking me for the input...
View this message in context: http://www.nabble.com/Problems-with-python-bundle-tp20577401p21168904.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Dec 25, 2008, at 9:56 AM, Dana Rea wrote:
You're example works ok for me (using cmd-R). Python gives the following version number in one of the output windows: PyMate r8111 running Python 2.5.1 (/usr/bin/env python) Does this differ from what you see?
Dang, that is an oooooooold version. Go to preferences and set your updates to “Cutting-Edge”.
Well as long as it works :)
On Thu, Dec 25, 2008 at 1:14 PM, Alex Ross tm-alex@rosiba.com wrote:
On Dec 25, 2008, at 9:56 AM, Dana Rea wrote:
You're example works ok for me (using cmd-R). Python gives the following version number in one of the output windows: PyMate r8111 running Python 2.5.1 (/usr/bin/env python) Does this differ from what you see?
Dang, that is an oooooooold version. Go to preferences and set your updates to "Cutting-Edge".
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
I updated cutting-edge version and now the raw_input() works :D
This is really nice, I'm still having error on the damn md5 thing (can't get documentation) but most important I get an error I didnt' get before, I can't post on my blog anymore, for this:
Received exception: HTTP-Error: 502 Bad Gateway RuntimeError: HTTP-Error: 502 Bad Gateway
!? Now it's restarted to work, uhm weird...
On Dec 30, 2008, at 1:15 AM, Andrea Crotti wrote:
I updated cutting-edge version and now the raw_input() works :D
This is really nice, I'm still having error on the damn md5 thing (can't get documentation) but most important I get an error I didnt' get before, I can't post on my blog anymore, for this:
Again, this is because the macports build of python is incomplete.
http://www.nabble.com/No-module-named-_md5-td14535473.html
Did you “sudo port install py25-hashlib”?
Received exception: HTTP-Error: 502 Bad Gateway RuntimeError: HTTP-Error: 502 Bad Gateway
Well, that is an HTTP error, not a python error.
!? Now it's restarted to work, uhm weird...
A transient HTTP error. :)
Alex Ross-8 wrote:
On Dec 30, 2008, at 1:15 AM, Andrea Crotti wrote:
Again, this is because the macports build of python is incomplete.
http://www.nabble.com/No-module-named-_md5-td14535473.html
Did you “sudo port install py25-hashlib”?
Received exception: HTTP-Error: 502 Bad Gateway RuntimeError: HTTP-Error: 502 Bad Gateway
Well, that is an HTTP error, not a python error.
!? Now it's restarted to work, uhm weird...
A transient HTTP error. :)
Yes you're right it has nothing to do with TM.. I did install hashlib a few times as I did install python25 a few times (I upgraded it yesterday)
sh-3.2# port -v installed | grep hashlib py25-hashlib @2.5.4_0 (active)
But still gets the same error...
It actually turns out that the problem is here
try: import _hashlib # use the wrapper of the C implementation new = __hash_new
for opensslFuncName in filter(lambda n: n.startswith('openssl_'), dir(_hashlib)): funcName = opensslFuncName[len('openssl_'):] try: # try them all, some may not work due to the OpenSSL # version not supporting that algorithm. f = getattr(_hashlib, opensslFuncName) f() # Use the C function directly (very fast) exec funcName + ' = f' except ValueError: try: # Use the builtin implementation directly (fast) exec funcName + ' = __get_builtin_constructor(funcName)' except ValueError: # this one has no builtin implementation, don't define it pass # clean up our locals del f del opensslFuncName del funcName
except ImportError: # We don't have the _hashlib OpenSSL module? # use the built in legacy interfaces via a wrapper function new = __py_new
# lookup the C function to use directly for the named constructors md5 = __get_builtin_constructor('md5') sha1 = __get_builtin_constructor('sha1') sha224 = __get_builtin_constructor('sha224') sha256 = __get_builtin_constructor('sha256') sha384 = __get_builtin_constructor('sha384') sha512 = __get_builtin_constructor('sha512')
No wait a moment there's something strange here, I tried to add a print sys.path to hashlib where it fails to import _hashlib (but from ipython works without problems) and it says. in import hashlib File "hashlib.py", line 131, in print sys.path NameError: name 'sys' is not defined
So for some reasons I can not import the damn module...
Alex Ross-8 wrote:
On Dec 30, 2008, at 11:22 AM, Andrea Crotti wrote:
So for some reasons I can not import the damn module...
wait, so you don't get the error when you import from interactive python? can you paste a minimal example of code that generates the error you are getting?
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Actually I get this error only when I try a command-h on a word (documentation for word in the python bundle).
This is the whole traceback Traceback (most recent call last): File "", line 7, in File "/Users/andrea/Library/Application Support/TextMate/Pristine Copy/Bundles/Python.tmbundle/Support/DocMate/docmate.py", line 7, in import urllib2 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 91, in import hashlib File "hashlib.py", line 134, in md5 = __get_builtin_constructor('md5') File "hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5
The problem is generated from urllib2.. Uhm maybe I'm starting to understand, urllib2 is located in /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ with hashlib, BUT _hashlib.so is in /opt/local/lib/python2.5/site-packages
I don't understand why the hell of this mess but I'll try to fix it..
Have you tried installing py25-hashlib in MacPorts?
-- Takashi Yoshida
email: takashi@takashiyoshida.org web: http://takashiyoshida.org
On Nov 19, 2008, at 6:51 PM, Andrea Crotti wrote:
I looked somewhere on the internet to find out why I get this problem and it looks like is a problem of python versions, but I didn't find a way to fix it.. Here it is the error, maybe someone else got the same problem here... Thanks
Traceback (most recent call last): File "", line 7, in File "/Users/andrea/Library/Application Support/TextMate/Pristine Copy/Bundles/Python.tmbundle/Support/DocMate/docmate.py", line 7, in import urllib2 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/urllib2.py", line 91, in import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/hashlib.py", line 133, in md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5 -- View this message in context: http://www.nabble.com/Problems-with-python-bundle-tp20577401p20577401.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate