Hi,
I am porting* an application to extract Service Metrics from a cloud based bug and issue tracking app called SIFTER.
It provides some Python to help digest the JSON data that it provides through its API. (accounts.py)
This uses the requests package which I have added to the project along with python-dateutil.
However, when ever I try to run the project it gives the error:
ModuleNotFoundError: No module named 'requests'
When I add the requests (and python-dateutil) I get this after it sets the status to built:
Assembling config...Done
Loading base image...Done
Installing custom packages...
Requirement already satisfied: requests in ./.env/lib/python3.10/site-packages (from -r /home/anvil/custom-requirements.txt (line 1)) (2.31.0)
Collecting python-dateutil (from -r /home/anvil/custom-requirements.txt (line 2))
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 16.1 MB/s eta 0:00:00
Requirement already satisfied: charset-normalizer<4,>=2 in ./.env/lib/python3.10/site-packages (from requests->-r /home/anvil/custom-requirements.txt (line 1)) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in ./.env/lib/python3.10/site-packages (from requests->-r /home/anvil/custom-requirements.txt (line 1)) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./.env/lib/python3.10/site-packages (from requests->-r /home/anvil/custom-requirements.txt (line 1)) (2.0.3)
Requirement already satisfied: certifi>=2017.4.17 in ./.env/lib/python3.10/site-packages (from requests->-r /home/anvil/custom-requirements.txt (line 1)) (2023.5.7)
Requirement already satisfied: six>=1.5 in ./.env/lib/python3.10/site-packages (from python-dateutil->-r /home/anvil/custom-requirements.txt (line 2)) (1.14.0)
Installing collected packages: python-dateutil
Successfully installed python-dateutil-2.8.2
Saving image...Done
Note: It did create a red button for Security issues in some packages - but this has disappeared.
Does anyone know what I have done wrong?
I think that I could substitute the anvil.http package instead (I am new to python so I am never sure) but I wanted to understand why this is happening.
My apologies if my searches did not find a pre-existing answer for this.
Thanks
Adrian
- From Actian OpenROAD
I am splitting this effort between the Anvil IDE and MS Code on Windows 10 with a local anvil server installed. Being new to python I really need a debugger to help me bridge the syntax and understand the return types from calls etc. But in the Windows version I can’t work out how to resolve the issue “Import “._anvil_designer” could not be resolved” or how to install these dependant packages into the Anvil virtual directory (is that what its called?)