kartaview / upload-scripts

Uploader tools for KartaView
MIT License
61 stars 30 forks source link

missing dependencies #23

Closed Skippern closed 7 years ago

Skippern commented 7 years ago

The dependency cookie jar (import http.cookiejar) is not in the requirements.txt archives. Please revise all requirements.txt and add all dependencies.

Skippern commented 7 years ago

Same goes for urllib.request, it is not clear to me what module to install, so I am not able to run the script for the moment. have several urllib versions installed, plus a few modules derived from urllib

james2432 commented 7 years ago

Do you have python3? Because that sound like you trying to run it on python2, scripts are only compatible with python3

james2432 commented 7 years ago

It's in the readme as well: https://github.com/openstreetview/upload-scripts/blob/master/README.md#requirements-1

Skippern commented 7 years ago

Tried with python 2.7, 3.4, 3.5 and 3.6, installed all dependencies for all versions. Had a discussion on it on Brazilian telegram, and will try to install virtualenv to see if I can get this sorted.

BTW Using Mac OS X El Capitan

Aun Johnsen

On Dec 6, 2016, at 09:13, Jamie Nadeau notifications@github.com wrote:

Do you have python3? Because that sound like you trying to run it on python2, scripts are only compatible with python3

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openstreetview/upload-scripts/issues/23#issuecomment-265124371, or mute the thread https://github.com/notifications/unsubscribe-auth/AAw_XEv0iPWrhUzLyDgtoytTb2kmmiUVks5rFUN1gaJpZM4LEsyR.

james2432 commented 7 years ago

Cookiejar is a standard lib in python3....maybe your installation is corrupt: https://docs.python.org/3.3/library/http.cookiejar.html

Skippern commented 7 years ago

The cookiejar error I have managed to solve, it is urllib.request that I can’t get around, but reading the dump seems it relates to site.

Aun Johnsen

On Dec 6, 2016, at 09:22, Jamie Nadeau notifications@github.com wrote:

Cookiejar is a standard lib in python3....maybe your installation is corrupt: https://docs.python.org/3.3/library/http.cookiejar.html https://docs.python.org/3.3/library/http.cookiejar.html — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/openstreetview/upload-scripts/issues/23#issuecomment-265126007, or mute the thread https://github.com/notifications/unsubscribe-auth/AAw_XCyJKihfrLwhqmSmt_H6Sv_x70WVks5rFUV2gaJpZM4LEsyR.

Skippern commented 7 years ago

This is the current error message, I have just uninstalled and reinstalled completely python3 via port (MacPort package manager) Failed to import the site module Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 554, in <module> main() File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 540, in main known_paths = addusersitepackages(known_paths) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 281, in addusersitepackages user_site = getusersitepackages() File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 257, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site.py", line 247, in getuserbase USER_BASE = get_config_var('userbase') File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/sysconfig.py", line 587, in get_config_var return get_config_vars().get(name) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/sysconfig.py", line 566, in get_config_vars import _osx_support File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/_osx_support.py", line 4, in <module> import re File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/re.py", line 335, in <module> import copyreg File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/copyreg/__init__.py", line 7, in <module> raise ImportError('This package should not be accessible on Python 3. ' ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.

james2432 commented 7 years ago

Python3 is trying to run python2 modules:

import copyreg File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/copyreg/__init__.py", line 7, in
Skippern commented 7 years ago

I am reporting this as a bug to MacPorts, to see if they have a solution or a fix for this.

james2432 commented 7 years ago

Do you have anything weird in your path variable?

Skippern commented 7 years ago

PYTHONPATH=:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python:/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

james2432 commented 7 years ago

Yeah, if you have python3, you should have python2.7 in the path..

Skippern commented 7 years ago

Usually run my own stuff, and most scripts I have are py2.7, I'll add up py3 to the path

Skippern commented 7 years ago

It works when removing all py2.7 elements from the path and keep py3, when having both py2.7 and py3 in the path it falls back on that previous error. But now I have a different run error issue:

Traceback (most recent call last): File "./osc_upload-scripts/upload_photos_by_exif/upload_photos_by_exif.py", line 489, in <module> main(sys.argv[1:]) File "./osc_upload-scripts/upload_photos_by_exif/upload_photos_by_exif.py", line 350, in main photos_path = sorted(os.listdir(path), key=os.path.getmtime) FileNotFoundError: [Errno 2] No such file or directory: 'toOSC/20161205183432/'

bogdan-racasan commented 7 years ago

You need to provide full path do the directory.

james2432 commented 7 years ago

Also if you have spaces in path you need to escape them

Skippern commented 7 years ago

It is uploading now, but I will still have to figure out how to deal with $PYTHONPATH, I need to have both 2.7 and 3 elements in it

Skippern commented 7 years ago

found a workaround, made a separate $PYTHON3PATH environmental variable, and run the uploads through scripts. I know it is dirty, but it works