dgorissen / coursera-dl

A script for downloading course material (video's, pdfs, quizzes, etc) from coursera.org
http://dirkgorissen.com/2012/09/07/coursera-dl-a-coursera-download-script/
GNU General Public License v3.0
1.74k stars 300 forks source link

ImportError: No module named '_version' #127

Closed vmatyushin closed 10 years ago

vmatyushin commented 10 years ago
% pip3.4 install coursera-dl
...
Successfully installed coursera-dl argparse beautifulsoup4 requests six
% coursera-dl 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/bin/coursera-dl", line 9, in <module>
    load_entry_point('coursera-dl==2.0.1', 'console_scripts', 'coursera-dl')()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 353, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2302, in load_entry_point
    return ep.load()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2029, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/courseradownloader/courseradownloader.py", line 1, in <module>
    import _version
ImportError: No module named '_version'

This reproduces in OS X 10.9/Python 3.4 and Arch Linux/Python 3.3.

ghost commented 10 years ago

Same problem here, also using Arch Linux/Python 3.3. Installing it from git yielded (almost) the same error.

Traceback (most recent call last):
  File "/usr/bin/coursera-dl", line 9, in <module>
    load_entry_point('coursera-dl==2.0.1', 'console_scripts', 'coursera-dl')()
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python3.3/site-packages/coursera_dl-2.0.1-py3.3.egg/courseradownloader/courseradownloader.py", line 1, in <module>
ImportError: No module named '_version'
dgorissen commented 10 years ago

This is probably python 3 related. Try with 2.7. Will try to look at this but have little bandwidth. Probably something simple though, pull requests welcome.

On Fri, Mar 21, 2014 at 8:54 PM, knoedelformer notifications@github.comwrote:

Same problem here, also using Arch Linux/Python 3.3. Installing it from git yielded (almost) the same error.

Traceback (most recent call last): File "/usr/bin/coursera-dl", line 9, in load_entry_point('coursera-dl==2.0.1', 'console_scripts', 'coursera-dl')() File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 2363, in load_entry_point return ep.load() File "/usr/lib/python3.3/site-packages/pkg_resources.py", line 2088, in load entry = import(self.module_name, globals(),globals(), ['name']) File "/usr/lib/python3.3/site-packages/coursera_dl-2.0.1-py3.3.egg/courseradownloader/courseradownloader.py", line 1, in ImportError: No module named '_version'

Reply to this email directly or view it on GitHubhttps://github.com/dgorissen/coursera-dl/issues/127#issuecomment-38322980 .

ghost commented 10 years ago

You're right! Works fine after installing python2-pip on Arch Linux and installing it via pip2 install coursera-dl. Thanks.

I realize it was silly of me not to try it with Python 2, but it might be helpful to make it obvious in the README.

vmatyushin commented 10 years ago
--- /Users/user/Downloads/courseradownloader.py 2014-04-01 15:32:28.000000000 +0400
+++ courseradownloader.py   2014-04-01 15:30:23.000000000 +0400
@@ -1,4 +1,4 @@
-import _version
+from courseradownloader import _version
 import argparse
 import getpass
 import json
@@ -15,7 +15,7 @@
 from bs4 import BeautifulSoup
 from os import path
 from six import print_
-from util import *
+from courseradownloader.util import *

 class CourseraDownloader(object):

This patch fixes the issue for me in OS X.

dgorissen commented 10 years ago

Awesome, thanks. Can you issue a pull request.


Dr. Dirk Gorissen Research - Tech4Good - Flying Robots Web : http://dirkgorissen.com Twitter : https://twitter.com/elazungu LinkedIn: http://www.linkedin.com/in/dirkgorissen

On Tue, Apr 1, 2014 at 12:33 PM, Vyacheslav Matyushin < notifications@github.com> wrote:

--- /Users/user/Downloads/courseradownloader.py 2014-04-01 15:32:28.000000000 +0400 +++ courseradownloader.py 2014-04-01 15:30:23.000000000 +0400 @@ -1,4 +1,4 @@ -import _version +from courseradownloader import version import argparse import getpass import json @@ -15,7 +15,7 @@ from bs4 import BeautifulSoup from os import path from six import print -from util import +from courseradownloader.util import

class CourseraDownloader(object):

This patch fixes the issue for me in OS X.

Reply to this email directly or view it on GitHubhttps://github.com/dgorissen/coursera-dl/issues/127#issuecomment-39195243 .