2

Getting error:

Traceback (most recent call last): File "C:/Python33/Lib/123.py", line 5, in <module> from wordpress_xmlrpc import Client, WordPressPost File "C:/Python33/lib/site-packages/wordpress_xmlrpc/__init__.py", line 6, in <module> import base ImportError: No module named 'base' 

base.py is located in:

C:\Python33\Lib\site-packages\wordpress_xmlrpc\ 

__init__.py looks like:

from base import * from wordpress import * import methods 

All other imports I use work fine.

Path variables look like:

C:\Python33;C:\Python33\Scripts;C:\Python33\Lib\site-packages;C:\Python33\Lib\site-packages\wordpress_xmlrpc;C:\Python33\Lib; 

Does anyone know why I get this error?

2
  • 1
    Your own application wouldn't happen to change the path variables run-time, would it? Commented Jul 28, 2013 at 17:39
  • from foo import * is usually frowned on. Commented Jul 28, 2013 at 17:43

2 Answers 2

1

You need to use either explicit relative or absolute imports when you use python3, so

from wordpress_xmlrpc import base # or from . import base 

In python3 import base would only import an absolute package base, as implicit relative imports are no longer supported.

Sign up to request clarification or add additional context in comments.

Comments

0

Relative imports are used with a "." when using python 3.

Please see the already ansewred question

link

1 Comment

Relative imports are permitted in py3, just not implicit relative imports. You need the explicit form (from . import ...)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.