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

ImportError: cannot import name 'InstagramSession" #1

Open
aricley opened this issue Nov 3, 2016 · 8 comments
Open

ImportError: cannot import name 'InstagramSession" #1

aricley opened this issue Nov 3, 2016 · 8 comments

Comments

@aricley
Copy link

aricley commented Nov 3, 2016

When I run 'instagram-uploader.py' I receive an error:

Traceback (most recent call last): File "instagram-uploader.py", line 27, in <module> from instagram import InstagramSession ImportError: cannot import name 'InstagramSession'

@aboehm
Copy link
Owner

aboehm commented Nov 3, 2016

It's seems, you forget to checkout the submodule. Run in the instagram-uploader directory

git submodule init
git submodule update

@aricley
Copy link
Author

aricley commented Nov 3, 2016

I still get the error, I'll explain more. When I only run instagram-uploader.py I get this error: bash: instagram-uploader.py: command not found. If I run python instagram-uploader.py then I get the error I talked about. When I ran the commands you posted, I got this error: fatal: Not a git repository (or any of the parent directories): .git. I read running git init would solve that error, in which it did - it added a .git folder. However, I'm not sure if those two commands did anything because I still get the 'ImportError'.

@aboehm
Copy link
Owner

aboehm commented Nov 4, 2016

Checkout the complete repository with

git clone https://github.com/aboehm/instagram-uploader
cd instagram-uploader
git submodule init
git submodule update

It should run without errors. I tested it yesterday.

@aricley
Copy link
Author

aricley commented Nov 4, 2016

Here is my output:

[richard@aricley ~]$ git clone https://github.com/aboehm/instagram-uploader && cd instagram-uploader && git submodule init && git submodule update
Cloning into 'instagram-uploader'...
remote: Counting objects: 30, done.
remote: Total 30 (delta 0), reused 0 (delta 0), pack-reused 30
Unpacking objects: 100% (30/30), done.
Submodule 'instagram' (github-aboehm:aboehm/python-instagram-upload) registered for path 'instagram'
Cloning into '/home/richard/instagram-uploader/instagram'...
ssh: Could not resolve hostname github-aboehm: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'github-aboehm:aboehm/python-instagram-upload' into submodule path '/home/richard/instagram-uploader/instagram' failed
Failed to clone 'instagram'. Retry scheduled
Cloning into '/home/richard/instagram-uploader/instagram'...
ssh: Could not resolve hostname github-aboehm: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'github-aboehm:aboehm/python-instagram-upload' into submodule path '/home/richard/instagram-uploader/instagram' failed
Failed to clone 'instagram' a second time, aborting
[richard@aricley instagram-uploader]$

@aboehm
Copy link
Owner

aboehm commented Nov 6, 2016

Ok, the submodule url points to an alias, that can't be resolved. I have uploaded the correction. Retry it.

@aricley
Copy link
Author

aricley commented Nov 9, 2016

The commands gave no errors which is good. I ran python instagram-uploader.py and received this.

Traceback (most recent call last):
  File "instagram-uploader.py", line 27, in 
    from instagram import InstagramSession
  File "/home/richard/instagram-uploader/instagram/__init__.py", line 1, in 
    import requests
  File "/usr/lib/python3.5/site-packages/requests/__init__.py", line 60, in 
    from .packages.urllib3.exceptions import DependencyWarning
ImportError: cannot import name 'DependencyWarning'

@aboehm
Copy link
Owner

aboehm commented Nov 10, 2016

Which version of python-requests do you use? I'm running the uploader on Debian/stretch with python-requests v2.11.1-1.

@aricley
Copy link
Author

aricley commented Nov 10, 2016

Same as you, v2.11.1-1.

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

2 participants