0

I'm using Ubuntu 16.04 and just need a downloaded simple encryption script in python to run.

I installed pyCharm to run the scripts but its giving unresolved reference errors at gmpy2

The script is using gmpy2 which I installed using the command: sudo apt-get install python-gmpy2.

And apparently it worked as the following command managed to search for it:

 pip search gmpy2
gmpy2 (2.0.8)  - GMP/MPIR, MPFR, and MPC interface to Python 2.6+ and 3.x
  INSTALLED: 2.0.7
  LATEST:    2.0.8

But in PyCharm, this line is unable to locate it:

from gmpy2 import mpz, powmod, invert, is_prime, random_state, mpz_urandomb, rint_round, log2, gcd 

giving error: unresolved reference `gmpy2`

Cœur
  • 37,241
  • 25
  • 195
  • 267
StuckInPhDNoMore
  • 2,507
  • 4
  • 41
  • 73
  • Did you configure your Python interpreter in PyCharm? I suspect you have multiple python environments installed on your system and Pycharm is not using the one you want. – Joucks May 03 '18 at 12:06

1 Answers1

2

It's possible that you've configured PyCharm to use a custom Python environment for your script. Check you project settings (File - Settings - Project - Project Interpreter) and see if gmpy2 is listed in the installed packages. If not, you can add it to your project's environment on the same page or change to a default interpreter in /usr/bin

The
  • 246
  • 1
  • 4