Comments (8)
@victoriastuart I believe this PR #60 should correct that issue (it uses io
to safely handle the file opening for python 2 and 3).
from cycli.
Hmm what OS are you on?
from cycli.
Hi Nicole,
I have enjoyed the cypher side of Cycli
However, I am experiencing exactly the same problem as above but with both -f and --filename flags
Can't get cypher queries processed from a file
My OS is Ubuntu 5.4.0-6ubuntu1~16.04.5
TypeError: a bytes-like object is required, not 'str'
THank you for your help
from cycli.
What version of Python are you on?
from cycli.
Python 3.6.0 :: Anaconda 4.3.0 (64-bit)
from cycli.
Arch Linux x86_64; Python 2.7; Python 3.5; Cycli 0.7.6
I also just encountered this issue with Cycli v.0.7.6 (pip install ...) operating in a Python 3.5 venv.
`TypeError: a bytes-like object is required, not 'str'`
(py35) [victoria@victoria ~]$ cycli -P 7474 -u victoria -p <my_password> -f glycolysis2.cypher
Traceback (most recent call last):
File "/home/victoria/anaconda2/envs/py35/bin/cycli", line 11, in <module>
sys.exit(run())
File "/home/victoria/anaconda2/envs/py35/lib/python3.5/site-packages/click/core.py", line 664, in __call__
return self.main(*args, **kwargs)
File "/home/victoria/anaconda2/envs/py35/lib/python3.5/site-packages/click/core.py", line 644, in main
rv = self.invoke(ctx)
File "/home/victoria/anaconda2/envs/py35/lib/python3.5/site-packages/click/core.py", line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/victoria/anaconda2/envs/py35/lib/python3.5/site-packages/click/core.py", line 464, in invoke
return callback(*args, **kwargs)
File "/home/victoria/anaconda2/envs/py35/lib/python3.5/site-packages/cycli/main.py", line 284, in run
cycli.run()
File "/home/victoria/anaconda2/envs/py35/lib/python3.5/site-packages/cycli/main.py", line 72, in run
queries = queries.split(";")[:-1]
TypeError: a bytes-like object is required, not 'str'
(py35) [victoria@victoria ~]$
from cycli.
@nicolewhite, @danodonovan: this is great, thank you!!
For referencing this issue, here is how I updated my Cycli install (git clone this repo | make | make install | pip uninstall / install cycli | test execute cypher file):
[victoria@victoria apps]$ pwd
/mnt/Vancouver/apps
[victoria@victoria apps]$ git clone https://github.com/nicolewhite/cycli
[victoria@victoria apps]$ cd cycli
## Update repo, after Nicole's 2018-04-05 merge commit
## https://github.com/nicolewhite/cycli/pull/60
[victoria@victoria cycli]$ git pull
...
[victoria@victoria cycli]$ p3
[Anaconda Python 3.5 venv (source activate py35)]
[victoria@victoria cycli]$ p3
[Anaconda Python 3.5 venv (source activate py35)]
(py35) [victoria@victoria cycli]$ pwd
/mnt/Vancouver/apps/cycli
(py35) [victoria@victoria cycli]$ pip uninstall cycli
Uninstalling cycli-0.7.6:
...
(py35) [victoria@victoria cycli]$ make
...
(py35) [victoria@victoria cycli]$ py.test tests
...
================= 82 passed in 0.33 seconds ================================
(py35) [victoria@victoria cycli]$ make clean
rm -rf build dist cycli.egg-info
(py35) [victoria@victoria cycli]$ pip install cycli
...
(py35) [victoria@victoria cycli]$ cycli -P 7474 -u victoria -p <password_obfuscated_here>
______ __ __ ______ __ __
/\ ___\ /\ \_\ \ /\ ___\ /\ \ /\ \
\ \ \____ \ \____ \ \ \ \____ \ \ \____ \ \ \
\ \_____\ \/\_____\ \ \_____\ \ \_____\ \ \_\
\/_____/ \/_____/ \/_____/ \/_____/ \/_/
Cycli version: 0.7.6
Neo4j version: 3.3.4
Bug reports: https://github.com/nicolewhite/cycli/issues
> quit
Goodbye!
(py35) [victoria@victoria cycli]$ cycli -P 7474 -u victoria -p <password_obfuscated_here> -f /mnt/Vancouver/Programming/data/metabolism/glycolysis.cypher
> LOAD CSV WITH HEADERS FROM "file:/mnt/Vancouver/Programming/data/metabolism/pg2neo4j/glycolysis_bioentities.csv" AS row
MERGE (n:Glycolysis {name:row.name})
// RETURN n, labels(n), n.name;
270 ms
...
(py35) [victoria@victoria cycli]$
from cycli.
Hi there, I'm still having the same issue under windows with neo4j 3.5.5. did neither work with -f nor with --filename. i was trying to open a cyp file
Also btw needed to change/add an encoding after this error occured to get the program to work at all: SyntaxError: Non-UTF-8 code starting with '\xfc' in file cycli-script.py (after entering "cycli -u ")
great program tho! thx
from cycli.
Related Issues (20)
- Highlight cycli-specific keywords with their own color
- Autocomplete is wrong when drawing a pattern inside the SIZE function
- A collection of integers is converted to a list of strings bc of pretty_table
- Can't pip install cycli on python 2.7 HOT 1
- Properties are not autocompleted inside functions
- Trying to run periodic commit results in an error HOT 2
- [SEV 1] My coffee is cold and the microwave smells weird [SEV 1]
- Can connect and autosuggest node labels, but can't fire query HOT 2
- ASCII can't decode error with UTF-8 data in Neo4j HOT 3
- control-d does not exit
- Semicolon in quoted property seems to be incorrectly interpreted as end of cypher statement HOT 7
- Not able to connect with database with non-standard bolt port and TLS HOT 3
- connecting to graphenedb
- Exceptions when using cycli with no authorization required HOT 1
- Feature request: turn off echo HOT 1
- Cypher interpretation of commented lines ending in semicolons
- Bump pypi version
- Support Offer
- do not pin packages in setup.py
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cycli.