Dear Adam,

Thanks for such a thorough list of instructions. Unfortunately, I am still
receiving the casperfpga/register.py syntax error above (now using Python
2.7.12) . However, I was able to resolve one other casperfpga issue doing
the following:

when running the "sudo python setup.py install" command, I was receving the
following error:

Warning (from warnings module):
  File "/usr/local/anaconda/lib/python2.7/distutils/dist.py", line 267
    warnings.warn(msg)
UserWarning: Unknown distribution option: 'install_requires'


This was resolved by changing the line (in setup.py) from 'from
distutils.core import setup' to 'from setuptools import setup'. I made this
change because distutils does not support 'install_requires', though
setuptools does according to this StackOverflow discussion
<http://stackoverflow.com/questions/9810603/adding-install-requires-to-setup-py-when-making-a-python-package>.
After this change, I then reran the line "sudo python setup.py install”, in
the casperfpga directory.  The install_requires issue was resolved but as
mentionned above, the syntax error in register.py still exists. Then I ran
the same command in the katcp-python directory and receive the following
issue:

Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    from katcp import version
  File "/u/home/josaitis/katcp-python/katcp/__init__.py", line 23, in
<module>
    from .core import (Message, KatcpSyntaxError, MessageParser,
  File "/u/home/josaitis/katcp-python/katcp/core.py", line 1625
    self._waiting_futures = {state: tornado_Future() for state in
valid_states}
                                                       ^
SyntaxError: invalid syntax

Any idea on how to fix this syntax error in the katcp-python setup?

Best,
Alec

Alec Josaitis
Candidate for B.S., Honors Physics
University of Michigan Men's Glee Club, Alumni Relations Manager

On Fri, Jul 22, 2016 at 2:56 AM, Adam Isaacson <aisaac...@ska.ac.za> wrote:

> 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 <josai...@umich.edu> 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