colonelpanic8 / okcupyd

A Library that enables programmatic interaction with okcupid.com, using okcupid.com's private okcupid JSON API and html scraping when necessary.
MIT License
110 stars 18 forks source link

ImportError: cannot import name cli #79

Closed Ryan-Holben closed 8 years ago

Ryan-Holben commented 8 years ago

When simply running 'import okcupyd', I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/Happycake/anaconda2/envs/OKC-dev/lib/python2.7/site-packages/okcupyd/__init__.py", line 5, in <module>
    from invoke import cli as invoke
ImportError: cannot import name cli

My pip freeze is:

appnope==0.1.0
coloredlogs==5.0
decorator==4.0.6
gnureadline==6.3.3
humanfriendly==1.43.1
invoke==0.12.0
ipython==4.0.3
ipython-genutils==0.1.0
lxml==3.5.0
okcupyd==1.0.0a3
path.py==8.1.2
pexpect==4.0.1
pickleshare==0.6
ptyprocess==0.5
requests==2.9.1
simplegeneric==0.8.1
simplejson==3.8.1
six==1.10.0
SQLAlchemy==1.0.11
traitlets==4.1.0
wheel==0.26.0
wrapt==1.10.6

I tried this with the non-alpha version of okcupyd as well.

Ryan-Holben commented 8 years ago

Nevermind, it just exists in the alpha version, and commenting out fixes it!

colonelpanic8 commented 8 years ago

no this is real issue, the problem is that invoke changed its import structure. The solution is to just remove the import.

kingyakshaver commented 8 years ago

hmm this sucks. Whats the ETA?

Ryan-Holben commented 8 years ago

I don't think it's been changed since I mentioned it last, but again, easy fix; just comment out that import.

colonelpanic8 commented 8 years ago

yep, actually, I think that Invoke finally has the functionality that I had hoped for, so we can make the okcupyd binary just call out to it and use all of its tasks

A5HRAJ commented 8 years ago

I commented out from invoke import cli as invoke to fix the error, but now I get a different issue:

Traceback (most recent call last): File "/usr/local/bin/okcupyd", line 7, in <module> from okcupyd import interactive File "/usr/local/lib/python2.7/site-packages/okcupyd/__init__.py", line 8, in <module> from . import tasks File "/usr/local/lib/python2.7/site-packages/okcupyd/tasks/__init__.py", line 7, in <module> from . import db as db_collection File "/usr/local/lib/python2.7/site-packages/okcupyd/tasks/db.py", line 15, in <module> @task(default=True) File "/usr/local/lib/python2.7/site-packages/invoke/tasks.py", line 303, in inner autoprint=autoprint, File "/usr/local/lib/python2.7/site-packages/invoke/tasks.py", line 58, in __init__ self.positional = self.fill_implicit_positionals(positional) File "/usr/local/lib/python2.7/site-packages/invoke/tasks.py", line 149, in fill_implicit_positionals args, spec_dict = self.argspec(self.body) File "/usr/local/lib/python2.7/site-packages/invoke/tasks.py", line 144, in argspec raise TypeError("Tasks must have an initial Context argument!") TypeError: Tasks must have an initial Context argument!

colonelpanic8 commented 8 years ago

yeah, I have a fix for this.