Error when i try to OpenRAM, AttributeErrir: 'NoneType' object has no attribute 'startswith' - python-2.7

I get the error. how should i fix it?
ERROR: runTest (30_openram_test.openram_test)
Traceback (most recent call last): File "/home/leepil/OpenRAM-master/compiler/tests/30_openram_test.py", line 23, in runTest
globals.init_openram("config_20_{0}".format(OPTS.tech_name))
enter code here
File "/home/leepil/OpenRAM-master/compiler/tests/../globals.py", line 113, in init_openram
import_tech()
File "/home/leepil/OpenRAM-master/compiler/tests/../globals.py", line 314, in import_tech
__import__(filename)
File "/home/leepil/OpenRAM-master/technology/setup_scripts/setup_openram_freepdk45.py", line 16, in <module>
PDK_DIR=os.path.abspath(os.environ.get("FREEPDK45"))
File "/home/leepil/PycellStudio3/plat_linux_gcc44x_64/3rd/lib/python2.7/posixpath.py", line 367, in abspath
if not isabs(path):
File "/home/leepil/PycellStudio3/plat_linux_gcc44x_64/3rd/lib/python2.7/posixpath.py", line 61, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
For info, I am on OpenRAM-Master (Tech is freepdk45) & Python version 2.7.9.
See the detail error message below. Thx!

Related

NEOS solver bonmin

did anyone know why this error happen? other solver such as cbc works fine but when sent to NEOS, I got the following error in command line
Traceback (most recent call last):
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 409, in
process_data(df, df)
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 191, in process_data
pyomo_tool(df,road_year, pit_year, road_estimated_cost, pit_estimated_cost, road_tot_budget, pit_tot_budget,
File "C:\repos\work_packager\Test\Scratch\Networkx_Sample\testss.py", line 291, in pyomo_tool
solver.solve(model)
File "C:\Python31\lib\site-packages\pyomo\opt\results\container.py", line 284, in getattr
raise AttributeError("Unknown attribute "+str(name)+"' for object with type "+str(type(self))) AttributeError: Unknown attribute solve' for object with type <class 'pyomo.opt.results.results_.SolverResults'>

scipy.test() results in errors

Having some problems with scipy. Installed latest version using pip (0.17.0). Run scipy.test() and I'm getting the following errors. Are they okay to ignore? I'm using python 2.7.6.
Thanks for your help.
======================================================================
ERROR: test_add_function_ordered (test_catalog.TestCatalog)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/tests/test_catalog.py", line 477, in test_add_function_ordered
q.add_function('f',string.upper)
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 833, in add_function
self.add_function_persistent(code,function)
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 849, in add_function_persistent
cat = get_catalog(cat_dir,mode)
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 486, in get_catalog
sh = shelve.open(catalog_file,mode)
File "/usr/lib/python2.7/shelve.py", line 239, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/usr/lib/python2.7/shelve.py", line 222, in init
import anydbm
File "/usr/lib/python2.7/anydbm.py", line 50, in
_errors.append(_mod.error)
AttributeError: 'module' object has no attribute 'error'
======================================================================
ERROR: test_add_function_persistent1 (test_catalog.TestCatalog)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/tests/test_catalog.py", line 466, in test_add_function_persistent1
q.add_function_persistent('code',i)
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 849, in add_function_persistent
cat = get_catalog(cat_dir,mode)
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 486, in get_catalog
sh = shelve.open(catalog_file,mode)
File "/usr/lib/python2.7/shelve.py", line 239, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/usr/lib/python2.7/shelve.py", line 222, in init
import anydbm
File "/usr/lib/python2.7/anydbm.py", line 50, in
_errors.append(_mod.error)
AttributeError: 'module' object has no attribute 'error'
======================================================================
ERROR: test_get_existing_files2 (test_catalog.TestCatalog)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/tests/test_catalog.py", line 394, in test_get_existing_files2
q.add_function('code', os.getpid)
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 833, in add_function
self.add_function_persistent(code,function)
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 849, in add_function_persistent
cat = get_catalog(cat_dir,mode)
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 486, in get_catalog
sh = shelve.open(catalog_file,mode)
File "/usr/lib/python2.7/shelve.py", line 239, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/usr/lib/python2.7/shelve.py", line 222, in init
import anydbm
File "/usr/lib/python2.7/anydbm.py", line 50, in
_errors.append(_mod.error)
AttributeError: 'module' object has no attribute 'error'
======================================================================
ERROR: test_create_catalog (test_catalog.TestGetCatalog)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/tests/test_catalog.py", line 286, in test_create_catalog
cat = catalog.get_catalog(pardir,'c')
File "/usr/local/lib/python2.7/dist-packages/scipy/weave/catalog.py", line 486, in get_catalog
sh = shelve.open(catalog_file,mode)
File "/usr/lib/python2.7/shelve.py", line 239, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/usr/lib/python2.7/shelve.py", line 222, in init
import anydbm
File "/usr/lib/python2.7/anydbm.py", line 50, in
_errors.append(_mod.error)
AttributeError: 'module' object has no attribute 'error'
Ran 20343 tests in 138.416s
FAILED (KNOWNFAIL=98, SKIP=1679, errors=4)
All these are in weave, which is not used anywhere else in scipy itself. So unless you're using weave directly, you're likely OK. And there is likely no reason to use weave in new code anyway.

Use Apportable to port ios app to android app: AttributeError: 'NoneType' object has no attribute 'startswith'

I stuck in this error
AttributeError: 'NoneType' object has no attribute 'startswith'
when try "apportable load"
Who can help me?
Here is detail log in terminal:
raceback (most recent call last):
File "/Users/ducnm/.apportable/SDK/bin/apportable", line 845, in <module>
run(env)
File "/Users/ducnm/.apportable/SDK/bin/apportable", line 781, in run
results = actions[args.action](env)
File "/Users/ducnm/.apportable/SDK/bin/apportable", line 86, in LoadAction
return env.LoadApp(site_init.BuildApplication(env, env['BUILD_TARGET']))
File "/Users/ducnm/.apportable/SDK/site_scons/site_init.py", line 390, in BuildApplication
return build.App(env, app_sconscript)
File "/Users/ducnm/.apportable/SDK/site_scons/build/__init__.py", line 556, in App
results = env.BuildApp(sources=sources, header_paths=headers, defines=defines, flags=flags, config=configs, deps=deps, libs=libs, java_libs=java_libs, assets=assets, pch=pchs, modules=modules, java_sources=java_sources, java_sourcepaths=java_sourcepaths, java_res_dirs=java_res_dirs)
File "/Users/ducnm/.apportable/SDK/lib/scons/engine/SCons/Environment.py", line 223, in __call__
return self.method(*nargs, **kwargs)
File "/Users/ducnm/.apportable/SDK/site_scons/site_init.py", line 1204, in BuildApp
build.Module(env, module["build_cwd"], module)
File "/Users/ducnm/.apportable/SDK/site_scons/build/__init__.py", line 577, in Module
target_file_name_base = os.path.abspath(os.path.join(target["project"] + ".approj", "targets", target["target"], target["project_config"]))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 66, in join
if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'
AttributeError: 'NoneType' object usually indicates a missing symbol to the linker. Look higher up in the log for missing symbols.
Background: apportable load does a parallel build which leads to more logging after the fatal error. The parallel build can be disabled with the option -j1.

Scrapy cannot handle bad headers properly [ScrapyHTTPPageGetter,client] Unhandled Error

Environment:
Scrapy 0.16.2
Twisted-12.2.0
python 2.7
macosx-10.6
Okey here is my problem:
I try to run
scrapy shell http://aaa.17domn.com/bt9/file.php/MERH77V.html
Error:
[ScrapyHTTPPageGetter,client] Unhandled Error
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/internet/selectreactor.py", line 150, in _doReadOrWrite
why = getattr(selectable, method)()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/internet/tcp.py", line 202, in doRead
return self._dataReceived(data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/internet/tcp.py", line 208, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/protocols/basic.py", line 564, in dataReceived
why = self.lineReceived(line)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Scrapy-0.16.2-py2.7.egg/scrapy/core/downloader/webclient.py", line 50, in lineReceived
return HTTPClient.lineReceived(self, line.rstrip())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/web/http.py", line 450, in lineReceived
self.extractHeader(self._header)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/web/http.py", line 406, in extractHeader
key, val = header.split(':',1)
exceptions.ValueError: need more than 1 value to unpack
I found the solution from https://groups.google.com/forum/#!msg/scrapy-users/xFKo8ggzPxs/VXDl3CZ4V4cJ
They describe this is caused by twisted. Then I patched function extractHeader in /twisted/web/http.py from http://twistedmatrix.com/trac/ticket/2842. Its WORKS
BUT BUT, Hold on NOt yet!!!
I run another web
scrapy shell http://www1.wkdown.info/fs3/file.php/M994ATR.html
Error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-macosx-10.6-intel.egg/twisted/internet/defer.py", line 551, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Scrapy-0.16.2-py2.7.egg/scrapy/core/downloader/webclient.py", line 122, in _build_response
status = int(self.status)
ValueError: invalid literal for int() with base 10: 'html'
I think something happen on response headers. Scrapy cannot handle it well.
Any idea?
Thank you!

Problem with creating an object in neo4j

I am using the django integration for neo4j and I'm getting the following traceback when I'm trying to create a node.
I do have JPype installed and it can be imported.
p = Person.objects.create(first_name='omer', last_name='katz')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 138, in create
return self.get_query_set().create(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/model/django_model/__init__.py", line 362, in create
obj.save(force_insert=True)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_util.py", line 47, in __get__
method, graphdb = self.descr_get(obj, cls)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_util.py", line 41, in descr_get
graphdb = self.accessor.__get__(obj, cls)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/model/django_model/__init__.py", line 58, in __get__
return DjangoNeo.neo
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/model/django_model/__init__.py", line 124, in neo
return self.__setup_neo()
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/model/django_model/__init__.py", line 136, in __setup_neo
self.__neo = NeoService(resource_uri, **options)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/__init__.py", line 522, in __new__
neo = core.load_neo(resource_uri, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_core.py", line 180, in load_neo
backend.initialize(**parameters)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 61, in initialize
raise ImportError("No applicable backend found.")
ImportError: No applicable backend found.
EDIT:
As requested here are my neo4j settings:
NEO4J_RESOURCE_URI = '/var/neo4j/neo4django'
# NEO4J_RESOURCE_URI should be the path to where
# you want to store the Neo4j database.
NEO4J_OPTIONS = {
# this is optional and can be used to specify
# extra startup parameters for Neo4j, such as
# the classpath to load Neo4j from.
}
EDIT:
After following thobe's suggestion I get the following when I try to import my own models:
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
FERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ile "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
ERROR:root:Importing native backends failed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/__init__.py", line 51, in initialize
embedded, remote = implementation.initialize(classpath, params)
File "/usr/local/lib/python2.7/dist-packages/Neo4j.py-0.1_SNAPSHOT-py2.7.egg/neo4j/_backend/reflection.py", line 44, in initialize
jvm = jpype.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/local/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
You can get more verbose information about why the backend couldn't be found by adding this to NEO4J_OPTIONS:
NEO4J_OPTIONS = {
log: True,
}
The output from that logging will make it easier to diagnose the actual issue and suggest a fix.
your settings.py looks ok..
Do you have java SDK installed and JAVA_HOME environment variable set to your JDK? (java JRE is not enough)
From Neo4j.py docs:
In some situations the JPype
compilation process might not link
with the appropriate JNI headers,
resulting in compilation errors. The
first thing to note is that JPype
needs the JNI headers from a JDK in
order to build, it is not enough to
only have a JRE installed when
building JPype. If the JAVA_HOME
environment variable is not set when
building JPype the build script
(setup.py) of JPype might have
problems locating the appropriate JNI
headers. If you are building JPype
with sudo python setup.py install you
might not inherit the JAVA_HOME
environment variable into the sudo
environment, an easy warkaround is to
run python setup.py bdist before
install.
I ran into the same problem. No matter what I did (on Debian) Python couldn't find the JAVA_HOME environmental variable. The easiest way to fix it, which I presume you can just add this somewhere in Django, is to add these lines -
java_home = os.getenv("JAVA_HOME")
if(java_home == None):
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-6-openjdk"
where the path is the location of the JDK you want to use (it should have folder /bin after it with java and javac programs)
What I also tried was add the location to /etc/bash.bashrc. Which didn't work for me but might for you.
JAVA_HOME=/usr/lib/jvm/java-6-openjdk
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
Anyway, that should get you started in the right direction. But now I have another related problem I'm stuck on with no answer for a week now :(