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

please provide scripts that are Python 3.x compatible #227

Closed
pleabargain opened this issue May 9, 2018 · 24 comments
Closed

please provide scripts that are Python 3.x compatible #227

pleabargain opened this issue May 9, 2018 · 24 comments
Assignees

Comments

@pleabargain
Copy link

@pleabargain pleabargain commented May 9, 2018

upload_with_preprocessing.py is still python 2.x

Please provide scripts that use python 3.x

@jernejaMislej
Copy link
Contributor

@jernejaMislej jernejaMislej commented May 14, 2018

hi,
we are working on an improved version of the import tools and plan to make it python 3 compatible.
we will let you know as soon as it is available, thank you for the patience

@realchrisolin
Copy link

@realchrisolin realchrisolin commented Mar 19, 2019

Any update on this? It's been nearly a year and I don't see any branches that are an intuitively obvious Python3 rewrite.

@richlv
Copy link
Contributor

@richlv richlv commented Sep 3, 2019

"pip" now warns:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date.

@KAMI911
Copy link

@KAMI911 KAMI911 commented Dec 8, 2019

I am still interested in updated version for python 3.5 or newer.

@musuruan
Copy link

@musuruan musuruan commented Dec 23, 2019

Python 2 will be discontinued on January 1, 2020. This means main distributions will stop supporting it. For example, python2 package and all its subpackages have already been removed from Fedora 32 (i.e. the next Fedora release due to be distributed on April 21, 2020). It is urgent to have mapillary_tools migrated to python3.

@scaidermern
Copy link
Contributor

@scaidermern scaidermern commented Apr 13, 2020

The same on Debian. The next stable version (bullseye) won't have support for python 2 any more. This is already the case for the current Debian testing version (python-pip has already been dropped, for example).

Please make mapillary_tools compatible with python 3.

@andrewharvey
Copy link

@andrewharvey andrewharvey commented May 5, 2020

I'm running Debian unstable and python-pip is no longer available only python3-pip, when I do pip3 install . I get ERROR: Package 'mapillary-tools' requires a different Python: 3.8.3 not in '>=2.7.0,<3.0.0'. Anyone know how to install mapillary_tools on Debian sid?

@scaidermern
Copy link
Contributor

@scaidermern scaidermern commented May 5, 2020

I'm running Debian unstable and python-pip is no longer available only python3-pip, when I do pip3 install . I get ERROR: Package 'mapillary-tools' requires a different Python: 3.8.3 not in '>=2.7.0,<3.0.0'. Anyone know how to install mapillary_tools on Debian sid?

I ran into the same problem while trying to update mapillary-tools to the latest version. Luckily I already had a copy of mapillary-tools installed which still works. Upgrading/Reinstallation seems to be no longer possible on Debian testing or unstable, though.

@musuruan
Copy link

@musuruan musuruan commented May 5, 2020

Fedora 32 was released on April, 28th. It only provides python3. Now it is no longer possible to run mapillary-tools.

@andrewharvey
Copy link

@andrewharvey andrewharvey commented May 5, 2020

I ran into the same problem while trying to update mapillary-tools to the latest version. Luckily I already had a copy of mapillary-tools installed which still works. Upgrading/Reinstallation seems to be no longer possible on Debian testing or unstable, though.

Yeah I went through my system and cleared out any old local python packages, it was after I did this that mapillary_tools broke and now I seem to be stuck.

@andrewharvey
Copy link

@andrewharvey andrewharvey commented May 5, 2020

A workaround could be to run it with docker, but after an hour of trying to get docker containers running i give up. If anyone else knows how to get a docker container up, install pip packages and mount a local directory, I think that would be a good workaround.

@giocomai
Copy link

@giocomai giocomai commented May 22, 2020

Following up on @andrewharvey 's suggestion, here is a Docker-based solution.

First, create the folders that you will share with the Docker container:

mkdir mapillary
mkdir mapillary/pics
mkdir mapillary/config

You will copy the pics you want to upload in the pics subfolder, while the config folder is needed for storing authentication details.

Then run a Docker container with pre-installed mapillary-tools with the following:

docker run -t -i \
 -v ~/mapillary/pics:/pics:Z \
 -v ~/mapillary/config:/root/.config/:Z \
  giocomai/mapillary_tools /bin/bash

This should download from Docker hub the container with mapillary_tools preinstalled that I have created (find the full Dockerfile if you want to build it yourself at the bottom of this post, ideally the nice folks at Mapillary would provide it themselves).

When you run this, you will find yourself on the terminal inside the container.

Now is the time to authenticate with:

mapillary_tools --advanced authenticate

Insert your credentials, and you're good to go: you are now inside the container and can run commands as you normally would. Keep in mind that inside the Docker, the pics folder is located at /pics.

So you can run your usual commands like this:

mapillary_tools process_and_upload --import_path "/pics"

You can also exit the container, by giving the command exit.

You're back in your terminal, on your host machine.

Since your credentials are stored locally, you don't need to authenticate again in the future, and you can start the container and start uploading pictures with a single command, like this:

docker run -t -i \
 -v ~/mapillary/pics:/pics:Z \
 -v ~/mapillary/config:/root/.config/:Z \
  giocomai/mapillary_tools \
  mapillary_tools process_and_upload \
  --import_path "/pics" \
  --user_name "insert_your_mapillary_user_name_here"

Of course you can specify the relevant subfolder (e.g. "/pics/new_pics").

Also, if you're syncing GPS tracks, keep in mind that the timezone inside the docker is UTC, not the timezone set in your host machine. You can pass the timezone when you start the Docker container with, for example, the parameter: "-e TZ=Europe/Amsterdam". Here's a full list of accepted timezones: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

If you're on some recent Fedora, you may want to use podman instead of docker, and things will work just as well (actually, better, as getting docker to run on Fedora 32 is not so straightforward).

Hope this helps.

Here's the full Dockerfile I used if you prefer to build it locally:

FROM debian:9

RUN apt-get update 

RUN apt-get install -y git
RUN apt-get install -y python-dev
RUN apt-get install -y ffmpeg
RUN apt-get install -y python-pip

RUN pip install git+https://github.com/mapillary/Piexif

RUN pip install --upgrade git+https://github.com/mapillary/mapillary_tools

RUN mkdir /mapillary_tools
RUN mkdir /root/.config/

@fgouget
Copy link
Contributor

@fgouget fgouget commented Aug 9, 2020

The Travis continuous integration on GitHub also requires Python 3 which means every pull request now gets an error:

| pip 20.1.1 from /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pip (python 3.6)
[...]
| ERROR: Package 'mapillary-tools' requires a different Python: 3.6.7 not in '>=2.7.0,<3.0.0'
| The command "eval pip install -r requirements.txt " failed. Retrying, 2 of 3.

My understanding is that pip is a Python 3 shim that just says Python 2 is no longer supported.
This does make continuous integration pretty pointless (and gives the impression mapillary_tools is not maintained anymore :-( ).

@scaidermern
Copy link
Contributor

@scaidermern scaidermern commented Aug 9, 2020

According to the Telegram group there is ongoing development for a new upload framework, eventually replacing mapillary_tools. Unclear though why there is no reaction from the developers here.

@richlv
Copy link
Contributor

@richlv richlv commented Aug 9, 2020

Mapillary development process going all closed seems to have helped with getting bought, but it did not help the tools for sure :)
Here's to hope that the process will open up again.

@andrewharvey
Copy link

@andrewharvey andrewharvey commented Aug 11, 2020

According to the Telegram group there is ongoing development for a new upload framework, eventually replacing mapillary_tools. Unclear though why there is no reaction from the developers here.

Where is the Telegram group? I found https://t.me/s/mapillary via a google but it only has a handful of messages around 2018.

@scaidermern
Copy link
Contributor

@scaidermern scaidermern commented Aug 11, 2020

Where is the Telegram group? I found https://t.me/s/mapillary via a google but it only has a handful of messages around 2018.

See https://t.me/Mapillary_Discussion

@jfburke3
Copy link

@jfburke3 jfburke3 commented Sep 4, 2020

It looks like UnitedRPMs is providing a python2-pip RPM for Fedora 32.....

https://fedora.pkgs.org/32/unitedrpms-x86_64/python2-pip-19.1.1-7.fc32.noarch.rpm.html

@Strubbl
Copy link

@Strubbl Strubbl commented Feb 18, 2021

Meanwhile, is there any other method to manually upload images via command line?

@Jakuje
Copy link

@Jakuje Jakuje commented Feb 18, 2021

Meanwhile, is there any other method to manually upload images via command line?

Run some old distro with Python2 in VM

This is also discussed in the following issue: #374 (comment)

@ptpt
Copy link
Member

@ptpt ptpt commented Feb 23, 2021

Hi all,

The Python3 port is close to be done. I tested the basic process and upload and it works great. It would be great to have your help to get more tested. The installation is documented here: https://github.com/mapillary/mapillary_tools/tree/fix-upload#package-installation-python3

Thanks!

@ptpt ptpt mentioned this issue Feb 23, 2021
1 task
@Strubbl
Copy link

@Strubbl Strubbl commented Feb 23, 2021

Great work and thanks for the testing invitation. In the meantime i have moved to kartaview where i am uploading my photos. Keep going and have fun

@ptpt
Copy link
Member

@ptpt ptpt commented Feb 26, 2021

mapillary_tools 0.6.0 with Python3 support is released here https://github.com/mapillary/mapillary_tools/releases/tag/v0.6.0

Thanks all!

@ptpt ptpt closed this as completed Feb 26, 2021
@KAMI911
Copy link

@KAMI911 KAMI911 commented Mar 1, 2021

@ptpt , thank you for the release, works well 🥇

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