怎样才能让Cassandra-driver进入PYTHONPATH?

时间:2015-01-26 07:20:53

标签: macos bash cassandra pythonpath datomic

我正在尝试使用Datomic设置Cassandra,当我运行命令cqlsh -f ~/datomic/bin/cql/cassandra-user.cql -u uname -p pword时,我收到错误消息

Python: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Module load path: [
'/usr/local/Cellar/cassandra/2.1.2/bin', 
'/Library/Python/2.7/site-packages/cql-1.4.0-py2.7.egg', 
'/Library/Python/2.7/site-packages/thrift-0.9.2-py2.7-macosx-10.10-intel.egg',
'/Library/Python/2.7/site-packages/ccm-2.0.2-py2.7.egg',
'/Library/Python/2.7/site-packages/tailer-0.3-py2.7.egg', 
'/Library/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/psutil-2.2.0-py2.7-macosx-10.10-intel.egg', 
'/Library/Python/2.7/site-packages/pip-6.0.6-py2.7.egg', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', 
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', 
'/Library/Python/2.7/site-packages']

Error: No module named cassandra

我已经使用pip install cassandra-driver使用export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages尝试将驱动程序所在的路径放在我的PYTHONPATH上来安装驱动程序。我甚至将驱动程序复制到我路径中已列出的目录之一。没运气。有人可以帮助我克服这个障碍吗?

Cassandra安装了自制软件/usr/local/Cellar/cassandra/2.1.2/

Datomic在这里 ~/datomic

cassandra-driver在这里 /usr/local/lib/python2.7/site-packages

1 个答案:

答案 0 :(得分:2)

看起来你正在尝试使用mac系统python发行版,是吗?虽然没有错,但建议单独保留系统分发并使用brew install python安装单独的python。然后尝试使用pip install cql安装cqlsh,同时确保使用brew pip版本(使用which pip检查 - >应指向/ usr / local)。