Zuzu-Typ / PyGLM

Fast OpenGL Mathematics (GLM) for Python
zlib License
214 stars 29 forks source link

Installation on Window 7, 32-bit. Error: Microsoft Visual C++ 14.0 or greater is required #235

Closed 8Observer8 closed 2 months ago

8Observer8 commented 2 months ago

Window 7, 32-bit Python 3.7.6

pip install pyglm

Collecting pyglm
  Downloading PyGLM-2.7.1.tar.gz (4.6 MB)
     ---------------------------------------- 4.6/4.6 MB 1.1 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyglm
  Building wheel for pyglm (pyproject.toml) ... error
  error: subprocess-exited-with-error

  ? Building wheel for pyglm (pyproject.toml) did not run successfully.
  │ exit code: 1
  ?─> [22 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win32-cpython-37
      creating build\lib.win32-cpython-37\glm-stubs
      copying glm-stubs\glm_typing.py -> build\lib.win32-cpython-37\glm-stubs
      copying glm-stubs\__init__.py -> build\lib.win32-cpython-37\glm-stubs
      running egg_info
      writing PyGLM.egg-info\PKG-INFO
      writing dependency_links to PyGLM.egg-info\dependency_links.txt
      writing top-level names to PyGLM.egg-info\top_level.txt
      reading manifest file 'PyGLM.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      adding license file 'license.h'
      adding license file 'COPYING'
      writing manifest file 'PyGLM.egg-info\SOURCES.txt'
      copying glm-stubs\__init__.pyi -> build\lib.win32-cpython-37\glm-stubs
      running build_ext
      building 'glm' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Micr
osoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tool
s/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem wit
h pip.
  ERROR: Failed building wheel for pyglm
Failed to build pyglm
ERROR: Could not build wheels for pyglm, which is required to install pyproject.
toml-based projects
Zuzu-Typ commented 2 months ago

Hi @8Observer8,

Python 3.7 and Windows 7 (especially 32 bit) have been out of date for quite a while, thus there are no prebuilt wheels available. PyGLM should run on the system regardless, but you need to build it yourself. Since PyGLM is a Python C-API extension that was written in C++, you need a C++ compiler. Simply download and install the Microsoft visual C++ build tools, as instructed in the error message you got. That should allow you to build PyGLM

Cheers --Zuzu_Typ--

8Observer8 commented 2 months ago

Is it possible to build PyGLM using MinGW?

8Observer8 commented 2 months ago

I have installed MinGW from this link: https://winlibs.com/ I use GCC 11.2.0 I asked the question above to Gimini. I have copied the answer: https://g.co/gemini/share/7d8644c944c2

Yes, it is possible to build PyGLM using MinGW. MinGW is a compiler suite for Windows that provides a UNIX-like environment, and PyGLM is a Python library that provides OpenGL Mathematics functionality.

Here are the general steps involved in building PyGLM using MinGW:

  1. Install MinGW: Download and install the MinGW compiler suite from https://sourceforge.net/projects/mingw-w64/. Make sure to include the required components, such as the C++ compiler and the header files.

  2. Install Python: Download and install a Python interpreter from https://www.python.org/. Ensure you have the correct version for your MinGW installation.

  3. Install NumPy: NumPy is a fundamental package for scientific computing with Python. Install it using pip:

    pip install numpy
  4. Obtain PyGLM: Download the PyGLM source code from [invalid URL removed].

  5. Build PyGLM:

  1. Install PyGLM:
  1. Test PyGLM:

Note: These are general steps, and the specific commands and procedures may vary depending on your MinGW and Python versions. Refer to the PyGLM documentation and MinGW documentation for more detailed instructions.

Zuzu-Typ commented 2 months ago

It should be possible to build PyGLM with MinGW. You need to tell Python you want to use mingw though. By default, it is trying to use the Microsoft Visual C++ compiler. I don't know how you can change that, but I'm sure you'll find a way. Alternatively, simply use MSVC. Saves you the hassle.