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

ImportError: No module named request on Windows #305

Closed
GijsTimmers opened this issue Jun 4, 2015 · 5 comments
Closed

ImportError: No module named request on Windows #305

GijsTimmers opened this issue Jun 4, 2015 · 5 comments

Comments

@GijsTimmers
Copy link

When starting mpsyt.exe from cmd, mps-youtube does not start:

Microsoft Windows [versie 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle rechten voorbehouden.

C:\Users\User>mpsyt.exe
Traceback (most recent call last):
  File "C:\Python27\Scripts\mpsyt-script.py", line 9, in <module>
    load_entry_point('mps-youtube==0.2.5', 'console_scripts', 'mpsyt')()
  File "C:\python27\lib\site-packages\pkg_resources.py", line 356, in load_entry
_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\python27\lib\site-packages\pkg_resources.py", line 2472, in load_entr
y_point
    return ep.load()
  File "C:\python27\lib\site-packages\pkg_resources.py", line 2186, in load
    ['__name__'])
  File "C:\python27\lib\site-packages\mps_youtube\__init__.py", line 1, in <modu
le>
    from .main import init
  File "C:\python27\lib\site-packages\mps_youtube\main.py", line 54, in <module>

    from urllib.request import urlopen, build_opener
ImportError: No module named request

C:\Users\User>

I'm running mps-youtube 0.2.5:

C:\Users\User>pip.exe list
colorama (0.3.1)
colorconsole (0.7.1)
cx-Freeze (4.3.3)
distribute (0.7.3)
keyring (4.0)
mechanize (0.2.5)
mps-youtube (0.2.5)
netifaces (0.10.4)
numpy (1.9.1)
pafy (0.3.74)
pip (1.5.6)
progressbar-latest (2.4)
PyInstaller (2.1)
pywin32 (219)
requests (2.7.0)
setuptools (5.7)
tabulate (0.7.3)
urllib3 (1.10.4)
youtube-dl (2015.05.20)
@lol768
Copy link
Contributor

lol768 commented Jun 4, 2015

Python27

Please consider using pip3 or similar. I don't think Python 2 is supported.

@GijsTimmers
Copy link
Author

@lol768 That fixed it! Thank you.

For those after me:

sudo pip uninstall mps-youtube
sudo apt-get install python3-pip
sudo pip3 install mps-youtube

Windows:

  1. pip.exe uninstall mps-youtube
  2. download Python 3 from the official website, make sure to add Python 3 to the PATH during installation
  3. pip3.exe install mps-youtube

Ubuntu:

sudo pip uninstall mps-youtube
sudo apt-get install python3-pip
sudo pip3 install mps-youtube

@myleandro
Copy link

@GijsTimmers question - how on earth didja get apt-get and sudo onto windows? :)

@myleandro
Copy link

For others (part 2):

  1. Cygwin && install python3 and wget (./setup-x86_64.exe). You can have python2.7 installed side by side (I did - check which is default with python -v, but also run python3 to verify it is installed and in path)
  2. Grab get-pip.py ( wget https://bootstrap.pypa.io/get-pip.py)
  3. pip3 list (ensure using python3 version of request is there as per above thread)
  4. pip3 install colorama && pip3 install mps-youtube
  5. mpsyt - you're good to go.

@GijsTimmers
Copy link
Author

Heh. Turned out I had the problem on both Windows and Ubuntu, which makes sense. Edited.

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

3 participants