Hi Alec,

I have written this how to on installing the casperfpga python libraries -
will eventually end up on the Wiki. If you follow this and still have
problems then it could be a version issue. I am using Python 2.7.6 and
IPython 1.2.1

Check out:

https://drive.google.com/open?id=1mqDIwhHo3981_Rq9Ma6Dl8UnQUzPah6DKQ55fsaeI4c

Let me know if you have access issues.

Kind Regards,

Adam



On Thu, Jul 21, 2016 at 9:49 PM, Alec Josaitis <[email protected]> wrote:

> Dear Casperites,
>
> I recently started the *Introduction to Simulink Roach2 - Casper *tutorial
> and am having difficulty importing the required “casperfpga" repository
> from GitHub. After cloning the repo (git clone git
> ://github.com/ska-sa/casperfpga <https://github.com/ska-sa/casperfpga>),
> and while running the standard  “sudo python setup.py install” command, I
> reach the “byte-compiling” printout statement of file register.pyc and then
> receive a syntax error:
>
> byte-compiling /usr/lib/python2.6/site-packages/casperfpga/register.py to
> register.pyc
> SyntaxError: ('invalid syntax',
> ('/usr/lib/python2.6/site-packages/casperfpga/register.py', 106, 38,
> '        new_values = {_field: None for _field in self.field_names()}\n’))
>
>
> The rest of the install then continues. If I then open python
> and type “import casperfpga”, this syntax error once again appears. Here is
> the full print-out (which also includes the version of python and Red Hat
> Linux that I’m using):
>
> Python 2.6.6 (r266:84292, May 22 2015, 08:34:51)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-15)] on linux2
> >>> import casperfpga
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.6/site-packages/casperfpga/__init__.py", line 7,
> in <module>
>     from dcp_fpga import DcpFpga
>   File "/usr/lib/python2.6/site-packages/casperfpga/dcp_fpga.py", line 3,
> in <module>
>     from casperfpga import CasperFpga
>   File "/usr/lib/python2.6/site-packages/casperfpga/casperfpga.py", line
> 10, in <module>
>     import register
>   File "/usr/lib/python2.6/site-packages/casperfpga/register.py", line 106
>     new_values = {_field: None for _field in self.field_names()}
>                                  ^
> SyntaxError: invalid syntax
>
>
> Now, I doubt there actually is a syntax error because the GitHub repo
> doesn’t have any posted issues, so I then assume this is an issue with my
> own environment.  Do any of you either have suggestions on how I should
> change my environment to properly recognize the casperfpga register.py
> file, or have specific recommendations on how to edit the register.py file?
>
> Best Regards,
> Alec
>



-- 

Adam Isaacson

DBE: FPGA Engineer

SKA-SA

3rd Floor

The Park

Park Road

Pinelands

7405


Tel: +27215067300 (W)

Fax: +27215067375 (W)

Cell: +27825639602

Reply via email to