Re: [pydicom] SyntaxError: invalid syntax during install

383 views
Skip to first unread message

Jonathan Suever

unread,
Feb 25, 2013, 10:35:52 AM2/25/13
to pyd...@googlegroups.com
Rickard,

First of all, welcome to Python! 

So the issue that you're having is that when you run the "python" command you're running the system python, which for Scientific Linux 4.6 is version 2.3.4. Pydicom requires version 2.6 or higher. We have a legacy fork which can be used with earlier versions.

Did you install python 3.3 from source? If you want to use python 3,  you probably need to run either python3 or python3.3 (python3 setup.py install). Is there any particular reason that you are using Python 3.3? I ask because currently, python 3.x is not officially supported in pydicom. I'm actually currently trying to track down a bug that appears during installation on python3.3 installations.

I would strongly recommend sticking to python 2.7 for now. It is still widely used and most packages should support it. If you have to use python 3 for some reason, I'd recommend any version 3.2 or below.

-Jonathan


On Mon, Feb 25, 2013 at 8:33 AM, Rickard Cronholm <rickard....@gmail.com> wrote:
Hi folks,

I'm a MATLAB user that is considering learning python. My only python experience is the mandatory hello world test so please consider that when laughing at my ignorance.

To the point: I'm trying to install pydicom under Linux (Scientific Linux 4.6) using python 3.3.0. This is what I get
[root@rf-cluster pydicom-0.9.8]# python setup.py install
Traceback (most recent call last):
  File "setup.py", line 2, in ?
    from distribute_setup import use_setuptools
  File "/usr/local/python/pydicom-0.9.8/distribute_setup.py", line 248
    @_no_sandbox
    ^
SyntaxError: invalid syntax

The distribute_setup.py looks like this from line 248:

@_no_sandbox
def _rename_path(path):
    new_name = path + '.OLD.%s' % time.time()
    log.warn('Renaming %s into %s', path, new_name)
    os.rename(path, new_name)
    return new_name

Any pointers? Any at all?

Best regards,
Rickard

--
You received this message because you are subscribed to the Google Groups "pydicom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydicom+u...@googlegroups.com.
To post to this group, send email to pyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/pydicom?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rickard Cronholm

unread,
Feb 26, 2013, 3:44:31 AM2/26/13
to pyd...@googlegroups.com
Thanks for your reply Jonathan.

There was no particular reason for installing python 3.3, I just grabbed the latest version I could find. I was not aware of the distinction between python and python3. Just installed python 2.7.3 and pydicom installed without issues. Win!

//Rickard
Reply all
Reply to author
Forward
0 new messages