- 1 year ago
Installing Python package from source using Microsoft Visual Build Tools 2017
Comment
1 / 1
To install a Python package from source on Windows using Microsoft Visual Build Tools 2017, follow these steps:
Install Microsoft Visual Build Tools 2017:
- Download the Microsoft Visual Build Tools 2017 installer from the official website: https://visualstudio.microsoft.com/visual-cpp-build-tools/
- Run the installer and select the required components. Make sure to install the "Desktop development with C++" workload, which includes the necessary build tools.
Open a Command Prompt with Build Tools Environment:
- After installing the build tools, open the "x64 Native Tools Command Prompt for VS 2017" or "x86 Native Tools Command Prompt for VS 2017" from the Start Menu. This will set up the environment variables required for building with Visual Studio tools.
Download and Extract the Python Package Source:
- Download the source code of the Python package you want to install. Typically, you can find the source code on the project's GitHub repository or the package's official website.
- Extract the source code to a directory on your computer.
Navigate to the Source Code Directory:
- Use the
cd
command to navigate to the directory where you extracted the source code.
- Use the
Build and Install the Package:
- In the Command Prompt, run the following command to build and install the package:arduino
python setup.py install
- Replace
python
with the path to your Python interpreter if it's not in the system's PATH.
If the package requires additional build options or dependencies, refer to the package's documentation for specific build instructions.
- In the Command Prompt, run the following command to build and install the package:
That's it! The package should now be installed in your Python environment. If you encounter any issues during the build process, make sure you have the required dependencies and build tools installed properly.