Page MenuHomePhabricator

pip install pywikibot is not straightforward
Closed, ResolvedPublic


In November 2014, pip install --allow-all-external --allow-unverified pywikibot pywikibot==2.0b1 was the necessary command needed get pywikibot to install into an virtualenv.

Pywikibot should have actual tarballs uploaded into pypi to make installation easier.

At the 2015 Lyon Hackathon, tarballs were uploaded to pypi, however it is a pre- release, so the current command needed is:

pip install --pre pywikibot

Releasing pywikibot with a a normal version number, with a tarball on pypi, will mean users can do pip install pywikibot



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:18 AM
bzimport set Reference to bz65176.
bzimport added a subscriber: Unknown Object (????).
Legoktm created this task.May 11 2014, 7:43 AM
jayvdb set Security to None.
jayvdb removed a subscriber: Unknown Object (????).
jayvdb moved this task from Backlog to Next release on the Pywikibot board.Nov 30 2014, 3:15 PM

I recently installed pywikibot on a Tool Labs virtualenv via pip and a requirements.txt file and it's working pretty well...

valhallasw added a subscriber: valhallasw.EditedFeb 17 2015, 1:44 PM

Older versions of pip implicitly use --allow-all-external --allow-unverified; newer versions do not. Try

virtualenv test
source test/bin/activate
pip install --upgrade pip
pip install pywikibot
Dalba added a subscriber: Dalba.Mar 7 2015, 12:05 PM
jayvdb added a comment.EditedMay 27 2015, 3:26 PM is now a normal package , so pip install --pre pywikibot works. The --pre is needed because the release on pypi is a pre-release.

Fhocutt added a subscriber: Fhocutt.EditedJul 19 2015, 10:12 PM

Correct command is:

pip install pywikibot --pre


pip install --pre pywikibot

Pip interprets the first argument as the option, which should be install.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 19 2015, 10:12 PM
jayvdb updated the task description. (Show Details)Jul 27 2015, 8:52 PM
This comment was removed by Ash_Crow.

This seems to work now.

$ pip install pywikibot
Collecting pywikibot
  Downloading pywikibot-2.0rc4.tar.gz (909kB)
    100% |████████████████████████████████| 913kB 131kB/s 
Collecting httplib2>=0.9 (from pywikibot)
  Downloading httplib2-0.9.2.tar.gz (205kB)
    100% |████████████████████████████████| 208kB 471kB/s 
Requirement already satisfied (use --upgrade to upgrade): ipaddress in /home/ajk/.pyenv/versions/2.7.11/lib/python2.7/site-packages (from pywikibot)
Installing collected packages: httplib2, pywikibot
  Running install for httplib2 ... done
  Running install for pywikibot ... done
Successfully installed httplib2-0.9.2 pywikibot-2.0rc4
jayvdb closed this task as Resolved.Jun 8 2016, 2:02 PM
jayvdb claimed this task.

Not for me.

$ sudo pip install pywikibot
Downloading/unpacking pywikibot
  Could not find a version that satisfies the requirement pywikibot (from versions: 2.0rc3, 2.0rc4, 2.0rc1.post2, 2.0rc1.post1)
Cleaning up...
No distributions matching the version for pywikibot
Storing debug log for failure in /home/osboxes/.pip/pip.log
jayvdb reopened this task as Open.Jun 9 2016, 10:46 AM

Possible, older versions of pip do not consider rc versions to match without the --pre arg,
My pip (v8.1.1) takes a dev/rc/alpha/beta version if there is no stable release released on pypi yet.
For example, pip install file-metadata installs a dev version, because there has been no stable version of file-metadata released yet. But for @DrTrigon pip install file-metadata had failed, and it only worked with the --pre tag.

jayvdb added a comment.Jun 9 2016, 4:07 PM

Yea. We really should get a final release out before closing this.

DrTrigon added a comment.EditedJun 22 2016, 10:39 AM

Say the installation through pip works. What is the correct way of calling afterwards in order to create Clone pywikibot to a seperate dir? Why is it useful to install a package and clone it as well? That just creates confusion which code is run, which to change and whether everything was updated?!?

$ python
python: can't open file '': [Errno 2] No such file or directory
$ python -c'import pywikibot; print pywikibot.__version__'
RuntimeError: No found in directory '/home/osboxes'.
  Please check that is stored in the correct location.
  Directory where is searched is determined as follows:

This task is about the library only. Pwb is not included. Apps using
pywikibot can distribute their own cli scripts with thier

So we have 2 different kinds of "packages"? 1 containing pywikibot-core/pywikibot/ and 1 containing pywikibot-core/ and pywikibot-core/scripts/ etc.?

How about using pywikibot-core from a local folder? Does this still work? Is this supported?

So we have 2 different kinds of "packages"? 1 containing pywikibot-core/pywikibot/ and 1 containing pywikibot-core/ and pywikibot-core/scripts/ etc.?

More or less, yes. One which you pip install (for use in 3rd party scripts/libraries), and one which is the 'pywikibot bundle' which includes and the scripts.

How about using pywikibot-core from a local folder? Does this still work? Is this supported?


IMO this task about the library is solved with pywikibot 3.

T164095 about the scripts is a very different and harder problem, which is important but we've neglected partially because it is hard technically and also there is the more social question of script management (one official set, or splitting them into groups, or ???) which hasnt been resolved as far as I know (but I've been away for a while).

Xqt raised the priority of this task from Medium to High.May 28 2017, 11:52 AM
valhallasw closed this task as Resolved.May 28 2017, 11:53 AM