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

Could not parse rfc1738 URL from string #2

Open
foocp opened this issue Feb 14, 2018 · 6 comments
Open

Could not parse rfc1738 URL from string #2

foocp opened this issue Feb 14, 2018 · 6 comments

Comments

@foocp
Copy link

foocp commented Feb 14, 2018

I have all the requirements, running python3.5.3 in virtualenvwrapper, on the most recent Raspbian Stretch (Jan2018), but I always get this. Any hints?

Traceback (most recent call last):
  File "scraper.py", line 8, in <module>
    db = dataset.connect(settings.CONNECTION_STRING)
  File "/home/pi/.virtualenvs/testtwitter_scrape/lib/python3.5/site-packages/dataset/__init__.py", line 41, in connect
    ensure_schema=ensure_schema, row_type=row_type)
  File "/home/pi/.virtualenvs/testtwitter_scrape/lib/python3.5/site-packages/dataset/database.py", line 53, in __init__
    self.engine = create_engine(url, **engine_kwargs)
  File "/home/pi/.virtualenvs/testtwitter_scrape/lib/python3.5/site-packages/sqlalchemy/engine/__init__.py", line 419, in create_engine
    return strategy.create(*args, **kwargs)
  File "/home/pi/.virtualenvs/testtwitter_scrape/lib/python3.5/site-packages/sqlalchemy/engine/strategies.py", line 50, in create
    u = url.make_url(name_or_url)
  File "/home/pi/.virtualenvs/testtwitter_scrape/lib/python3.5/site-packages/sqlalchemy/engine/url.py", line 205, in make_url
    return _parse_rfc1738_args(name_or_url)
  File "/home/pi/.virtualenvs/testtwitter_scrape/lib/python3.5/site-packages/sqlalchemy/engine/url.py", line 254, in _parse_rfc1738_args
    "Could not parse rfc1738 URL from string '%s'" % name)
sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string ''
@elilienstein
Copy link

elilienstein commented Feb 14, 2018

I had a similar error and solved it by setting CONNECTION_STRING = 'sqlite:///tweets.db'.
My python version is 2.7
I am having other problems getting this to run, but not that particular error.

@foocp
Copy link
Author

foocp commented Feb 15, 2018

that fixed this, thanks! a stupid copy and paste error.

Btw, if dump.py throws this error
AttributeError: module 'dataset' has no attribute 'freeze'
see here for a solution. The module has changed since 2016. https://stackoverflow.com/questions/48090148/no-freeze-attribute-when-using-dataset-module-in-python

@DennisFaucher
Copy link

My entry in private.py looks to be spelled correctly but I am also having this RFC errors. Any ideas? TIA.

CONNECTION_STRING = ”sqlite:///tweets.db”

@DennisFaucher
Copy link

Changed double quotes to single quotes and error went away. Interesting.

@laurianops
Copy link

Problem: I played with Pandas and Postgres yesterday and today I had the same problem.
Solution:
my method --> dado.to_sql(name='pessoa', con=engine, if_exists='append', index=False)
the parameter cannot have <'>, I remove the quotes and bingo !!! it worked out .

@ryanmsnyder
Copy link

@LaurianoElmiroDuarte what did you remove the quotes from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants