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

Script does not work in Python 3 #12

Open
mchesterkadwell opened this issue Apr 1, 2017 · 2 comments
Open

Script does not work in Python 3 #12

mchesterkadwell opened this issue Apr 1, 2017 · 2 comments

Comments

@mchesterkadwell
Copy link
Contributor

The following lines don't work in Python 3:
https://github.com/BritishMuseumDH/britishMuseumFacesDetection/blob/master/britishMuseumFaces.py#L259
https://github.com/BritishMuseumDH/britishMuseumFacesDetection/blob/master/britishMuseumFaces.py#L290

I think this is because the synax for using urllib changed from Python 2:
urllib.urlretrieve()
to Python 3:
urllib.request.urlretrieve()

If you have the images downloaded already you won't see this error when testing with Python 3 because it's only necessary to use urllib when fetching the images for the first time.

@portableant
Copy link
Contributor

Can you try this python 3 version out? https://gist.github.com/portableant/ce270fbe9b5f1638ac01d9d2a13a6f31

@mchesterkadwell
Copy link
Contributor Author

mchesterkadwell commented Apr 16, 2017

I have tried it out and it now works for me after I have made some changes and comments (marked with ###)
https://gist.github.com/mchesterkadwell/9c8173d11d2a821f3d4a222fd032dd5e
Three types of changes:

  1. Related to Python 3 (in particular, Python 3 handles division differently than Python 2)
  2. Possible bugs and some suggested solutions
  3. Apparently duplicated code commented out

I am not sure if my set up has 'caused' some of these, so please cast sceptical eye.

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