Bad magic number usually means that the pyc file is old. Try deleting it (the one named in the traceback). Actually, I'm confused why it's trying to run some file name random.py in your downloads directory. I guess you have some junk in your downloads folder, which is confusing the installer. Try doing it from some clean (empty) directory.
By the way, pip is in some respects better than easy_install (it's newer anyway), so you might try installing that too/instead. easy_install comes with Python (or at least I think it does), so you can usually just do "easy_install pip", and then "pip install whatever". And frankly, if the package is there, the Debian package manager is better than both, since it install updates automatically. This is especially true if you want to use the new ipython qtconsole or notebook, as they require several dependencies which are not pleasant to compile/install manually. Aaron Meurer On Sun, Jan 1, 2012 at 11:39 AM, Comer <[email protected]> wrote: > I now conclude that the ez_setup.py won't work because python 2.7 does > not seem to be listed (the report of a problem at line 34 indicates it > tried version 2.6 but that is not what I am trying to install > under...). Frustrating. > > Comer > > On Jan 1, 1:27 pm, Comer <[email protected]> wrote: >> I have today decided to redo all python installs on my debian machine >> because of the existence of python2.5 stuff in a lot of places. I have >> installed python 2.7.2. I have subsequently installed sympy 0.7.1 and >> ipython 0.12. However, I am having some strange things happening when >> I try to do an install of easy_install. I am trying to use ez_setup >> run to put in setuptools but it won't run. Here is the junk: >> debian:~/Downloads> sudo python ez_setup.py >> Traceback (most recent call last): >> File "ez_setup.py", line 278, in <module> >> main(sys.argv[1:]) >> File "ez_setup.py", line 210, in main >> egg = download_setuptools(version, delay=0) >> File "ez_setup.py", line 132, in download_setuptools >> import urllib2, shutil >> File "/usr/local/lib/python2.7/urllib2.py", line 94, in <module> >> import httplib >> File "/usr/local/lib/python2.7/httplib.py", line 79, in <module> >> import mimetools >> File "/usr/local/lib/python2.7/mimetools.py", line 6, in <module> >> import tempfile >> File "/usr/local/lib/python2.7/tempfile.py", line 34, in <module> >> from random import Random as _Random >> ImportError: Bad magic number in /home/comer/Downloads/random.pyc >> >> Sorry to bother the list with dribble about python-related installs, >> but my debian box seems to be a mishmash as over the last three years >> I have put in quite a lot of stuff and it is not clear that it is >> consistent. I am trying to do a fresh install of everything but >> squeeze has a lot of python stuff installed (all based on python >> 2.5). I am trying to redo all including sympy and ipython and now >> need to put in lots of stuff that I will need (numpy etc). >> >> Thanks for help. >> >> Comer >> >> On Jan 1, 12:29 am, Ondøej Èertík <[email protected]> wrote: >> >> >> >> >> >> >> >> > On Sat, Dec 31, 2011 at 3:55 PM, Aaron Meurer <[email protected]> wrote: >> > > On Dec 31, 2011, at 4:38 PM, Comer <[email protected]> wrote: >> >> > >> Well, first doing a import sympy works. >> >> > >> Second, you are right about the version probably, as I did in fact do >> > >> a download from git this afternoon (eastern time). What do you suggest >> > >> I try next? >> >> > > Do a fresh install of whichever one you want (0.7.1 or 0.7.1-git). >> >> > >> And what about downloading the latest ipython and installing it in my >> > >> home directory? >> >> > > I recommend updating ipython, though i think it's unrelated to your >> > > current problem. >> >> > > Aaron Meurer >> >> > Note that if you just want to use SymPy, you can just download the git >> > (or a release tarball), unpack and do: >> >> > bin/isympy >> >> > and that will run sympy without installing it. That should always work. >> >> > Ondrej > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
