Python not picked up on path · Issue #100 · serverless/serverless-python-requirements · GitHub
Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Python not picked up on path #100

Description

@kadrach
which python
/home/kadrach/.pyenv/shims/python
which python3.6
/home/kadrach/.pyenv/versions/3.6.0/bin/python3.6

(these refer to the same python 3.6 installation). The pyenv shim is on path, yet the serverless plugin fails to pick it up:

Serverless: Generating requirements.txt from Pipfile...                                                    
Serverless: Installing required Python packages with undefined...                                          
                          
  Type Error ---------------------------------------------                                                 
                          
  "file" argument must be a non-empty string         
                          
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.                   
                          
  Get Support --------------------------------------------                                                 
     Docs:          docs.serverless.com              
     Bugs:          github.com/serverless/serverless/issues                                                
     Forums:        forum.serverless.com             
     Chat:          gitter.im/serverless/serverless  
                          
  Your Environment Information -----------------------------                                               
     OS:                     linux                   
     Node Version:           8.2.0                   
     Serverless Version:     1.24.0             

I can fix this with the following directive:

custom:
  pythonRequirements:
    pythonBin: python

but isn't this just referencing the same Python it should be using by default? Should this not work out of the box?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions