https://bugzilla.wikimedia.org/show_bug.cgi?id=61783
Bug ID: 61783 Summary: Install fails in virtualenv Product: Pywikibot Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: kikkocristian@gmail.com Web browser: --- Mobile Platform: ---
Created attachment 14657 --> https://bugzilla.wikimedia.org/attachment.cgi?id=14657&action=edit Detailed walktrough to reproduce the bug
Steps to reproduce: * get pywikibot from http://tools.wmflabs.org/pywikibot/core.tar.gz * tar extract that file * create a virtualenv (e.g. pywikibottest) * workon that virtualenv * install the package following install instructions (basically python setup.py install)
Import of pywikibot fails.
See attachment for details.
https://bugzilla.wikimedia.org/show_bug.cgi?id=61783
Merlijn van Deen valhallasw@arctus.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |valhallasw@arctus.nl
--- Comment #1 from Merlijn van Deen valhallasw@arctus.nl --- Seems to work for me:
$ virtualenv bug61783 $ source bug61783/bin/activate $ curl http://tools.wmflabs.org/pywikibot/core.tar.gz | tar xvz $ cd core $ python setup.py install $ python Python 2.7.3 (default, Sep 26 2013, 20:03:06) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import pywikibot
The path looks comparable: ['', '/home/valhallasw/bug61783/bin',
'/home/valhallasw/bug61783/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',
'/home/valhallasw/bug61783/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
'/home/valhallasw/bug61783/local/lib/python2.7/site-packages/Pywikipediabot-2.0b1-py2.7.egg',
'/home/valhallasw/bug61783/local/lib/python2.7/site-packages/httplib2-0.8_pywikibot1-py2.7.egg', '/home/valhallasw/bug61783/lib/python2.7', '/home/valhallasw/bug61783/lib/python2.7/plat-linux2', '/home/valhallasw/bug61783/lib/python2.7/lib-tk', '/home/valhallasw/bug61783/lib/python2.7/lib-old', '/home/valhallasw/bug61783/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/home/valhallasw/bug61783/local/lib/python2.7/site-packages',
'/home/valhallasw/bug61783/local/lib/python2.7/site-packages/IPython/extensions']
except for the slightly different distribute version...
What version of setuptools have you installed? Anything newer than 1.1.6 (which is what ez_setup.py specifies)?
https://bugzilla.wikimedia.org/show_bug.cgi?id=61783
Morten Wang warnckew@online.no changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |warnckew@online.no
--- Comment #2 from Morten Wang warnckew@online.no --- I'm seeing the same issue if I move out of the source directory before executing Python. If I run from the core directory it simply imports it from './pywikibot', which of course is successful.
Python version: 2.7.3 virtualenv version: 1.7.1.2
So after 'python setup.py install' I do: cd .. python Python 2.7.3 (default, Feb 27 2014, 19:58:35) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import pywikibot
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named pywikibot
This happens even though the pywikibot modules appears to be in the path:
import sys sys.path
['', '/export/scratch/morten/bug61783/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg', '/export/scratch/morten/bug61783/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg', '/export/scratch/morten/bug61783/local/lib/python2.7/site-packages/Pywikipediabot-2.0b1-py2.7.egg', '/export/scratch/morten/bug61783/local/lib/python2.7/site-packages/httplib2-0.8_pywikibot1-py2.7.egg', (rest omitted for brevity)]
https://bugzilla.wikimedia.org/show_bug.cgi?id=61783
--- Comment #3 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 121535 had a related patch set uploaded by Merlijn van Deen: Bug 61783: also install root pywikibot package
https://gerrit.wikimedia.org/r/121535
https://bugzilla.wikimedia.org/show_bug.cgi?id=61783
Gerrit Notification Bot gerritadmin@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |PATCH_TO_REVIEW Ever confirmed|0 |1
https://bugzilla.wikimedia.org/show_bug.cgi?id=61783
--- Comment #4 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 121535 merged by jenkins-bot: Bug 61783: also install root pywikibot package
https://gerrit.wikimedia.org/r/121535
https://bugzilla.wikimedia.org/show_bug.cgi?id=61783
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED CC| |info@gno.de Resolution|--- |FIXED
https://bugzilla.wikimedia.org/show_bug.cgi?id=61783
frances.hocutt@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |frances.hocutt@gmail.com
--- Comment #5 from frances.hocutt@gmail.com --- I was not able to use pywikibot in a virtualenv (installed using `pip install pywikibot` as in directions here: https://bugzilla.wikimedia.org/show_bug.cgi?id=65176) until I put a copy of user-config.py in my home directory.
Once I added user-config.py to my home directory, `import pywikibot` ran without error in the interpreter.
pywikipedia-bugs@lists.wikimedia.org