我正在使用Ubuntu 16.04,只需要在python中下载简单的加密脚本即可运行。
我安装了pyCharm来运行脚本,但它在gmpy2上给出了未解决的引用错误
脚本正在使用我使用命令 <groupId>com.datastax.dse</groupId>
<artifactId>dse-java-driver-core</artifactId>
安装的gmpy2。
显然它按照以下命令设法搜索它:
sudo apt-get install python-gmpy2
但是在PyCharm中,这条线无法找到它:
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
给出错误:from gmpy2 import mpz, powmod, invert, is_prime, random_state, mpz_urandomb, rint_round, log2, gcd
答案 0 :(得分:2)
您可能已将PyCharm配置为为脚本使用自定义Python环境。检查项目设置(文件 - 设置 - 项目 - 项目解释程序),查看已安装的软件包中是否列出了gmpy2。如果没有,您可以在同一页面上将其添加到项目的环境中,或者更改为/ usr / bin中的默认解释器