0

I am running a small piece of code in pycharm using python 2.7 and is running smoothly.

Here is my code:

import pandas as pd
import numpy as np

print("Ok! its running")

Then i created .bat file named "test.bat" to run my program

But when i scheduled my task in task scheduler, I am getting error

Import Error:"Missing reuirment dependencies ['numpy']

I have python 2 and python 3 both in my laptop in D and C drives respectively.
the program runs successfully when i give python 3 path in task scheduler but not with python 2.7.
Why?

Amit
  • 763
  • 1
  • 5
  • 14

1 Answers1

0

I would assume that its using your default pip instead of the pip of Python 2. You can check running the following command:

pip --version

Which return which pip its using as you can see for me its using pip for Python 3 by default:

pip 22.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

You should use the following command for Python 2:

python2.7 -m pip <commands>

You can finde more info here how to use python2.7 pip instead of default pip