import sys
import os
# Get the path of the current Python interpreter
python_path = sys.executable
# Locate the directory where PyInstaller is installed
pyinstaller_path = os.path.join(os.path.dirname(python_path), 'Scripts', 'pyinstaller.exe')
# Add the PyInstaller path to the system's PATH environment variable temporarily
os.environ["PATH"] += os.pathsep + os.path.dirname(pyinstaller_path)
# Check if PyInstaller is recognized now
try:
import pyinstaller
print("PyInstaller is now recognized as an internal command.")
except ImportError:
print("PyInstaller is still not recognized as an internal command.")