Skip to content

Module is not working #5

Open
Open
@hygull

Description

@hygull

Today, I installed python_wpapi using pip and tried to execute my main.py file but failed.

The following is the install history on GIT BASH (Windows 10).

rishikesh agrawani@DESKTOP-8AATOO4 MINGW64 /d/projects/Tasks/PyLaTex/wordpress-api/src
$ pip install python_wpapi
Collecting python_wpapi
  Using cached python_wpapi-0.3.1-py2.py3-none-any.whl
Requirement already satisfied: requests in c:\anacondapython2.5.0.1\lib\site-packages (from python_wpapi)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\anacondapython2.5.0.1\lib\site-packages (from requests->python_wpapi)
Requirement already satisfied: idna<2.7,>=2.5 in c:\anacondapython2.5.0.1\lib\site-packages (from requests->python_wpapi)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\anacondapython2.5.0.1\lib\site-packages (from requests->python_wpapi)
Requirement already satisfied: certifi>=2017.4.17 in c:\anacondapython2.5.0.1\lib\site-packages (from requests->python_wpapi)
Installing collected packages: python-wpapi
Successfully installed python-wpapi-0.3.1

Now I created 2 files main.py and config.py inside my current directory /d/projects/Tasks/PyLaTex/wordpress-api/src.

config.py

USERNAME = "hygull";
PASSWORD = "^([A-Zm-z]{0-9})(WdPrs)$";

main.py

import config
from python_wpapi import WpApi;

username = config.USERNAME;
password = config.PASSWORD;

api1 = WpApi("https://hygull.wordpress.com");
print api1.get_posts();

When I tried to run, it shows me error as follows.

rishikesh agrawani@DESKTOP-8AATOO4 MINGW64 /d/projects/Tasks/PyLaTex/wordpress-api/src
$ python main.py
Traceback (most recent call last):
  File "main.py", line 2, in <module>
    from python_wpapi import WpApi;
ImportError: cannot import name WpApi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions