0

Using pycharm, I finished my first python program. I am attempting to run a bat file with Windows Scheduler. The python script has lots of dependencies. They are available in the virtual environment I am using.

  1. I tried activating my virtual environment using the activate.bat file in the directory of the venv. The code of the scheduled bat file looked like this:

     C:\Users\PavelWorkXPS\Anaconda3\envs\TestEnv\Lib\venv\scripts\nt\activate.bat "D:\Dropbox\Toolkit\Python\Unusual_Options_Activity-ToS\main.py"     pause
    

When running this, Pycharm would launch because it is my default .py extension handler.

  1. I modified the bat file to use the interpreter python.exe from within the virtual environment folder, hoping it would have access to the dependencies.

     C:\Users\PavelWorkXPS\Anaconda3\envs\TestEnv\python.exe "D:\Dropbox\Toolkit\Python\Unusual_Options_Activity-ToS\main.py"  pause
    

Output would tell me it still can't see the dependencies. enter image description here

I used this earlier stackoverflow post for help, but it only explained the reason why pycharm was opening by itself.

Pavel L
  • 39
  • 7

1 Answers1

0

Conda was the reason for the problem. When I switched to doing it with a plain virtual environment, it stored all the downloaded repos in a folder inside of the folder with the script. Then I setup the bat file and all worked fine.

Pavel L
  • 39
  • 7