coursera / courseraoauth2client

Python library for accessing Coursera resources protected by OAuth 2.0
Apache License 2.0
4 stars 11 forks source link

Support for Python 3 #9

Open argctl opened 5 years ago

argctl commented 5 years ago

Right now if you install with pip3, you will get errors. It would be nice if you added support for Python 3, as most new development is done using Python 3.

JHJohny commented 4 years ago
$ sudo pip3 install courseraoauth2client
Collecting courseraoauth2client
  Downloading https://files.pythonhosted.org/packages/bb/a1/c36f24c66888a49af1108a405626695a54e60c2aa2f521cf48db2c970e72/courseraoauth2client-0.0.1.tar.gz
Collecting requests>=2.7.0 (from courseraoauth2client)
  Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
     |████████████████████████████████| 61kB 859kB/s 
Collecting semver>=2.2.0 (from courseraoauth2client)
  Downloading https://files.pythonhosted.org/packages/38/f1/0c9b852c5136364c0dd59ee1d89e0d7599bef6c9f1869e0f2e07882253ea/semver-2.9.0-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.7.0->courseraoauth2client)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
     |████████████████████████████████| 143kB 983kB/s 
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests>=2.7.0->courseraoauth2client)
  Downloading https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl (125kB)
     |████████████████████████████████| 133kB 1.1MB/s 
Collecting certifi>=2017.4.17 (from requests>=2.7.0->courseraoauth2client)
  Downloading https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl (156kB)
     |████████████████████████████████| 163kB 1.1MB/s 
Collecting idna<2.9,>=2.5 (from requests>=2.7.0->courseraoauth2client)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
     |████████████████████████████████| 61kB 3.5MB/s 
Building wheels for collected packages: courseraoauth2client
  Building wheel for courseraoauth2client (setup.py) ... done
  Stored in directory: /Users/johny/Library/Caches/pip/wheels/7c/b1/65/ae4db9eb2cb7b9a934f5a6198315fa7fe1f590a03e9edcbd7b
Successfully built courseraoauth2client
Installing collected packages: chardet, urllib3, certifi, idna, requests, semver, courseraoauth2client
Successfully installed certifi-2019.11.28 chardet-3.0.4 courseraoauth2client-0.0.1 idna-2.8 requests-2.22.0 semver-2.9.0 urllib3-1.25.7

Works for me

darivadilacuna commented 4 years ago

Hi, @JHJohny , I also tried to use pip3 and although it appears to have installed corretly, when I begin the configuration step:

$ courseraoauth2client config authorize --app manage_research_exports It shows me the following error:

Traceback (most recent call last): File "/Users/davidvalencia/opt/anaconda3/envs/coursera_pi_python3/bin/courseraoauth2client", line 5, in <module> from courseraoauth2client.main import main File "/Users/davidvalencia/opt/anaconda3/envs/coursera_pi_python3/lib/python3.8/site-packages/courseraoauth2client/main.py", line 24, in <module> from courseraoauth2client import commands File "/Users/davidvalencia/opt/anaconda3/envs/coursera_pi_python3/lib/python3.8/site-packages/courseraoauth2client/commands/__init__.py", line 8, in <module> from . import * # noqa File "/Users/davidvalencia/opt/anaconda3/envs/coursera_pi_python3/lib/python3.8/site-packages/courseraoauth2client/commands/config.py", line 75 print 'Name: %s' % name ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Name: %s' % name)?

so it seems that code is on python 2.