Then you can run your code with just python main.py.Using pip install pypiwin32 you can install the package globally.This is not typically recommended, but included anyway. Option 3: Install globally (typically not recommended) You can run your code like python main.py so long as the virtual environment is active.Run pip install pypiwin32 from your active virtual environment to install the package.Run venv\Scripts\activate.bat from your project directory whenever you want to use this virtual environment (you will see (venv) added to your shell prompt to know it's activated).From your project directory, run python -m venv venv to setup you virtual environment.If pipenv isn't your thing, you can use the built-in virtual environments. Option 2: Install locally with venv (recommended) Run venv\Scripts\activate.bat from your project directory whenever you want to use this virtual environment (you will see (venv) added. From your project directory, run python -m venv venv to setup you virtual environment. Now you can run your code using commands like the following pipenv run main.py Option 2: Install locally with venv (recommended) If pipenv isn't your thing, you can use the built-in virtual environments.In your project directory, run pipenv install pypiwin32 to install the package.Ensure you have pipenv installed ( pip install pipenv).You can use a package manager like pipenv to manage your dependencies. Option 1: Install locally with pipenv (recommended) Since win32com is a Windows-specific package, this answer will be geared towards Windows users.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |