我所拥有的
删除try/ get块后,将得到以下错误:
Traceback (most recent call last):
File "/tmp/aerospike.py", line 4, in <module>
import aerospike
File "/tmp/aerospike.py", line 12, in <module>
client = aerospike.client(config).connect()
AttributeError: 'module' object has no attribute 'client'我没有看到连接器的源代码(使用了cpython?)也不知道从现在起该往哪里走。
pip3 list
Package Version
---------------------- --------
aerospike 3.5.0
asn1crypto 0.24.0
atomicwrites 1.2.1
attrs 18.2.0
cassandra-driver 3.15.1
cffi 1.11.5
cryptography 2.3.1
diff-match-patch 20121119
Django 2.0.9
django-chunked-upload 1.1.3
django-compat 1.0.15
django-crispy-forms 1.7.2
django-datatable-view 0.9.0
django-datatables-view 1.17.0
django-hijack 2.1.10
django-import-export 1.1.0
django-queryset-csv 1.0.1
django-simple-menu 1.2.1
django-tables2 2.0.2
django-tracking2 0.4.1
et-xmlfile 1.0.1
future 0.17.1
GeoIP 1.3.2
idna 2.7
importlib-metadata 0.6
jdcal 1.4
more-itertools 4.3.0
mysqlclient 1.3.13
odfpy 1.3.6
openpyxl 2.5.9
path.py 11.5.0
pathlib2 2.3.2
pidfile 0.1.1
pika 0.12.0
pip 18.1
pluggy 0.8.0
py 1.7.0
pycall 2.3.2
pycparser 2.19
PyMySQL 0.9.2
pytest 4.0.1
python-dateutil 2.7.5
python-http-client 3.1.0
pytz 2018.7
PyYAML 3.13
scandir 1.9.0
sendgrid 5.6.0
setuptools 19.6.2
six 1.11.0
tablib 0.12.1
unicodecsv 0.14.1
xlrd 1.1.0
xlwt 1.3.0 发布于 2018-11-27 05:28:00
您有一个名称空间冲突。Aerospike客户端模块称为aerospike。您的本地脚本名为aerospike.py。导入工作的方式是Python首先在本地查找,然后在像pip这样的repos中查找。在本地,它会看到您的脚本,并尝试再次加载它。
尝试将脚本重命名为aerospike-test.py
https://stackoverflow.com/questions/53481553
复制相似问题