Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no relative import in when run as a script #497

Closed
wants to merge 2 commits into from

Conversation

cliffxuan
Copy link
Contributor

original throws an exception

Traceback (most recent call last):
  File "plugins/sparql/algebra.py", line 787, in <module>
    from . import parser
ValueError: Attempted relative import in non-package

@joernhees
Copy link
Member

could you provide a minimal example of what you're trying to do?

@cliffxuan
Copy link
Contributor Author

just to run the script does not work currently because of the relative import

python plugins/sparql/algebra.py "select * where {?s ?p ?o}"

@joernhees
Copy link
Member

well, you can actually run it like this (this is a standard relative imports & path issue):

python -m plugins.sparql.algebra "select * where {?s ?p ?o}"

I agree that we could improve the usability of that as in 9d1318c .

5a895ff seems to be unrelated to me.

@joernhees joernhees added enhancement New feature or request SPARQL parsing Related to a parsing. labels Jul 20, 2015
@joernhees joernhees added this to the rdflib 4.2.1 milestone Jul 20, 2015
@joernhees joernhees self-assigned this Jul 20, 2015
@joernhees
Copy link
Member

@cliffxuan ok, i pulled 9d1318c into master, i'm closing and will make a new Pull Request for 5a895ff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parsing Related to a parsing. SPARQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants