I have a smoothly running python project where I use the line
from py2neo import Node, Relationship, Graph, authenticate, cypher
However, when I moved the files to another machine and tried to run them there, it turned out that 'authenticate' couldn't be imported. And indeed, it doesn't show up under dir(py2neo) in terminal mode.
Python 2.7.13 on both machines. How can that be possible?
From https://github.com/neo4j-contrib/neo4j_doc_manager/issues/76#issuecomment-446290239
You could try:
graph = Graph(host=HOST, auth=(USER, PASS))
and remove authenticate from import line
Related
Error that I'm struggling with
I'm trying to use MarsExplorer (https://github.com/dimikout3/MarsExplorer) in google colab, but I'm struggling with properly importing it. I was able to successfully clone the repo, but when I try to run the demo mars_explorer isn't imported. How can I fix this?
Indeed #Dr.Snoopy makes a great point here. This is the line in test.py where it is expected to work:
from mars_explorer.envs.settings import DEFAULT_CONFIG as conf
Now, notice that this is being called from your runtime path, usually root in Colab's case (I suppose), then it should return an error.
Now, if installed, for instance with pip install -e you can both import the module and edit it as you go.
Check out these docs.-,6.1.2.%20The%20Module%20Search%20Path,-%C2%B6), they may be helpful to understand this error.
apply these two commands in colab cell:
!git clone https://github.com/dimikout3/GeneralExplorationPolicy.git
the above command will save GeneralExplorationPolicy folders in your colab and inside this folder you can find mars-explorer folder then make copy of the path of the mars-explorer folder for example. /content/GeneralExplorationPolicy/mars-explorer
then apply this command for install mars-explorer:
!pip install -e /content/GeneralExplorationPolicy/mars-explorer
I have been using a google colab template for iterative LQR that uses the Pydrake, however, it seems like the code repository is removed and I can't reinstall it on google Colab:
try:
import pydrake
import underactuated
except ImportError:
!curl -s https://raw.githubusercontent.com/RussTedrake/underactuated/master/scripts/setup/jupyter_setup.py > jupyter_setup.py
from jupyter_setup import setup_underactuated
setup_underactuated()
# Setup matplotlib backend (to notebook, if possible, or inline).
from underactuated.jupyter import setup_matplotlib_backend
plt_is_interactive = setup_matplotlib_backend()
File "/content/jupyter_setup.py", line 1
404: Not Found
^
SyntaxError: invalid syntax
I tried clicking this link https://raw.githubusercontent.com/RussTedrake/underactuated/master/scripts/setup/jupyter_setup.py, and the page is not found... everything was working fine yesterday
Sorry. You're correct... I updated it this morning, and don't have a good deprecation policy in place on that repo, and this setup script is two versions ago. The path you want is https://raw.githubusercontent.com/RussTedrake/underactuated/master/setup/jupyter_setup.py
(remove the script from the directory). But if you look at that file, you'll see that even that is pointing to an updated setup script which you might want to point to.
This is actually all good news... we are on the path to a much better solution. You can now just pip install drake on colab (see the drake installation guide). Once I land the pip install underactuated (probably in time for my Spring offering of the class), then all of that nasty setup will be gone.
I have a fresh install of RHEL 8.4 running neo4j 3.5.28, and when I attempt to run neo4j-admin load --from=<file> I get the following error:
Unsupported OS/arch, cannot find /linux/amd64/libzstd-jni.so or load zstd-jni from system libraries. Please try building from source the jar or providing libzstd-jni in you system.
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at com.github.luben.zstd.util.Native.load(Native.java:108)
at com.github.luben.zstd.util.Native.load(Native.java:60)
at com.github.luben.zstd.ZstdInputStream.<clinit>(ZstdInputStream.java:21)
at org.neo4j.dbms.archive.CompressionFormat$2.decompress(CompressionFormat.java:68)
at org.neo4j.dbms.archive.Loader.openArchiveIn(Loader.java:151)
at org.neo4j.dbms.archive.Loader.load(Loader.java:67)
at org.neo4j.commandline.dbms.LoadCommand.load(LoadCommand.java:134)
at org.neo4j.commandline.dbms.LoadCommand.execute(LoadCommand.java:87)
at org.neo4j.commandline.admin.AdminTool.execute(AdminTool.java:127)
at org.neo4j.commandline.admin.AdminTool.main(AdminTool.java:51)
I've been able to replicate this across multiple fresh servers, but not on centos 8 oddly. Any help would be appreciated.
Turns out our admin had the /var/tmp and /tmp directories set to have the noexec flag. Removing this flag allowed the import to work without a problem.
I have created a graph database within Neo4j Desktop (version 1.1.10) I wish to export that as a Cypher file.
How do I do that? I can't see any command within the app for export a Cypher file.
You can try following the documentation here: Neo4j - Export a (sub)graph to Cypher script and import it again
First, install the apoc procedure library, and add it into the plugins directory.
Second, run Neo4j as an administrator. If not, Neo4j doesn't have permission to write files.
Before starting Neo4j, edit the neo4j.conf file and add this line:
apoc.export.file.enabled=true
Then, start Neo4j, and in the Neo4j browser, execute the following command:
CALL apoc.export.cypher.all("export.cypher",{})
This will store the whole database in the file "export.cypher".
I'm trying to add a node to my base, but every time I restart the server, the node disappears along with their relationships.
I started my base by importing a CSV using the ./neo4j-import script in the bin folder. The node in question is a node that connects to all subgraphs of my base (like a root node), turning the base into a connected graph.
I already added through the shell (./neo4j-shell) through the web application and using python (using from neo4j.v1 driver import GraphDatabase), in all cases when I restart the server, the node disappears.
The command I am using in all approaches is this:
neo4j-sh (?)$ create(r:PDB{name: 'root', resolution: 'less than 2.0', method: 'x-ray diffraction'});
neo4j-sh (?)$ match(r:PDB{name:'root'}) match(p:PDB_FILE) merge(r)-[:HAS_PDB]->(p);
In the latest attempt used differently (using commit):
neo4j-sh (?)$ begin
neo4j-sh (?)$ create(r:PDB{name: 'root', resolution: 'less than 2.0', method: 'x-ray diffraction'});
neo4j-sh (?)$ match(r:PDB{name:'root'}) match(p:PDB_FILE) merge(r)-[:HAS_PDB]->(p);
neo4j-sh (?)$ commit
But without success.
I'm using version 3.0. * of Neo4j, Cypher 3.0, Ubuntu 4.14 server.
I have no idea on why this is happening to you, but what I would definitely try is using the super batch importer for huge datasets: neo4j-import. There is some instruction on how to use the tool in neo4j documentation.
To use the tool you have to put your data in special formats, individual csv files each corresponding to a type of node or a type of edge in your dataset. It is well explained in the given link, and, even though it does not explain why this is happening to you, it is surely worth a try.
Another things that you could try are:
to install neo4j in another machine. Maybe there is some weird problem with your installation/your system;
try another version of neo4j. I'm not totally aware, but I imagine the latter 2.X.X versions should be more stable than the newer ones, as Neo4j v3 has been release recently. It is easy to install any version using this debian repositories (via apt-get in Ubuntu).