henry1758f / Azure-IoTHub-general-device

Azure IoTHub general device code for Azure PnP
MIT License
1 stars 7 forks source link

Run.sh #11

Open ecsauto opened 1 year ago

ecsauto commented 1 year ago

Hi team,.

After I executed the run.sh, I encountered some issue about "ModuleNotFoundError: No module named 'psutil'. Can you please let me know what the issue is? Python is already running 3.7.3. thanks.

 File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'cmake /tmp/pip-install-ZcnoiM/uamqp/                                                                  src/vendor/azure-uamqp-c/ -G "Unix Makefiles" -Duse_openssl:bool=ON -Duse_defaul                                                                  t_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_PO                                                                  SITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release' returned non-zero exit                                                                   status 127

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-ZcnoiM/uamqp/setup.py';f=getattr(tokenize, 'open', open)(file);code=f .read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" i nstall --record /tmp/pip-record-QJtuCY/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ZcnoiM/uamqp/ File "main.py", line 45 async def property_update(device_client,os_type,machine): ^ SyntaxError: invalid syntax Traceback (most recent call last): File "main.py", line 6, in import psutil ModuleNotFoundError: No module named 'psutil'

henry1758f commented 1 year ago

Hi, Maybe you have to install the packages list in the requirement.txt. run "pip install -r requirements.txt".

ecsauto commented 1 year ago

HI,

After I reinstalled the python, the issue is gone. Thanks. However, I still got some error when I run the script like this

image

Am I correct if I put the device parameter under device to the script ? Many thanks.

image

chiaotseng commented 1 year ago

Hi, The device parameter you use is correct, but you also need to put "IOTHUB_DEVICE_DPS_ENDPOINT" and "IOTHUB_DEVICE_DPS_ID_SCOPE" from the DPS service information.