Skip to content
Advertisement

Python script not executing (No module named APNSWrapper)

In the terminal I run this command:

JavaScript

I have tried to install the module:

JavaScript

I have tried to install APNS:

JavaScript

I get the following error:

JavaScript

script code:

JavaScript

This is really frustrating me, not sure why the script is not executing.

Advertisement

Answer

Most likely pip and python point to different Python installations. One might be from package manager, one might be from the system defaults.

You can find this out by doing commands

which python

which pip

Probably pip installs packages against some other python installation you are trying to use.

The solution to the problem, no matter how it has manifested itself, is to use virtualenv environments for your Python package installations. virtualenv creates a self-contained folder containing the python interpreter and package installations, which you can wipe clean and rebuild in the case of problems.

First install virtualenv.

Then do:

JavaScript

More information about python and virtualenv installations

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement