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

Cannot import name 'rest', Installation problems on Ubuntu 16.04 #68

Closed
samhains opened this issue Jul 10, 2017 · 3 comments
Closed

Cannot import name 'rest', Installation problems on Ubuntu 16.04 #68

samhains opened this issue Jul 10, 2017 · 3 comments

Comments

@samhains
Copy link

I usually use conda for python package management, and was unable to get past this error

With Conda

which python returns:
/home/sam/anaconda3/envs/python352/bin/python

which clarifai returns:
home/sam/anaconda3/envs/python352/bin/clarifai

python version 3.5.2
clarifai verison 2.0.29

Traceback (most recent call last):
  File "clarifai.py", line 2, in <module>
    from clarifai import rest
  File "/home/sam/Code/barnes-staff-backend/clarifai.py", line 2, in <module>
    from clarifai import rest
ImportError: cannot import name 'rest'

I switched to VirtualEnv and followed instructions that @robertwenquan gave on #66 exactly

With VirtualEnv

I get a slightly different but very similar error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sam/Code/barnes-staff-backend/clarifai.py", line 2, in <module>
    from clarifai import rest
ImportError: cannot import name 'rest'

which python returns:
/home/sam/Code/barnes-staff-backend/bb/bin/python
which clarifai return:
/home/sam/Code/barnes-staff-backend/bb/bin/clarifai

python version 3.5.2
clarifai verison 2.0.29

I have tried different versions of clarifai, and using different python executables and I am having no luck at all.

@robertwenquan
Copy link
Contributor

please rename your filename from clarifai.py to something else. Your filename clarifai overrides the library name clarifai which breaks the clarifai.rest. That's why it couldn't find rest

@samhains
Copy link
Author

ah thats that was it 😅 , thanks

@robertwenquan
Copy link
Contributor

good to hear back to you. I am closing the ticket.

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

No branches or pull requests

2 participants