Open the terminal from within the pycharm project and run the command there. The opened terminal will activate the proper virtual environment.