Xilinx / Alveo-PYNQ

Introductory examples for using PYNQ with Alveo
Apache License 2.0
48 stars 17 forks source link

Trouble installing pynq-alveo-examples #31

Open Anacardoide opened 8 months ago

Anacardoide commented 8 months ago

Hi,

My company installed the Alveo U55C FPGA and I'm trying to install the PYNQ Alveo examples package but I keep running into the same error message:

$ pip install pynq-alveo-examples
Defaulting to user installation because normal site-packages is not writeable
Collecting pynq-alveo-examples
  Using cached pynq_alveo_examples-1.0.2.tar.gz (1.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/bin/python3.7 /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpkr_h9txc
       cwd: /tmp/pip-install-5s08n48k/pynq-alveo-examples_de4c905aef06408dab2b67b4533b2a14
  Complete output (32 lines):
  Traceback (most recent call last):
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
      main()
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 488, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 17, in <module>
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/pynq/__init__.py", line 4, in <module>
      from . import pl_server
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/pynq/pl_server/__init__.py", line 18, in <module>
      from .embedded_device import EmbeddedDevice
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/pynq/pl_server/embedded_device.py", line 11, in <module>
      from pynqmetadata.frontends import Metadata
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/pynqmetadata/__init__.py", line 5, in <module>
      from .models.bit_field import BitField
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/pynqmetadata/models/__init__.py", line 4, in <module>
      from .addrmap import AddressMap
    File "/tmp/pip-build-env-yko25_kh/overlay/lib/python3.7/site-packages/pynqmetadata/models/addrmap.py", line 6, in <module>
      from .metadata_object import MetadataObject
    File "<fstring>", line 1
      (self.name=)
                ^
  SyntaxError: invalid syntax
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/1b/06/0080a65633dd014a6c5046238e5578d17fbfcac62be151c3aaef2772e47e/pynq_alveo_examples-1.0.2.tar.gz#sha256=c6b5c1502245eff6f33dac3656f47001a9fe77ae252ff36108f1aa3effc6d245 (from https://pypi.org/simple/pynq-alveo-examples/) (requires-python:>=3.5.2). Command errored out with exit status 1: /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/bin/python3.7 /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpkr_h9txc Check the logs for full command output.
  Using cached pynq_alveo_examples-1.0.1.tar.gz (1.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/bin/python3.7 /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmp6hgeebw2
       cwd: /tmp/pip-install-5s08n48k/pynq-alveo-examples_f66cfc3f24f145a18adb74efca417381
  Complete output (32 lines):
  Traceback (most recent call last):
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
      main()
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 488, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 17, in <module>
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/pynq/__init__.py", line 4, in <module>
      from . import pl_server
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/pynq/pl_server/__init__.py", line 18, in <module>
      from .embedded_device import EmbeddedDevice
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/pynq/pl_server/embedded_device.py", line 11, in <module>
      from pynqmetadata.frontends import Metadata
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/pynqmetadata/__init__.py", line 5, in <module>
      from .models.bit_field import BitField
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/pynqmetadata/models/__init__.py", line 4, in <module>
      from .addrmap import AddressMap
    File "/tmp/pip-build-env-a6ofuuoc/overlay/lib/python3.7/site-packages/pynqmetadata/models/addrmap.py", line 6, in <module>
      from .metadata_object import MetadataObject
    File "<fstring>", line 1
      (self.name=)
                ^
  SyntaxError: invalid syntax
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3b/db/8c2f769c1d3f8644ccb46a5c99a563456e36262e1d07b220865b24909a74/pynq_alveo_examples-1.0.1.tar.gz#sha256=8bd7faca978167d0f738773cf0188b36c915597a50625c51c7bbb519b993813f (from https://pypi.org/simple/pynq-alveo-examples/) (requires-python:>=3.5.2). Command errored out with exit status 1: /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/bin/python3.7 /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmp6hgeebw2 Check the logs for full command output.
  Using cached pynq_alveo_examples-1.0.tar.gz (1.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/bin/python3.7 /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmprgtsueqe
       cwd: /tmp/pip-install-5s08n48k/pynq-alveo-examples_66c0c461a5774b3bba2e2d8043de84b2
  Complete output (32 lines):
  Traceback (most recent call last):
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
      main()
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 488, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 17, in <module>
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/pynq/__init__.py", line 4, in <module>
      from . import pl_server
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/pynq/pl_server/__init__.py", line 18, in <module>
      from .embedded_device import EmbeddedDevice
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/pynq/pl_server/embedded_device.py", line 11, in <module>
      from pynqmetadata.frontends import Metadata
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/pynqmetadata/__init__.py", line 5, in <module>
      from .models.bit_field import BitField
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/pynqmetadata/models/__init__.py", line 4, in <module>
      from .addrmap import AddressMap
    File "/tmp/pip-build-env-v7bt5ofo/overlay/lib/python3.7/site-packages/pynqmetadata/models/addrmap.py", line 6, in <module>
      from .metadata_object import MetadataObject
    File "<fstring>", line 1
      (self.name=)
                ^
  SyntaxError: invalid syntax
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/77/07/d5d82c8076cb78a6ebfefdae1e14f6cb7856ebb73025ef595d80e8046246/pynq_alveo_examples-1.0.tar.gz#sha256=47b7ab73a27c7a11b330c9991218bef203890f4e7cafc4872fd5c46a29f6dfb6 (from https://pypi.org/simple/pynq-alveo-examples/) (requires-python:>=3.5.2). Command errored out with exit status 1: /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/bin/python3.7 /mnt/netapp1/Optcesga_FT2_RHEL7/2020/gentoo/22072020/usr/lib64/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmprgtsueqe Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pynq-alveo-examples (from versions: 1.0, 1.0.1, 1.0.2)
ERROR: No matching distribution found for pynq-alveo-examples

We have Python 3.7.8 already installed in the system, I can't change that. I tried both with the last PYNQ version and, due to a very similar resolved issue another user opened here, with PYNQ 2.7.0 because Python >= 3.8 is needed for the last version of PYNQ. Neither way is working and I don't know what to do.

STFleming commented 8 months ago

Hi @Anacardoide,

So, the reason for this error you are reporting is that the latest version of PYNQ uses some f-string features that Python 3.7 (which you are using) does not support. They are supported in Python 3.8+, which we require for the latest version.

You mentioned that you cannot upgrade the Python version on the machine you are using. Have you considered using Anaconda to create a local Python 3.8 environment that you could use? If you cannot do this, then I guess the best course is to try and solve the issue you mentioned that is preventing you from using PYNQ 2.7.0. Would you mind pointing us to that issue and giving a bit more information about it? You mentioned it was resolved.

mariodruiz commented 8 months ago

To add to this, you can find the instructions to install pynq on an Anaconda env here https://pynq.readthedocs.io/en/latest/getting_started/alveo_getting_started.html#install-conda

Anacardoide commented 8 months ago

Hi @Anacardoide,

So, the reason for this error you are reporting is that the latest version of PYNQ uses some f-string features that Python 3.7 (which you are using) does not support. They are supported in Python 3.8+, which we require for the latest version.

You mentioned that you cannot upgrade the Python version on the machine you are using. Have you considered using Anaconda to create a local Python 3.8 environment that you could use? If you cannot do this, then I guess the best course is to try and solve the issue you mentioned that is preventing you from using PYNQ 2.7.0. Would you mind pointing us to that issue and giving a bit more information about it? You mentioned it was resolved.

Oh, I'll try with Anaconda then! I never used it but it's very common in my CPD so I'll ask for help if needed. Also, the resolved issue I was refering to was this one: https://github.com/Xilinx/Alveo-PYNQ/issues/26

Anacardoide commented 8 months ago

To add to this, you can find the instructions to install pynq on an Anaconda env here https://pynq.readthedocs.io/en/latest/getting_started/alveo_getting_started.html#install-conda

Thanks a lot!

Anacardoide commented 8 months ago

To add to this, you can find the instructions to install pynq on an Anaconda env here https://pynq.readthedocs.io/en/latest/getting_started/alveo_getting_started.html#install-conda

Hi again, I've been trying to follow that guide but there's a problem: while I need to use Python 3.8, the GIST that I have to copy to generate environment.yml is made for Python 3.7.4. I tried manually changing the corresponding line to python=3.8 and letting conda solve all the dependencies while creating the environment, but it doesn't seem to work: no environment is created anywhere, even with the command being apparently successful.

Is there an updated GIST? Thanks in advance.

mariodruiz commented 8 months ago

Hi @Anacardoide,

Please ignore the section Using a Conda Environment.

The Install Conda instructions are enough, this env has everything you need to run pynq. No need to use the environment.yml file

wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh -O anaconda3.sh
bash anaconda3.sh