Last modified: 2014-07-25 06:59:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T63783, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 61783 - Install fails in virtualenv
Install fails in virtualenv
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-21 22:53 UTC by Cristian Consonni
Modified: 2014-07-25 06:59 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Detailed walktrough to reproduce the bug (24.15 KB, text/plain)
2014-02-21 22:53 UTC, Cristian Consonni
Details

Description Cristian Consonni 2014-02-21 22:53:57 UTC
Created attachment 14657 [details]
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.
Comment 1 Merlijn van Deen (test) 2014-02-21 23:07:06 UTC
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)?
Comment 2 Morten Wang 2014-03-27 20:05:43 UTC
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)]
Comment 3 Gerrit Notification Bot 2014-03-27 21:45:27 UTC
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
Comment 4 Gerrit Notification Bot 2014-04-08 13:32:36 UTC
Change 121535 merged by jenkins-bot:
Bug 61783: also install root pywikibot package

https://gerrit.wikimedia.org/r/121535
Comment 5 frances.hocutt 2014-07-25 06:59:38 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links