How to install gmpy2 on PyCharm Windows 10
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:
- Error 1, visual code c++ required
- Error: command ‘.\\cl.exe’ failed with exit status 2
Step-by-step Solution:
- Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/
- 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:
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!