juanmcasillas / gopro2gpx

Parse the gpmd stream for GOPRO moov track (MP4) and extract the GPS info into a GPX (and kml) file.
GNU General Public License v3.0
194 stars 49 forks source link

Runtime warning #10

Closed SuffolkPunch closed 3 years ago

SuffolkPunch commented 3 years ago

Hello,

I've installed gopro2gpx in Linux Mint 19.3 using the command pip3 install git+https://github.com/juanmcasillas/gopro2gpx

When I run gopro2gpx in a terminal as follows python3 -m gopro2gpx.gopro2gpx -s -v video.MP4 video

I get the following warning (and then gopro2gpx completes successfully):

/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'gopro2gpx.gopro2gpx' found in sys.modules after import of package 'gopro2gpx', but prior to execution of 'gopro2gpx.gopro2gpx'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))

Is this usual?

Martin

Simske commented 3 years ago

I just checked it, the warning comes up because gopro2gpx.gopro2gpx is imported in gopro2gpx/__init__.py. The functionality is not compromised.

The easiest way to call gopro2gpx is just using the entrypoint gopro2gpx, the warning doesn't appear there. To make it also run as python -m gopro2gpx a gopro2gpx/__main__py script would be needed.

I can make a PR with these changes.

SuffolkPunch commented 3 years ago

Thanks for that. If you could tweak things so I can launch it with a one-liner that would be great!

BTW: what is a 'PR'?

Martin

Simske commented 3 years ago

Hi, you can already just run it with just gopro2gpx (if you installed it with pip or setup.py, which I assume you have).

A PR is a Pull Request, I can submit changes so the project maintainer can review them, and then integrate into the project.

SuffolkPunch commented 3 years ago

I did install with pip3. The files are in folder ~/.local/lib/python3.6/site-packages/gopro2gpx But when I try to run it I get the following: ` python3 gopro2gpx --help

python3: can't open file 'gopro2gpx': [Errno 2] No such file or directory ` That's why I invoked using 'python3 -m etc'

I'm out of my depth!

Martin

Simske commented 3 years ago

Ah, now I understand. You don't even have to use the python3 command, the command is just gopro2gpx.

But if that doesn't work, python3 -m gopro2gpx.gopro2gpx works fine, you can just ignore the warning. My suggestions in the first comment are just suggestions how we can get rid of the warning, but you don't have to worry about that.

SuffolkPunch commented 3 years ago

Now I've found it: ~/.local/bin/gopro2gpx

Phew! Thanks for your patience!
(No need or your PR?)

Happy New Year,

Martin

Simske commented 3 years ago

No problem, Happy New Year to you too!

The PR is still a good idea to get rid of the warning, but there is no rush

Simske commented 3 years ago

With the Pull Reqest merged this issue can be closed