Serverless Python Requirements problem

Hi All,
Sorry if this is a repeated topic, I did find this topic but it was marked as resolved even though I have the same information.

Here is my environment:

Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           6.11.3
     Serverless Version:     1.27.3

My simple serverless.yml file

service: python-project

provider:
  name: aws
  runtime: python3.6

functions:
  httprequest:
    handler: httprequest.handler

plugins:
  - serverless-python-requirements

custom:
  pythonRequirements:
    dockerizePip: true

And Iā€™m getting

sls deploy --aws-profile dev

  Serverless Error ---------------------------------------

  Serverless plugin "serverless-python-requirements" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file.

I validated that the package was installed

npm install -g serverless-python-requirements
/Users/evalenzuela/.nvm/versions/node/v6.11.3/lib
ā””ā”€ā”€ serverless-python-requirements@4.1.0

I checked inside node for the package and that failed too

$ node
> require('serverless-python-requirements');
Error: Cannot find module 'serverless-python-requirements'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at repl:1:1
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:73:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:340:29)
    at bound (domain.js:280:14)
> .exit

Iā€™m not sure what else to check to validate if the package is working or not.
Finally, here is the SLS Debug

Serverless Error ---------------------------------------

  Serverless plugin "serverless-python-requirements" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file.

  Stack Trace --------------------------------------------

ServerlessError: Serverless plugin "serverless-python-requirements" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file.
    at plugins.forEach.error (/Users/evalenzuela/.nvm/versions/node/v6.11.3/lib/node_modules/serverless/lib/classes/PluginManager.js:115:17)
    at Array.forEach (native)
    at PluginManager.loadPlugins (/Users/evalenzuela/.nvm/versions/node/v6.11.3/lib/node_modules/serverless/lib/classes/PluginManager.js:88:13)
    at PluginManager.loadServicePlugins (/Users/evalenzuela/.nvm/versions/node/v6.11.3/lib/node_modules/serverless/lib/classes/PluginManager.js:142:10)
    at PluginManager.loadAllPlugins (/Users/evalenzuela/.nvm/versions/node/v6.11.3/lib/node_modules/serverless/lib/classes/PluginManager.js:84:10)
    at service.load.then (/Users/evalenzuela/.nvm/versions/node/v6.11.3/lib/node_modules/serverless/lib/Serverless.js:67:28)
From previous event:
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at __dirname (/Users/evalenzuela/.nvm/versions/node/v6.11.3/lib/node_modules/serverless/bin/serverless:28:46)
    at Object.<anonymous> (/Users/evalenzuela/.nvm/versions/node/v6.11.3/lib/node_modules/serverless/bin/serverless:46:4)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:502:3

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           6.11.3
     Serverless Version:     1.27.3

By the way, docker is installed

docker --version
Docker version 18.03.1-ce, build 9ee9f40

Thanks for all the help and advice

1 Like

Did you find a solution for this ?

Yes. It ended up working if I removed all node packages from that folder and re installed the plugins next to where the yml file existed

1 Like

Thanks ill give that a try.