The simplest way is to run pwb.py from the root of the framework. So, if you got the code in c:\pywikibot-core and pywikibot in c:\pywikibot-core\pywikibot, you'd have something like:
c:\pywikibot-core> python pwb.py pywikibot\login.py
or, in general,
c:\pywikibot-core> python pwb.py c:\path\to\your\script.py
as pwb.py solves all the path-related issues.
You can also try to install pywikibot as a python library, with "python setup.py install", but I'm not sure if and how this works on Windows. If the install is successful, you should be able to import pywikibot from anywhere. After each update from git, you need to install the script again.
2013/10/19 Samat samat78@gmail.com:
Hi,
I had used pywikibot for years, but in the past years I didn't use it. Now, I would like to use it again on Windows7, therefore I downloaded the code from here: https://github.com/wikimedia/pywikibot-core using TortoiseSVN, and installed Python 2.7.5. I use the last version of these. I set the path for Python27, pywikipedia and pywikibot folders as PATH system variable. I have my own user-config.py file. I followed the instruction on https://www.mediawiki.org/wiki/Manual:Pywikipediabot/Windows
As I want to run login.py, I get this message: Traceback (most recent call last): File "C:\Program Files\pywikipedia\pywikibot\login.py", line 15, in
<module> import pywikibot ImportError: No module named pywikibot
I got similar error for other scripts: import module --> ImportError: No module named ...
Could you please help me, how could I solve this problem?
Thanks in advance.
Best regards, Samat
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l