-1

I have a python script that is running OK in PyCharm. It's first line is 'import pandas'

I created a bat file that looks like this: "C:\Users\icohen1\AppData\Local\Microsoft\WindowsApps\python.exe" "C:\Users\MyName\PycharmProjects\pythonProject1\venv\LotsToTextFile.py" pause

When I run this bat file I get this error: import pandas ModuleNotFoundError: No module named 'pandas'

What am I missing here?

Thanks

1 Answers1

0

I guess, the python environment you use in Pycharm is not C:\Users\icohen1\AppData\Local\Microsoft\WindowsApps\python.exe, but a virtual env Pycharm created for your project.

If you wish to run with the virtual env, go to Pycharm and find where the python.exe if virtual env is located, and modify your python path.

If you wish to run with "C:\Users\icohen1\AppData\Local\Microsoft\WindowsApps\python.exe", you should install pandas for that global python.exe. Usually this will install it. in cmd shell

pip3 install pandas
54138qqqq
  • 67
  • 1
  • 8