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: No module named github #856

Closed
JosephTLyons opened this issue Aug 7, 2018 · 47 comments
Closed

ImportError: No module named github #856

JosephTLyons opened this issue Aug 7, 2018 · 47 comments

Comments

@JosephTLyons
Copy link

I'm trying to use PyGitHub and I'm getting "ImportError: No module named github".

Setup specs:
macOS v10.13.6
Python v3.7.0
Installed with pip v18.0

@sfdye
Copy link
Member

sfdye commented Aug 7, 2018

Change your current directory and try again?

@JosephTLyons
Copy link
Author

Do you mean simply move the script to another directory and try again? If that's what you meant, I tried and nothing changed.

@sfdye
Copy link
Member

sfdye commented Aug 7, 2018

Is your script name also "github"?

@JosephTLyons
Copy link
Author

No, the Python script is not named "github".

@JosephTLyons
Copy link
Author

Since I haven't used the library at all, I was just attempting to use the sample code provided in the README.md

screen shot 2018-08-07 at 5 33 05 pm

@georgistephanov
Copy link

@JosephTLyons Did you run $ pip install pygithub before trying to use the library?

@JosephTLyons
Copy link
Author

Yes, I did. And if I run it again, I get these messages to confirm it.

Josephs-MBP-15:~ josephlyons$ pip install pygithub
Requirement already satisfied: pygithub in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (1.40)
Requirement already satisfied: requests>=2.14.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pygithub) (2.19.1)
Requirement already satisfied: pyjwt in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pygithub) (1.6.4)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests>=2.14.0->pygithub) (1.23)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests>=2.14.0->pygithub) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests>=2.14.0->pygithub) (2018.4.16)
Requirement already satisfied: idna<2.8,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests>=2.14.0->pygithub) (2.7)

@NKUMBA2017P92320170631
Copy link

Hi, @JosephTLyons did you install py2 and py3 together in your MBP?
If you do, confirm your IDE interpreter config is same as your pip install was
like the picture below
image
and my IDE interpreter config is
image

@eamanu
Copy link

eamanu commented Aug 10, 2018

@JosephTLyons Try to run the script on a terminal.... If this run successfully your IDE is bad configured

@JosephTLyons
Copy link
Author

I do have both python 2 (the version Apple ships with their mac) and python3 (installed through Homebrew).

Also, I am running the script through Terminal, I'm not using an IDE. I'm coding strictly with Atom and then running with Terminal.

@JosephTLyons
Copy link
Author

Bear with me, while I'm not a new programmer, I am new to Python and this is one of the first Python modules I've tried to use that wasn't successful for me.

screen shot 2018-08-12 at 4 54 04 am

@LeonardoFurtado
Copy link

I have the same problem. I created a virtual environment and tried to install PyGithub using pip install PyGithub. I received: Requirement already satisfied (use --upgrade to upgrade): pygithub in /myvenv/lib/python3.5/site-packages
Requirement already satisfied (use --upgrade to upgrade): requests> = 2.14.0 in /myvenv/lib/python3.5/site-packages (from pygithub)
Requirement already satisfied (use --upgrade to upgrade): pyjwt in /myvenv/lib/python3.5/site-packages (from pygithub)
Requirement already satisfied (use -upgrade to upgrade): idna <2.8,> = 2.5 in /myvenv/lib/python3.5/site-packages (from requests> = 2.14.0-> pygithub)
Requirement already satisfied (use -upgrade to upgrade): chardet <3.1.0,> = 3.0.2 in /myvenv/lib/python3.5/site-packages (from requests> = 2.14.0-> pygithub)
Requirement already satisfied (use --upgrade to upgrade): certifi> = 2017.4.17 in /myvenv/lib/python3.5/site-packages (from requests> = 2.14.0-> pygithub)
Requirement already satisfied (use -upgrade to upgrade): urllib3 <1.24,> = 1.21.1 in /myvenv/lib/python3.5/site-packages (from requests> = 2.14.0-> pygithub)

I tried importing the library using python via terminal, but... No sucess
sem titulo
sem titulo2

@sfdye sfdye added the bug label Aug 23, 2018
@sfdye
Copy link
Member

sfdye commented Aug 23, 2018

Does a Python 2 virtualenv solve the problem?

@LeonardoFurtado
Copy link

Where it will be used, python 2 is not used because of conflict.

@sfdye
Copy link
Member

sfdye commented Aug 23, 2018

This seems to be one annoying known issue, let me investigate and try to fix.

@eamanu
Copy link

eamanu commented Aug 23, 2018

Can be a problem of PIP?

I remember had this problem (with other module) on Linux Mate.

@sfdye
Copy link
Member

sfdye commented Aug 24, 2018

If this is still an issue, pip install from the latest master branch, where I just fixed an import issue in de6b713.

Also comments in #314 are worth checking out.

@tcullum-gpsw
Copy link

Same issue.

@silasary
Copy link
Contributor

silasary commented Sep 8, 2018

Try installing pygithub with this command: python -m pip install pygithub

This ensures you're using the pip related to python interpreter that you're running the script with.

@LeonardoFurtado
Copy link

i did it:
python3 -m venv myvenv
I activated the environment and then:
python -m pip install pygithub

Collecting pygithub
  Downloading https://files.pythonhosted.org/packages/91/9e/50af4bb0ab316fedc13ae87347a718c19698ba8a19e64a692dc30c5fc9db/PyGithub-1.43.2.tar.gz (2.7MB)
    100% |████████████████████████████████| 2.7MB 647kB/s 
Collecting requests>=2.14.0 (from pygithub)
  Using cached https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl
Collecting pyjwt (from pygithub)
  Using cached https://files.pythonhosted.org/packages/93/d1/3378cc8184a6524dc92993090ee8b4c03847c567e298305d6cf86987e005/PyJWT-1.6.4-py2.py3-none-any.whl
Collecting Deprecated (from pygithub)
  Downloading https://files.pythonhosted.org/packages/83/2d/7a5a117eccdef0cdf4cf015830945a7d8fdbbc9ec866d7cead758dc4229c/Deprecated-1.2.3-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.14.0->pygithub)
  Downloading https://files.pythonhosted.org/packages/df/f7/04fee6ac349e915b82171f8e23cee63644d83663b34c539f7a09aed18f9e/certifi-2018.8.24-py2.py3-none-any.whl (147kB)
    100% |████████████████████████████████| 153kB 3.3MB/s 
Collecting urllib3<1.24,>=1.21.1 (from requests>=2.14.0->pygithub)
  Using cached https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.14.0->pygithub)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.8,>=2.5 (from requests>=2.14.0->pygithub)
  Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Collecting wrapt<2,>=1 (from Deprecated->pygithub)
  Downloading https://files.pythonhosted.org/packages/a0/47/66897906448185fcb77fc3c2b1bc20ed0ecca81a0f2f88eda3fc5a34fc3d/wrapt-1.10.11.tar.gz
Building wheels for collected packages: pygithub, wrapt
  Running setup.py bdist_wheel for pygithub ... error
  Complete output from command /home/leonardo/phub/myvenv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yww1918p/pygithub/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpx2l6hyczpip-wheel- --python-tag cp35:
  /usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
    warnings.warn(msg)
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for pygithub
  Running setup.py clean for pygithub
  Running setup.py bdist_wheel for wrapt ... error
  Complete output from command /home/leonardo/phub/myvenv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yww1918p/wrapt/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp4kz97gl4pip-wheel- --python-tag cp35:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for wrapt
  Running setup.py clean for wrapt
Failed to build pygithub wrapt
Installing collected packages: certifi, urllib3, chardet, idna, requests, pyjwt, wrapt, Deprecated, pygithub
  Running setup.py install for wrapt ... done
  Running setup.py install for pygithub ... done
Successfully installed Deprecated-1.2.3 certifi-2018.8.24 chardet-3.0.4 idna-2.7 pygithub-1.43.2 pyjwt-1.6.4 requests-2.19.1 urllib3-1.23 wrapt-1.10.11
You are using pip version 8.1.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I tried running a script using pygithub and it did not return any error.

@LeonardoFurtado
Copy link

it is good to try to run the script first from the command line of the virtual environment.

@labrys
Copy link

labrys commented Nov 24, 2018

These may be caused by the relative imports. Python 3 requires absolute imports. This should be fixed by #967

@Plaba
Copy link

Plaba commented Dec 2, 2018

sudo pip3 install pygithub worked for me.

@xunnanxu
Copy link

xunnanxu commented Jan 13, 2019

this breaks in python 3.7+ but works in 3.6.5 FYI
though not sure if it's a pip issue as 3.7.2 uses pip 18 but 3.6.5 uses 9.x

@jdiazgon
Copy link

this breaks in python 3.7

I agree, have just tested it. When using Python 3.7+, getting following error:

Traceback (most recent call last):
  File "scripts/src/create_release.py", line 6, in <module>
    from github.Milestone import Milestone
ModuleNotFoundError: No module named 'github'

Using Python 3.6 works fine.

@conoroshea1996
Copy link

Does this still not work on Python 3.7 ??? Im still getting error when importing?

@labrys
Copy link

labrys commented Jul 9, 2019

@conoroshea1996 they have refused to fix this in the past despite multiple PRs to fix it.

@Yanran1123
Copy link

I have the same issue when I use Pycharm on Mac OS, but I do not have this issue when I use Jupyter on Mac OS. And, I do not have this issue when use Pycharm or Jupyter on Windows.

@p3nda
Copy link

p3nda commented Jan 21, 2020

+1
Python 3.7.4 I get the same error.

@s-t-e-v-e-n-k
Copy link
Collaborator

s-t-e-v-e-n-k commented Jan 21, 2020

@p3nda This is almost certainly not the same issue as previously reported, can you show the full error?

@p3nda
Copy link

p3nda commented Jan 21, 2020

Hi @s-t-e-v-e-n-k ,
Sure thing:

python3 --version
Python 3.7.4

I get:

ImportError: cannot import name 'Github' from 'github' (/usr/local/lib/python3.7/site-packages/github/init.py)

I figured this error is slightly different, so after troubleshooting for a while unsuccessfully I spun up a docker container and installed python3.6 and tried to use it:

ImportError: cannot import name 'Github'
python3 --version
Python 3.6.9

@s-t-e-v-e-n-k
Copy link
Collaborator

@p3nda On which platform?

@p3nda
Copy link

p3nda commented Jan 21, 2020

@s-t-e-v-e-n-k For the first error on python3.7.4 i'm using macos mojave 10.14.6. In the docker container with python 3.6.9 i'm using Ubuntu 18.04.3

@s-t-e-v-e-n-k
Copy link
Collaborator

So it's odd, what does:

>>> import github
>>> github.__file__
'/home/steven/PyGithub/github/__init__.py'
>>> dir(github.MainClass)
['AuthenticatedUser', 'Consts', 'DEFAULT_BASE_URL', 'DEFAULT_PER_PAGE', 'DEFAULT_STATUS_URL', 'DEFAULT_TIMEOUT', 'Github', 'GithubException', 'GithubIntegration', 'GitignoreTemplate', 'HookDescription', 'Installation', 'InstallationAuthorization', 'RateLimit', 'Repository', 'Requester', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'datetime', 'github', 'jwt', 'pickle', 'requests', 'time', 'urllib3']
>>> github.MainClass.__file__
'/home/steven/PyGithub/github/MainClass.py'

give you?

@s-t-e-v-e-n-k
Copy link
Collaborator

And from github.MainClass import Github sorry

@p3nda
Copy link

p3nda commented Jan 21, 2020

In Ubuntu 18.04 Docker container:

import github
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/dist-packages/github/init.py", line 44, in
from github.MainClass import Github, GithubIntegration
File "/usr/local/lib/python3.6/dist-packages/github/MainClass.py", line 58, in
import requests
File "/usr/local/lib/python3.6/dist-packages/requests/init.py", line 112, in
from . import utils
File "/usr/local/lib/python3.6/dist-packages/requests/utils.py", line 26, in
from ._internal_utils import to_native_string
File "/usr/local/lib/python3.6/dist-packages/requests/_internal_utils.py", line 11, in
from .compat import is_py2, builtin_str, str
File "/usr/local/lib/python3.6/dist-packages/requests/compat.py", line 59, in
from http import cookiejar as cookielib
File "/usr/lib/python3.6/http/cookiejar.py", line 31, in
import copy
File "/copy.py", line 2, in
from github import Github
ImportError: cannot import name 'Github'

from github.MainClass import Github
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/dist-packages/github/init.py", line 44, in
from github.MainClass import Github, GithubIntegration
File "/usr/local/lib/python3.6/dist-packages/github/MainClass.py", line 58, in
import requests
File "/usr/local/lib/python3.6/dist-packages/requests/init.py", line 112, in
from . import utils
File "/usr/local/lib/python3.6/dist-packages/requests/utils.py", line 26, in
from ._internal_utils import to_native_string
File "/usr/local/lib/python3.6/dist-packages/requests/_internal_utils.py", line 11, in
from .compat import is_py2, builtin_str, str
File "/usr/local/lib/python3.6/dist-packages/requests/compat.py", line 59, in
from http import cookiejar as cookielib
File "/usr/lib/python3.6/http/cookiejar.py", line 31, in
import copy
File "/copy.py", line 2, in
from github import Github
ImportError: cannot import name 'Github'

On my Mac:

import github
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/github/init.py", line 44, in
from github.MainClass import Github, GithubIntegration
File "/usr/local/lib/python3.7/site-packages/github/MainClass.py", line 58, in
import requests
File "/Users/amanda/Library/Python/3.7/lib/python/site-packages/requests/init.py", line 112, in
from . import utils
File "/Users/amanda/Library/Python/3.7/lib/python/site-packages/requests/utils.py", line 26, in
from ._internal_utils import to_native_string
File "/Users/amanda/Library/Python/3.7/lib/python/site-packages/requests/_internal_utils.py", line 11, in
from .compat import is_py2, builtin_str, str
File "/Users/amanda/Library/Python/3.7/lib/python/site-packages/requests/compat.py", line 59, in
from http import cookiejar as cookielib
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/cookiejar.py", line 31, in
import copy
File "/Users/amanda/copy.py", line 2, in
from github import Github
ImportError: cannot import name 'Github' from 'github' (/usr/local/lib/python3.7/site-packages/github/init.py)

from github.MainClass import Github
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/github/init.py", line 44, in
from github.MainClass import Github, GithubIntegration
File "/usr/local/lib/python3.7/site-packages/github/MainClass.py", line 58, in
import requests
File "/Users/amanda/Library/Python/3.7/lib/python/site-packages/requests/init.py", line 112, in
from . import utils
File "/Users/amanda/Library/Python/3.7/lib/python/site-packages/requests/utils.py", line 26, in
from ._internal_utils import to_native_string
File "/Users/amanda/Library/Python/3.7/lib/python/site-packages/requests/_internal_utils.py", line 11, in
from .compat import is_py2, builtin_str, str
File "/Users/amanda/Library/Python/3.7/lib/python/site-packages/requests/compat.py", line 59, in
from http import cookiejar as cookielib
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/cookiejar.py", line 31, in
import copy
File "/Users/amanda/copy.py", line 2, in
from github import Github
ImportError: cannot import name 'Github' from 'github' (/usr/local/lib/python3.7/site-packages/github/init.py)

I should note that i'm on my work machine this morning doing the test from the macbook which is
MacOS Mojave 10.14.6 with python 3.7.5 installed. For the ubuntu container, it is the same one, same version of python.

@s-t-e-v-e-n-k

@s-t-e-v-e-n-k
Copy link
Collaborator

File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/cookiejar.py", line 31, in
import copy
File "/Users/amanda/copy.py", line 2, in 

Where did that /copy.py or /Users/amanada/copy.py file come from? It's masking a real Python module /usr/lib/python3.6/copy.py and causing a circular import.

@p3nda
Copy link

p3nda commented Jan 22, 2020

copy.py is a script I was working which uses PyGithub. When I ran those commands they were ran from the python interpreter itself after i tried running the script. I spun up a new container without running that script and just ran the import commands through python interpreter and works fine:

import github
from github import Github
exit()

I'm not sure why adding it in my script broke everything, it's not even fully formed yet:

import shutil
from github import Github

ACCESS_TOKEN = '123456789'
#initialize github client
g = Github(ACCESS_TOKEN)
print(g.get_user().get_repos())

@s-t-e-v-e-n-k

@s-t-e-v-e-n-k
Copy link
Collaborator

It broke everything because of the name -- it masks a Python module called 'copy' which is in the module import chain when you run from github import Github. Call your script anything else and it should work fine.

@p3nda
Copy link

p3nda commented Jan 22, 2020

Ah okay, thanks for the clarity @s-t-e-v-e-n-k i appreciate your time!

@s-t-e-v-e-n-k
Copy link
Collaborator

@p3nda I'm delighted to help! I'm going to close this issue, if you have any other issues please feel free to open a new issue.

@vyshnavdevops
Copy link

Can someone help me with this error

Traceback (most recent call last):
File "terra.py", line 1, in
from python_terraform import *
ImportError: No module named python_terraform

@jamesonwilliams
Copy link

In my case, I got this error due to issues with my Python imports path.

I'm using Python 3.7.3:

$ python3 --version
Python 3.7.3

And PyPI 20.2.3:

$ pip3 --version
pip 20.2.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

I have installed PyGithub:

$ pip3 install pygithub
Requirement already satisfied: pygithub in /usr/local/lib/python3.7/site-packages (1.43)
Requirement already satisfied: pyjwt in /usr/local/lib/python3.7/site-packages (from pygithub) (1.7.1)
Requirement already satisfied: requests>=2.14.0 in /usr/local/lib/python3.7/site-packages (from pygithub) (2.24.0)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/site-packages (from requests>=2.14.0->pygithub) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/site-packages (from requests>=2.14.0->pygithub) (1.25.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/site-packages (from requests>=2.14.0->pygithub) (2020.6.20)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/site-packages (from requests>=2.14.0->pygithub) (2.10)

But, it fails to import, nevertheless:

$ python3 <<< "from github import Github"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'github'

In the pip output, we saw that the package was installed to /usr/local/lib/python3.7/site-packages. However, this directory was not in my Python imports path:

$ python3 <<< 'import sys; print(sys.path)'
['', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python37.zip', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/lib-dynload', '/Users/jhwill/Library/Python/3.7/lib/python/site-packages', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages']

Solution 1: Add to PYTHONPATH

One way to solve this is to add the missing directory to my PYTHONPATH, in ~/.bashrc:

# Add these lines
readonly local_site_packages="/usr/local/lib/python3.7/site-packages"
if [ ! -z "$PYTHONPATH" ]; then
    export PYTHONPATH="$local_site_packages:$PYTHONPATH"
else
    export PYTHONPATH="$local_site_packages"
fi

And source the file:

$ . ~/.bashrc

Solution 2: Install to an existing import path

/Users/jhwill/Library/Python/3.7/lib/python/site-packages is already in my system path. So, we can target this directory for installation while using the pip3 command:

$ pip install --target=/Users/jhwill/Library/Python/3.7/lib/python/site-packages PyGithub
Collecting PyGithub
  Using cached PyGithub-1.53-py3-none-any.whl (274 kB)
Collecting pyjwt
  Using cached PyJWT-1.7.1-py2.py3-none-any.whl (18 kB)
Collecting deprecated
  Using cached Deprecated-1.2.10-py2.py3-none-any.whl (8.7 kB)
Collecting requests>=2.14.0
  Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
Processing ./Library/Caches/pip/wheels/62/76/4c/aa25851149f3f6d9785f6c869387ad82b3fd37582fa8147ac6/wrapt-1.12.1-cp37-cp37m-macosx_10_14_x86_64.whl
Collecting idna<3,>=2.5
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting chardet<4,>=3.0.2
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading urllib3-1.25.10-py2.py3-none-any.whl (127 kB)
     |████████████████████████████████| 127 kB 2.9 MB/s 
Installing collected packages: pyjwt, wrapt, deprecated, idna, chardet, certifi, urllib3, requests, PyGithub
Successfully installed PyGithub-1.53 certifi-2020.6.20 chardet-3.0.4 deprecated-1.2.10 idna-2.10 pyjwt-1.7.1 requests-2.24.0 urllib3-1.25.10 wrapt-1.12.1

@INGORTE
Copy link

INGORTE commented Aug 8, 2021

I have the same problem. I created a virtual environment and tried to install PyGithub using pip install PyGithub. I received: Requirement already satisfied (use --upgrade to upgrade): pygithub in /myvenv/lib/python3.5/site-packages
Requirement already satisfied (use --upgrade to upgrade): requests> = 2.14.0 in /myvenv/lib/python3.5/site-packages (from pygithub)
Requirement already satisfied (use --upgrade to upgrade): pyjwt in /myvenv/lib/python3.5/site-packages (from pygithub)
Requirement already satisfied (use -upgrade to upgrade): idna <2.8,> = 2.5 in /myvenv/lib/python3.5/site-packages (from requests> = 2.14.0-> pygithub)
Requirement already satisfied (use -upgrade to upgrade): chardet <3.1.0,> = 3.0.2 in /myvenv/lib/python3.5/site-packages (from requests> = 2.14.0-> pygithub)
Requirement already satisfied (use --upgrade to upgrade): certifi> = 2017.4.17 in /myvenv/lib/python3.5/site-packages (from requests> = 2.14.0-> pygithub)
Requirement already satisfied (use -upgrade to upgrade): urllib3 <1.24,> = 1.21.1 in /myvenv/lib/python3.5/site-packages (from requests> = 2.14.0-> pygithub)

I tried importing the library using python via terminal, but... No sucess
sem titulo
sem titulo2

hello i have the same problem with you, and do you fix it right now?

@firobeid
Copy link

firobeid commented Dec 5, 2022

Is the a none or wasm wheel for this package?

@lxRbckl
Copy link

lxRbckl commented Jan 4, 2023

I run ubuntu server 22.04. I received this error quite frequently also. I believe it has to do with a failure to install packages pygithub actually depends on. for instance, my issues were related to the packages cffi and openssl. at least in my case, I noticed a large majority of the time, this error took place when installing from a requirements.txt file.

in my case, I attempted to remove all related github packages (github or pygithub).
pip3 uninstall github
or
pip3 uninstall pygithub

in some cases, you may have installed pygithub/github from a reqs file. in which case:
pip3 uninstall -r requirements.txt

after removing some of the lost packages, these are the serious of commands that fixed it for me. if you get past this error, you may still have to manually install some required packages for your specific use case.

sudo apt install python3-pip
sudo apt-get update && sudo apt-get upgrade
sudo apt install openssl
pip3 install cffi
pip3 install pygithub * hence with no errors *

note: while I did receive the same error, I am aware that this esoteric solution may not work with everyone. at the very least, I hope this helps people further understand their own problem.

good luck

@labrys
Copy link

labrys commented Jan 4, 2023

Really frustrating that this many years later and they still wont fix this even after multiple PRs to resolve it.

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

No branches or pull requests