How to install gmpy2 on PyCharm Windows 10

Sumedha Gn
2 min readAug 3, 2021

--

This assumes that you have Visual Studio installed. If you have not done so, install Visual Studio (Community).

This approach should resolve errors such as:

  1. Error 1, visual code c++ required
  2. Error: command ‘.\\cl.exe’ failed with exit status 2

Step-by-step Solution:

  1. Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/
  2. Ctrl + F for “GMPY

3. Download the required gmpy2 wheel based on the python version you have installed. For example, if you are using python 3.9 with 64-bit processor, download gmpy2‑2.0.8‑cp39‑cp39‑win_amd64.whl.

4. Next, on your terminal, run:

pip install C:\path\to\gmpy2‑2.0.8‑cp39‑cp39‑win_amd64.whl

or

pip3 install C:\path\to\gmpy2‑2.0.8‑cp39‑cp39‑win_amd64.whl

  • For example, if your gmpy2 wheel file is in C:\Downloads, run: pip install C:\Downloads\gmpy2‑2.0.8‑cp39‑cp39‑win_amd64.whl

5. On successfully installation, you should be able to see this:

Successful gmpy2 installation

6. Go to the project folder you are working on and place the processed gmpy2‑2.0.8‑cp39‑cp39‑win_amd64.pyd into Lib folder > site-packages.

7. Restart your workbench

Hope this helps!

--

--

Sumedha Gn

Documenting errors I’ve faced so you can save time trying to resolve them, feel free to let me know how I can improve too!