Error: spawn ENOTDIR

Hi, at the moment I see this error when I was trying to run sls deploy on my local.

(venv) minwang@minthinkpad:~/mm-src/sinch-mms-callback-worker$ sls deploy --force --verbose --conceal --region ap-southeast-2 --stage dev
Serverless: Running "serverless" installed locally (in service node_modules)
Serverless: Deprecation warning: Starting with next major version, API Gateway-specific configuration keys "apiKeys", "resourcePolicy" and "usagePlan" will be relocated from "provider" to "provider.apiGateway"
            More Info: https://www.serverless.com/framework/docs/deprecations/#AWS_API_GATEWAY_SPECIFIC_KEYS
Serverless: Generated requirements from /home/minwang/mm-src/sinch-mms-callback-worker/requirements.txt in /home/minwang/mm-src/sinch-mms-callback-worker/.serverless/requirements.txt...
Serverless: Installing requirements from /home/minwang/.cache/serverless-python-requirements/7ae997e5865b6d641ee769a5f6794523481760acc56c82c38190454d7e146188_x86_64_slspyc/requirements.txt ...
Serverless: Using download cache directory /home/minwang/.cache/serverless-python-requirements/downloadCacheslspyc
 
 Error ---------------------------------------------------
 
  Error: spawn ENOTDIR
      at ChildProcess.spawn (node:internal/child_process:413:11)
      at Object.spawn (node:child_process:700:9)
      at spawn (/home/minwang/mm-src/sinch-mms-callback-worker/node_modules/cross-spawn/index.js:12:24)
      at /home/minwang/mm-src/sinch-mms-callback-worker/node_modules/child-process-ext/spawn.js:29:11
      at new Promise (<anonymous>)
      at module.exports (/home/minwang/mm-src/sinch-mms-callback-worker/node_modules/child-process-ext/spawn.js:23:18)
      at pipAcceptsSystem (/home/minwang/mm-src/sinch-mms-callback-worker/node_modules/serverless-python-requirements/lib/pip.js:106:30)
      at installRequirements (/home/minwang/mm-src/sinch-mms-callback-worker/node_modules/serverless-python-requirements/lib/pip.js:220:17)
      at installRequirementsIfNeeded (/home/minwang/mm-src/sinch-mms-callback-worker/node_modules/serverless-python-requirements/lib/pip.js:684:9)
      at async ServerlessPythonRequirements.installAllRequirements (/home/minwang/mm-src/sinch-mms-callback-worker/node_modules/serverless-python-requirements/lib/pip.js:762:29)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              16.15.1
     Framework Version:         2.72.3 (local)
     Plugin Version:            5.5.4
     SDK Version:               4.3.2
     Components Version:        3.18.2
 
(venv) minwang@minthinkpad:~/mm-src/callback-worker$ 

This is my package.json file looks like

{
  "name": "callback-worker",
  "version": "1.0.0",
  "description": "Sinch MMS Callback Worker",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "MessageMedia",
  "license": "SEE LICENSE IN LICENSE.md",
  "devDependencies": {
    "process": "^0.11.10",
    "serverless-python-requirements": "^5.1.1"
  },
  "dependencies": {
    "node": "^16.0.0",
    "serverless": "^2.41.2"
  }
}

I was thinking if it is because the version conflicts or not?? I try to update the version on Python virtual environment, but not success either. If anyone has ever had the same issue like mine?

(venv) minwang@minthinkpad:~/mm-src/callback-worker$ npm install --silent -g npm@7.12.0 && npm install --silent node@16.0.0 && npm install --silent -g serverless@2.40.0
(venv) minwang@minthinkpad:~/mm-src/callback-worker$ 
(venv) minwang@minthinkpad:~/mm-src/callback-worker$ 
(venv) minwang@minthinkpad:~/mm-src/callback-worker$ node --version
v16.15.1
(venv) minwang@minthinkpad:~/mm-src/callback-worker$ npm --version
8.14.0
(venv) minwang@minthinkpad:~/mm-src/callback-worker$ serverless --version
Serverless: Running "serverless" installed locally (in service node_modules)
Framework Core: 2.72.3 (local)
Plugin: 5.5.4
SDK: 4.3.2
Components: 3.18.2
(venv) minwang@minthinkpad:~/mm-src/callback-worker$ 

Problem fixed. It’s because of Python virtual environment. I deleted the venv and recreate a new one. Fixed.