Prev: Win XP: How to hide command window for sub processes?
Next: Aaaargh! "global name 'eggz' is not defined"
From: Sean DiZazzo on 29 Oct 2009 12:28 On Oct 29, 8:49 am, wadi wadi <wadie...(a)gmail.com> wrote: > I can't alter the import statement as the error log is pointing to one > of the installed python files 'hashlib.py' > > /python/2.6.2/lib/python2.6/hashlib.py > > and I don't have the right permissions to alter the python installation. > Any idea? > > On 10/29/09, Diez B. Roggisch <de...(a)nospam.web.de> wrote: > > > > > Hi, > > > please don't post this to comp.lang.python *and* the python mailinglist.. > > Both are synchronized, so your post shows up twice on both. > > >> I am trying to run a python script and got this error. > > >>>>import _md5 > >>>>ImportError: No module named _md5 > > > I've never seen this import. Normally, it should be > > > import md5 > > > So you might try to alter the import statement to > > > import md5 as _md5 > > > and see if things work. > > > It might be of course that the author of your script provided a home-grown > > implementation of md5 which has a different interface, and called this _md5 > > to prevent name-clashes. Then you need to modify your whole script to make > > it work. > > >> Googling the problem suggested that I install the 'py25-hashlib'. > > >> the following does not work for me 'sudo port install py25-hashlib' , > >> trying to install MacPorts raised many problems. > > >> My question is: any idea on how to install it using yum? > >> I am running python 2.6.2 on a centos machine. > > > I don't understand this - you are talking about ports which is a Mac-thing, > > but run on centos? > > > However that may be, this *should* be part of core python anyway. If not, > > you might look in yum for some python-dependency-packages, no idea how to > > do that though (debian user here) > > > Diez > > -- > >http://mail.python.org/mailman/listinfo/python-list > > -- > Wadienil. You are being vague and confusing. There is no default "_md5" python library in the standard library. You should be either using "import md5" (deprecated) or "import hashlib". Unless perhaps the code you show is from inside one of those libraries, and there is a _md5.so that it uses but cant find. Not sure about that. Did you write the code above? Or did you find it inside another file? If you found it inside another file what is the file? If you still have questions, I have another approach. Please cover your palm and fingers with a thick layer of black ink (making sure to cover your entire hand). Press your hand down firmly on a piece of bright white paper. Allow the ink to dry. Finally, scan the page and post it here. I will attempt to read your palm to find the answer. ~Sean
From: wadi wadi on 29 Oct 2009 13:08 Sorry for the confusion. In summary I have the same issue shown here with its solution. It seems to be a common problem. http://recurser.com/articles/2009/06/06/python-25-importerror-no-module-named-_md5-on-os-x/ However, their solution does not work with me as I am using a linux machine and they are suggesting the use of the 'port' command. I am looking for an equivalent command or workaround to install the missing library 'py25-hashlib' using 'yum' for example. On 10/29/09, Sean DiZazzo <half.italian(a)gmail.com> wrote: > On Oct 29, 8:49 am, wadi wadi <wadie...(a)gmail.com> wrote: >> I can't alter the import statement as the error log is pointing to one >> of the installed python files 'hashlib.py' >> >> /python/2.6.2/lib/python2.6/hashlib.py >> >> and I don't have the right permissions to alter the python installation. >> Any idea? >> >> On 10/29/09, Diez B. Roggisch <de...(a)nospam.web.de> wrote: >> >> >> >> > Hi, >> >> > please don't post this to comp.lang.python *and* the python mailinglist. >> > Both are synchronized, so your post shows up twice on both. >> >> >> I am trying to run a python script and got this error. >> >> >>>>import _md5 >> >>>>ImportError: No module named _md5 >> >> > I've never seen this import. Normally, it should be >> >> > import md5 >> >> > So you might try to alter the import statement to >> >> > import md5 as _md5 >> >> > and see if things work. >> >> > It might be of course that the author of your script provided a >> > home-grown >> > implementation of md5 which has a different interface, and called this >> > _md5 >> > to prevent name-clashes. Then you need to modify your whole script to >> > make >> > it work. >> >> >> Googling the problem suggested that I install the 'py25-hashlib'. >> >> >> the following does not work for me 'sudo port install py25-hashlib' , >> >> trying to install MacPorts raised many problems. >> >> >> My question is: any idea on how to install it using yum? >> >> I am running python 2.6.2 on a centos machine. >> >> > I don't understand this - you are talking about ports which is a >> > Mac-thing, >> > but run on centos? >> >> > However that may be, this *should* be part of core python anyway. If >> > not, >> > you might look in yum for some python-dependency-packages, no idea how >> > to >> > do that though (debian user here) >> >> > Diez >> > -- >> >http://mail.python.org/mailman/listinfo/python-list >> >> -- >> Wadienil. > > You are being vague and confusing. There is no default "_md5" python > library in the standard library. You should be either using "import > md5" (deprecated) or "import hashlib". Unless perhaps the code you > show is from inside one of those libraries, and there is a _md5.so > that it uses but cant find. Not sure about that. > > Did you write the code above? Or did you find it inside another > file? If you found it inside another file what is the file? > > If you still have questions, I have another approach. Please cover > your palm and fingers with a thick layer of black ink (making sure to > cover your entire hand). Press your hand down firmly on a piece of > bright white paper. Allow the ink to dry. Finally, scan the page and > post it here. I will attempt to read your palm to find the answer. > > ~Sean > -- > http://mail.python.org/mailman/listinfo/python-list > -- Wadienil.
From: Robert Kern on 29 Oct 2009 13:17 On 2009-10-29 11:28 AM, Sean DiZazzo wrote: > On Oct 29, 8:49 am, wadi wadi<wadie...(a)gmail.com> wrote: >> I can't alter the import statement as the error log is pointing to one >> of the installed python files 'hashlib.py' >> >> /python/2.6.2/lib/python2.6/hashlib.py >> >> and I don't have the right permissions to alter the python installation. >> Any idea? > You are being vague and confusing. There is no default "_md5" python > library in the standard library. You should be either using "import > md5" (deprecated) or "import hashlib". Unless perhaps the code you > show is from inside one of those libraries, and there is a _md5.so > that it uses but cant find. Not sure about that. > > Did you write the code above? Or did you find it inside another > file? If you found it inside another file what is the file? He's saying that he found that import in hashlib.py . He tried "import hashlib" (or something that tried "import hashlib"), and it gave him a traceback showing that the statement "import _md5" was the one that actually the root cause of the failure. > If you still have questions, I have another approach. Please cover > your palm and fingers with a thick layer of black ink (making sure to > cover your entire hand). Press your hand down firmly on a piece of > bright white paper. Allow the ink to dry. Finally, scan the page and > post it here. I will attempt to read your palm to find the answer. That's uncalled for. He's been reasonably clear. The error in understanding is all on your end. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
From: Robert Kern on 29 Oct 2009 13:19 On 2009-10-29 11:39 AM, wadi wadi wrote: > Hi Garrick, > > My python script depends on another framework that is implemented in python. > The error is originating from the framework code note my script and I > cannot change the framework. > > Also, it works on other machines. So my guess is that I have no choice I > need to install the 'py25-hashlib' on my current box. > Any idea? py25-hashlib is the name of a MacPorts package. That's for Macs, not Centos. hashlib is part of the standard library. You have a broken Python installation. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
From: Diez B. Roggisch on 29 Oct 2009 13:38 wadi wadi wrote: > Sorry for the confusion. > In summary I have the same issue shown here with its solution. It > seems to be a common problem. > > http://recurser.com/articles/2009/06/06/python-25-importerror-no-module-named-_md5-on-os-x/ > > However, their solution does not work with me as I am using a linux > machine and they are suggesting the use of the 'port' command. > I am looking for an equivalent command or workaround to install the > missing library 'py25-hashlib' using 'yum' for example. googling "python 2.6 rpm hashlib" suggests that there is an explicit python hashlib package, named something like "python-hashlib". So install it. Diez
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Win XP: How to hide command window for sub processes? Next: Aaaargh! "global name 'eggz' is not defined" |