Page MenuHomePhabricator

Improve user message asking for package to be installed
Closed, DuplicatePublic

Description

After Downloading Python 3.5 and the latest nightly build from http://tools.wmflabs.org/pywikibot/ I tried to follow https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation#Configuring_Pywikibot

I did

> cd C:\Users\Jonatan\Desktop\pywikibot\core
> pwb.py login

and got this result back

ImportError: No module named 'requests'
Python module requests is required.
Try running 'pip install requests'.

'pip install requests' doesnt work by default on Windows on Python 3.5

Instead instruct the user to do python -m pip install requests

(and the same for all other pip instructions)

An alternative is to just do the install for the user. At least on Windows.

Event Timeline

Josve05a created this task.May 6 2016, 11:58 PM
Restricted Application added subscribers: pywikibot-bugs-list, Zppix, Aklapper. · View Herald TranscriptMay 6 2016, 11:58 PM
jayvdb added a subscriber: jayvdb.

We need to document on that page that requests needs to be installed, by running:

pip install requests
Restricted Application added a project: Documentation. · View Herald TranscriptMay 7 2016, 1:03 AM
jayvdb triaged this task as Lowest priority.May 7 2016, 1:04 AM
jayvdb added a project: good first task.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptMay 7 2016, 1:04 AM

How do I do that?

C:\Users\Jonatan\Desktop\pywikibot\core>pip install requests
'pip' is not recognized as an internal or external command,
operable program or batch file.
jayvdb added a comment.May 7 2016, 1:17 AM

Does this work on Windows with Python 3.5?

python -m pip install requests

https://docs.python.org/3/installing/

>cd C:\Users\Jonatan\AppData\Local\Programs\Python\Python35-32

>python -m pip install requests
Collecting requests
  Downloading requests-2.10.0-py2.py3-none-any.whl (506kB)
    100% |################################| 507kB 169kB/s
Installing collected packages: requests
Successfully installed requests-2.10.0
You are using pip version 7.1.2, however version 8.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

> python -m pip install --upgrade pip
Collecting pip
  Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
    100% |################################| 1.2MB 88kB/s
Installing collected packages: pip
  Found existing installation: pip 7.1.2
    Uninstalling pip-7.1.2:
      Successfully uninstalled pip-7.1.2
Successfully installed pip-8.1.1
> cd C:\Users\Jonatan\Desktop\pywikibot\core
> peb.py login
NOTE: 'user-config.py' was not found!

etc. So it seems like that did it..

jayvdb renamed this task from ImportError: No module named 'requests' to Improve user message asking for package to be installed.May 7 2016, 1:41 AM
jayvdb raised the priority of this task from Lowest to High.
jayvdb updated the task description. (Show Details)