What I’m trying to do:
I am trying to allow an application (Called RSAKPI) I have copy a report (in text) to the clipboard from Anvil installed on a local workstation.
What I’ve tried and what’s not working:
I added the package line for anvil.js.window as the examples show:
from ._anvil_designer import RSAKPITemplate
import anvil.server
from .Transport import Cargo
from anvil.js.window import navigator
But when I run the page I get this:
[ERROR anvil.app-server.run] Error report from client code:
ModuleNotFoundError: No module named ‘anvil.js.window’; ‘anvil.js’ is not a package
Traceback:
RSAKPI_Optimisation/RSAKPI.py:4
C:/Users/adrian/miniconda3/envs/rsakpi/lib/site-packages/anvil_downlink_worker/init.py:70
C:/Users/adrian/miniconda3/envs/rsakpi/lib/site-packages/anvil_downlink_worker/init.py:186
app/RSAKPI_Optimisation/RSAKPI/init.py:28
I am running this locally on my own server.
So I thought I would get this working on the Anvil server using a simple example called DataGridPlay (which I did get working on Anvil).
I then saved this in GitHub and cloned it to the workstation I am using.
Using the same command window from MiniConda where I got the error, I killed the RSAKPI app and started the DataGridPlay application.
It works fine.
My levels of knowledge here are very thin, but I thought that if I got one application working with anvil.js.window from a Miniconda environment then any other application launched form there should work too.
Note: I am using VSCode locally with the python interpreter set to the RSAKPI minconda environment. For both applications it gives me warnings that ._anvil_designer and anvil.js.window does not exist. On its on anvil.js is OK as it can find that file.
So this makes me think that there is something wrong/broken in the configuration of the RSIKPI application (not the miniconda environment) that means at runtime it cannot find anvil.js.window.
But it can in datagridplay.
Can someone nudge me along?
Thanks
Adrian