# pip: command not found while deploying django project on vercel

**URL:** <https://forum.djangoproject.com/t/pip-command-not-found-while-deploying-django-project-on-vercel/30906>\
**Category:** Deployment\
**Created:** [May 6, 2024, 7:38pm UTC](https://forum.djangoproject.com/t/pip-command-not-found-while-deploying-django-project-on-vercel/30906 "2024-05-06T19:38:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirolim-dev](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mirolim-dev/32/21108_2.png) [@mirolim-dev](https://forum.djangoproject.com/u/mirolim-dev)\
**Post date:** [May 6, 2024, 7:38pm UTC](https://forum.djangoproject.com/t/pip-command-not-found-while-deploying-django-project-on-vercel/30906/1 "2024-05-06T19:38:06Z")

</div>

build\_files.sh: (fromat1)

```auto
echo " BUILD START"
python3.9 -m install -r requirements.txt
python3.9 manage.py collectstatic
echo "BUILD END"

```

build\_files.sh: (fromat2)

```auto
pip install -r requirements.txt

python3.9 manage.py collectstatic

```

By both formats of build\_files.sh I’m getting same error

my settings:

```auto
ALLOWED_HOSTS = ['.vercel.app', '.now.sh']

STATIC_URL = 'static/'
STATICFILES_DIRS = os.path.join(BASE_DIR, 'static')
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles', 'static')
MEDIA_URL = 'media/'
MEDIA_ROOT = 'media/'

```

vercel.json:

```auto
{
    "builds": [{
        "src": "config/wsgi.py",
        "use": "@vercel/python",
        "config": { "maxLambdaSize": "15mb", "runtime": "python3.9"}
    },
    {
        "src": "build_files.sh",
        "use": "@vercel/static-build",
        "config": {
            "disDir": "staticfiles"
        }
    }
],
   

    "routes": [
        {
            "src": "/static/(.*)",
            "dest": "/static/$1"
        },
        {
            "src": "/(.*)",
            "dest": "config/wsgi.py"
        }
    ]
}

```

_ **error:** _

> 23:55:19.603] Running build in Washington, D.C., USA (East) – iad1  
> [23:55:19.865] Cloning [github.com/mirolim-dev/TTJ](http://github.com/mirolim-dev/TTJ) (Branch: mirolim, Commit: 4f62e4b)  
> [23:55:20.338] Previous build cache not available  
> [23:55:20.694] Cloning completed: 829.258ms  
> [23:55:21.303] Running “vercel build”  
> [23:55:22.104] Vercel CLI 34.1.8  
> [23:55:22.428] WARN! Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: [Error Codes](https://vercel.link/unused-build-settings)  
> _**[23:55:23.204] ./build\_files.sh: line 1: pip: command not found**_  
> [23:55:23.253] Traceback (most recent call last):  
> [23:55:23.254] File “/vercel/path0/manage.py”, line 11, in main  
> [23:55:23.254] from django.core.management import execute\_from\_command\_line  
> [23:55:23.254] ModuleNotFoundError: No module named ‘django’  
> [23:55:23.254]  
> [23:55:23.254] The above exception was the direct cause of the following exception:  
> [23:55:23.254]  
> [23:55:23.254] Traceback (most recent call last):  
> [23:55:23.254] File “/vercel/path0/manage.py”, line 22, in   
> [23:55:23.254] main()  
> [23:55:23.254] File “/vercel/path0/manage.py”, line 13, in main  
> [23:55:23.254] raise ImportError(  
> _**[23:55:23.254] ImportError: Couldn’t import Django. Are you sure it’s installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?**_  
> _**[23:55:23.260] Error: Command “./build\_files.sh” exited with 1**_  
> _**[23:55:23.660]**_

---

<div class="post-metadata">

**Author:** ![wassef911](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wassef911/32/17521_2.png) [@wassef911](https://forum.djangoproject.com/u/wassef911)\
**Post date:** [May 7, 2024, 9:14pm UTC](https://forum.djangoproject.com/t/pip-command-not-found-while-deploying-django-project-on-vercel/30906/2 "2024-05-07T21:14:07Z")

</div>

```sh
echo "BUILD START"

# create a virtual environment named 'venv' if it doesn't already exist
python3.9 -m venv venv

# activate the virtual environment
source venv/bin/activate

# install all deps in the venv
pip install -r requirements.txt

# collect static files using the Python interpreter from venv
python manage.py collectstatic --noinput

echo "BUILD END"

# [optional] Start the application here 
# python manage.py runserver

```
