coursera-dl / edx-dl

A simple tool to download video lectures from edx.org (and other openedx sites)
GNU Lesser General Public License v3.0
1.93k stars 640 forks source link

ValueError: Attempted relative import in non-package #381

Open dmspratt opened 8 years ago

dmspratt commented 8 years ago

Hello, any assistance would be very much appreciated. I have been trying to troubleshoot.

I followed the instructions on https://github.com/coursera-dl/edx-dl for installation First error was: python: can't open file 'edx-dl.py': [Errno 2] No such file or directory realized it only works in ~/.local/lib/python3.5/site-packages/edx_dl and with edx_dl.py not edx-dl.py

Now when I input: python edx-dl.py -u user@user.com --list-courses (with my details of course and with edx_dl.py ) or even : python edx_dl.py --help

I get: Traceback (most recent call last): File "edx_dl.py", line 33, in from ._version import version ValueError: Attempted relative import in non-package

What am I doing wrong? Thanks

Your environment

Tell us how to reproduce this issue. Please provide us the course URL, and the specific subsection or unit if possible.

Expected behaviour

Tell us what should happen.

Actual behaviour

Tell us what happens instead. If the script fails, please copy the entire output of the command or the stacktrace (don't forget to obfuscate your username and password). If you cannot copy the exception, attach a screenshot.

kidult00 commented 8 years ago

I've got the same problem

r00tdr1v3 commented 8 years ago

You can edit the edx_dl.py file and remove . before the ._version (line 33). Also do it on the other lines where packages are imported form ._XXX. This is to be done in parsing.py file also. It worked for me.