Page MenuHomePhabricator

pip install pywikibot is not straightforward
Closed, ResolvedPublic

Description

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

Details

Reference
bz65176

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 (????).
jayvdb set Security to None.
jayvdb removed a subscriber: Unknown Object (????).

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

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

https://pypi.python.org/pypi/pywikibot is now a normal package , so pip install --pre pywikibot works. The --pre is needed because the release on pypi is a pre-release.

Correct command is:

pip install pywikibot --pre

or

pip install --pre pywikibot

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

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 setup.py install for httplib2 ... done
  Running setup.py install for pywikibot ... done
Successfully installed httplib2-0.9.2 pywikibot-2.0rc4
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

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.

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

Say the installation through pip works. What is the correct way of calling pwb.py afterwards in order to create user-config.py? 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 pwb.py
python: can't open file 'pwb.py': [Errno 2] No such file or directory
$ python -c'import pywikibot; print pywikibot.__version__'
[...]
RuntimeError: No user-config.py found in directory '/home/osboxes'.
  Please check that user-config.py is stored in the correct location.
  Directory where user-config.py 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 setup.py

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 pwb.py and the scripts.

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

Yes.

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