PYNQ Remote Deployment using PyCharm

Hi,
Im trying to use PyCharm Professional Eddition to remotely deploy code on our Zynq Ultrascale+ ZCU104 using Image PYNQ 2.7, and my PyCharm version is 2021.2.4.

I’ve managed to setup the SSH connection within PyCharm, where everything works as expected.
I’ve further made the Interpreter of the project use the on host Python Package at
“/usr/local/share/pynq-venv/bin/python3”.

This all seems to work perfectly fine, my issue comes when trying to run the code on the platform.
When i try running the code using the PyCharm Configuration and pressing Ctrl+Shift+F10, i get the error:

/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/pl_server/device.py:79: UserWarning: No devices found, is the XRT environment sourced?
warnings.warn(
Traceback (most recent call last):
File “/tmp/pycharm_project_357/main.py”, line 65, in
run_NN()
File “/tmp/pycharm_project_357/main.py”, line 20, in run_NN
ol = Overlay(“/home/xilinx/pycharmJyputers/designFiles/design_1_wrapper.bit”)
File “/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/overlay.py”, line 336, in init
super().init(bitfile_name, dtbo, partial=False, device=device)
File “/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/bitstream.py”, line 111, in init
device = Device.active_device
File “/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/pl_server/device.py”, line 94, in active_device
raise RuntimeError(“No Devices Found”)
RuntimeError: No Devices Found

Process finished with exit code 1

PyCharm runs this command:
ssh://root@dankmachine:22/usr/local/share/pynq-venv/bin/python3 -u /tmp/pycharm_project_357/main.py

When i try to ssh in the a terminal as root with the pycharm terminal my program runs perfectly.

Here are some of the steps i’ve done to try to make it work.

Login in as Root in my SSH Config
I’ve tried calling the sh scripts from within my python program:
/etc/profile.d/xrt_setup.sh and /etc/profile.d/pynq_venv.sh

Greetings Mikkel

I have run into the same problem earlier this year. Any suggestions will be accepted with open arms!