Not available in Python 3

Asked by Friedrich Herbst

I would like to use this Package in Python 3.4 but if I want to import it with "import NetworkManager" it shows:
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named 'NetworkManager'
In Python 2.7 it works and on this site ("https://pypi.python.org/pypi/python-networkmanager") it says that its also compatible to Python 3. I haven't got any ideas.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu python-networkmanager Edit question
Assignee:
No assignee Edit question
Solved by:
Friedrich Herbst
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

lsb_release -a; uname -a

Thanks

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

If I look at http://packages.ubuntu.com/trusty/all/python-networkmanager/filelist it seems to me that this package has been prepared only for pyton2.7

Taking other packages as model I assume that for python 3 an additional package python3-networkmanager would be necessary.

You might try whether just copying /usr/lib/python2.7/dist-packages/NetworkManager.py and /usr/lib/python2.7/dist-packages/python_networkmanager-0.9.10.egg-info into the /usr/lib/python3/dist/packages/ directory is enough to make it accessible by python 3.

Revision history for this message
Friedrich Herbst (tuxubuntu) said :
#3

Thanks for your help. I found the solution: I installed it via pip3:
sudo pip3 install python-networkmanager