ImportError zone.interface : Install on Ubuntu 16.04

467 views
Skip to first unread message

Michael Horne

unread,
Jul 27, 2016, 5:38:06 AM7/27/16
to Evennia
I have been trying to install Evennia on Ubuntu 16.04, but have run into a problem when I try and start Evennia:

Starting Evennia Server (output to stdout).

Starting Evennia Portal in Daemon mode (output to portal logfile).
Traceback (most recent call last):
  File "/home/mhorne/evennia/pyenv/bin/twistd", line 17, in <module>
    from twisted.scripts.twistd import run
  File "/home/mhorne/evennia/pyenv/local/lib/python2.7/site-packages/twisted/__init__.py", line 55, in <module>
    _checkRequirements()
  File "/home/mhorne/evennia/pyenv/local/lib/python2.7/site-packages/twisted/__init__.py", line 39, in _checkRequirements
    raise ImportError(required + ": no module named zope.interface.")
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zope.interface.
Traceback (most recent call last):
  File "/home/mhorne/evennia/pyenv/bin/twistd", line 17, in <module>
    from twisted.scripts.twistd import run
  File "/home/mhorne/evennia/pyenv/local/lib/python2.7/site-packages/twisted/__init__.py", line 55, in <module>
    _checkRequirements()
  File "/home/mhorne/evennia/pyenv/local/lib/python2.7/site-packages/twisted/__init__.py", line 39, in _checkRequirements
    raise ImportError(required + ": no module named zope.interface.")
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zope.interface.

As far as I can tell "pip" installed "zone.interface":

(pyenv) mhorne@ubuntu:~/evennia$ pip install -e evennia
Obtaining file:///home/mhorne/evennia/evennia
Collecting django<1.10,>=1.8 (from evennia==0.6.0)
  Downloading Django-1.9.8-py2.py3-none-any.whl (6.6MB)
    100% |████████████████████████████████| 6.6MB 164kB/s
Collecting twisted>=16.0.0 (from evennia==0.6.0)
  Downloading Twisted-16.3.0.tar.bz2 (2.9MB)
    100% |████████████████████████████████| 2.9MB 330kB/s
Collecting mock>=1.0.1 (from evennia==0.6.0)
  Downloading mock-2.0.0-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 1.9MB/s
Collecting pillow==2.9.0 (from evennia==0.6.0)
  Downloading Pillow-2.9.0.zip (9.6MB)
    100% |████████████████████████████████| 9.6MB 106kB/s
Collecting pytz (from evennia==0.6.0)
  Downloading pytz-2016.6.1-py2.py3-none-any.whl (481kB)
    100% |████████████████████████████████| 481kB 1.1MB/s
Collecting future>=0.15.2 (from evennia==0.6.0)
  Downloading future-0.15.2.tar.gz (1.6MB)
    100% |████████████████████████████████| 1.6MB 539kB/s
Collecting zope.interface>=3.6.0 (from twisted>=16.0.0->evennia==0.6.0)
  Downloading zope.interface-4.2.0.tar.gz (146kB)
    100% |████████████████████████████████| 153kB 1.6MB/s
Collecting six>=1.9 (from mock>=1.0.1->evennia==0.6.0)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting funcsigs>=1; python_version < "3.3" (from mock>=1.0.1->evennia==0.6.0)
  Downloading funcsigs-1.0.2-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock>=1.0.1->evennia==0.6.0)
  Downloading pbr-1.10.0-py2.py3-none-any.whl (96kB)
    100% |████████████████████████████████| 102kB 1.8MB/s
Requirement already satisfied (use --upgrade to upgrade): setuptools in ./pyenv/lib/python2.7/site-packages (from zope.interface>=3.6.0->twisted>=16.0.0->evennia==0.6.0)
Building wheels for collected packages: twisted, pillow, future, zope.interface
  Running setup.py bdist_wheel for twisted ... done
  Stored in directory: /home/mhorne/.cache/pip/wheels/15/de/04/8cc532a5dc14976d4cff2743eddc5c7ac50b53b097a7c059f4
  Running setup.py bdist_wheel for pillow ... done
  Stored in directory: /home/mhorne/.cache/pip/wheels/51/7c/4f/27d58e08ce5a904ab0262a1b6d24d2d8514ea37a737914dce1
  Running setup.py bdist_wheel for future ... done
  Stored in directory: /home/mhorne/.cache/pip/wheels/11/c5/d2/ad287de27d0f0d646f119dcffb921f4e63df128f28ab0a1bda
  Running setup.py bdist_wheel for zope.interface ... done
  Stored in directory: /home/mhorne/.cache/pip/wheels/20/a2/bc/74fe87cee17134f5219ba01fe82dd8c10998377e0fb910bb22
Successfully built twisted pillow future zope.interface
Installing collected packages: django, zope.interface, twisted, six, funcsigs, pbr, mock, pillow, pytz, future, evennia
  Running setup.py develop for evennia
Successfully installed django-1.9.8 evennia funcsigs-1.0.2 future-0.15.2 mock-2.0.0 pbr-1.10.0 pillow-2.9.0 pytz-2016.6.1 six-1.10.0 twisted-16.3.0 zope.interface-4.2.0

I am running python version 2.x:

(pyenv) mhorne@ubuntu:~/evennia/mygame$ python --version
Python 2.7.12

The error message implies I need version 3.6.0 or later and version 4.2.0 was installed.

I am not sure what to check / fix now. What could be the issue?



Griatch Art

unread,
Jul 27, 2016, 6:20:35 AM7/27/16
to Evennia
Hi and welcome to the list!

Sorry to hear you have trouble. I can't test with a Ubuntu 16 at this time, but installing it on Mint, which is based on Ubuntu 14, works without trouble. From your output it does look like you are getting all that you need so the error is quite confusing.

You could try to run pip install --upgrade -e evennia to see if you get updated versions of any of the dependencies (you can do pip install --upgrade twisted to separately upgrade only twisted too, if you prefer). It probably won't do anything, but worth a shot.

Another possibility is that your virtualenv is somehow messed up or part of it is installed as root while other parts are not (you should not need to be root for any of the virtualenv installation, not even the creation of the pyenv folder itself). So just to try, you could deactivate your virtualenv (run the deactivate command) and delete it, then recreate it from scratch. You can also do pip list from your virtualenv to verify what versions are available in your virtualenv.

If the problem remains it might be some sort of issue with your twisted package. You might want to try stepping back a version to see if that helps, for example using pip install twisted==15.9.0 (or whichever version was the one before yours).

If there is indeed something strange with the Twisted package you could also try to install zope again, manually, just to see what is available in the pypi repository and try some other version than the one you get auomatically.

Try that, see if it works, let us know if so.
.
Griatch

Caliah Vallaire

unread,
Jul 27, 2016, 9:57:58 PM7/27/16
to Evennia
For what its worth, I have Evennia up and running on Ubuntu 16. I don't recall doing anything other than making sure to run Python 2.7

Michael Horne

unread,
Jul 28, 2016, 5:45:50 AM7/28/16
to Evennia
Hi,

Yes I read this bit int he requirements and I am using Python 2.7.12. But, that youhave it running, gives me hope!

Many thanks,

Michael Horne

unread,
Jul 28, 2016, 6:26:58 AM7/28/16
to Evennia
Thanks for the help.

I recreated the virtual envirtonment but it did not help. I explicitly installed version 3.6.0 of Zope.interface (It had 4.2.0 installed), but this did not help (Same error)

(pyenv) mhorne@ubuntu:~/evennia/mygame$ pip list
Django (1.9.8)
evennia (0.6.0, /home/mhorne/evennia/evennia)
funcsigs (1.0.2)
future (0.15.2)
mock (2.0.0)
pbr (1.10.0)
Pillow (2.9.0)
pip (8.1.2)
pkg-resources (0.0.0)
pytz (2016.6.1)
setuptools (25.1.0)
six (1.10.0)
Twisted (16.3.0)
wheel (0.29.0)
zope.interface (3.6.0)

I have tried to explicitly installing Twisted version 16.0.0, but this did not help

I am new to python, but I tried to manually execute the procedure that seems to cause the message in the interpreter:

(pyenv) mhorne@ubuntu:~/evennia/mygame$ python
Python 2.7.12 (default, Jul  1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> def _checkRequirements():
...     # Don't allow the user to run a version of Python we don't support.
...     import sys
...    
...     version = getattr(sys, "version_info", (0,))
...     if version < (2, 7):
...         raise ImportError("Twisted requires Python 2.7 or later.")
...     elif version >= (3, 0) and version < (3, 3):
...         raise ImportError("Twisted on Python 3 requires Python 3.3 or later.")
...     if version < (3, 0):
...         required = "3.6.0"
...     else:
...         required = "4.0.0"
...     
...     if ("setuptools" in sys.modules and
...         getattr(sys.modules["setuptools"],
...                 "_TWISTED_NO_CHECK_REQUIREMENTS", None) is not None):
...         # Skip requirement checks, setuptools ought to take care of installing
...         # the dependencies.
...         return
...    
...     # Don't allow the user to run with a version of zope.interface we don't
...     # support.
...     required = "Twisted requires zope.interface %s or later" % (required,)
...     try:
...         from zope import interface
...     except ImportError:
...         # It isn't installed.
...         raise ImportError(required + ": no module named zope.interface.")
...     except:
...         # It is installed but not compatible with this version of Python.
...         raise ImportError(required + ".")
...     try:
...         # Try using the API that we need, which only works right with
...         # zope.interface 3.6 (or 4.0 on Python 3)
...         class IDummy(interface.Interface):
...             pass
...         @interface.implementer(IDummy)
...         class Dummy(object):
...             pass
...     except TypeError:
...         # It is installed but not compatible with this version of Python.
...         raise ImportError(required + ".")
...
>>> _checkRequirements()
>>>


I do not know if this is the correct way to test manually, but I was able to define the procedure and manually execute it without any exceptions being raised.

Michael Horne

unread,
Jul 28, 2016, 7:02:55 AM7/28/16
to Evennia
I just tried the latest version of Mint (Mint 18 Cinnamon 64-bit) and I get the same error at the same point:


Michael Horne

unread,
Jul 28, 2016, 8:19:38 AM7/28/16
to Evennia
that version on Mnit was also based on Ubuntu 16, so I have installed an older verions on Ubuntu (14.04 LTS) and it works fine.

Baron Von Clop

unread,
Aug 4, 2016, 5:09:09 AM8/4/16
to Evennia
Having this exact same issue. Sparkling new VPS on DigitalOcean with Ubuntu 16. I have tried all solutions posted so far with no results.

Strika

unread,
Aug 4, 2016, 11:34:08 PM8/4/16
to Evennia
I'm running everything on Xubuntu 16.04 and have been for some time.

Distributor ID:    Ubuntu
Description:    Ubuntu 16.04 LTS
Release:    16.04
Codename:    xenial

My Python version is listed as "Python 2.7.11+" for some reason. It's in a virtualenv.

Here are the pip module versions I'm using. Some of them are not related to Evennia.

Django (1.9.7)
evennia (0.6.0, /home/johnny/workspace/evennia)

funcsigs (1.0.2)
future (0.15.2)
mock (2.0.0)
pbr (1.10.0)
Pillow (2.9.0)
pip (8.1.2)
pkg-resources (0.0.0)
pudb (2016.2)
Pygments (2.1.3)
pytz (2016.4)
setuptools (23.1.0)
six (1.10.0)
Twisted (16.2.0)
urwid (1.3.1)
wheel (0.29.0)
zope.interface (4.2.0)

Maybe try matching up your (Evennia-related) module versions with mine? I can attest that zope v4 does work...

Griatch Art

unread,
Aug 6, 2016, 1:50:47 PM8/6/16
to Evennia
Hi folks,

Now that I'm back at my regular machine, I started up a virtualbox with Ubuntu 16.04 LTE and could confirm the issue with zope.interface not being found despite pip reporting it being there. This appears to be a install detection bug in zope.interface's installer on this particular version of Linux. What happens is that zope does not correctly create an empty __init__.py file at the top of its package. Lacking this means zope's not identified as a Python package to the running Python system even though the source files are all there. Hence the error.

The solution is simple. If your virtualenv is called "pyenv" like in the Getting Started instructions, then issue the following command:

touch pyenv/local/lib/python2.7/site-packages/zope/__init__.py

That will create the missing __init__.py file and things will work fine thereafter. I also added this fix at the end of the Linux install instructions so it's not forgotten.

.
Griatch



On Wednesday, July 27, 2016 at 11:38:06 AM UTC+2, Michael Horne wrote:

Jason S

unread,
Apr 6, 2017, 5:52:00 PM4/6/17
to Evennia
My apologies for beating a dead horse here, but I have done all of this and still having the same issue.


Starting Evennia Server (output to stdout).

Starting Evennia Portal in Daemon mode (output to portal logfile).
Traceback (most recent call last):
  File "/home/jason/code/Evennia/evenniaenv/bin/twistd", line 7, in <module>
    from twisted.scripts.twistd import run
  File "/home/jason/code/Evennia/evenniaenv/local/lib/python2.7/site-packages/twisted/scripts/twistd.py", line 13, in <module>
    from twisted.application import app
  File "/home/jason/code/Evennia/evenniaenv/local/lib/python2.7/site-packages/twisted/application/app.py", line 17, in <module>
    from twisted import copyright, plugin, logger
  File "/home/jason/code/Evennia/evenniaenv/local/lib/python2.7/site-packages/twisted/plugin.py", line 18, in <module>
    from zope.interface import Interface, providedBy
ImportError: No module named zope.interface

Traceback (most recent call last):
  File "/home/jason/code/Evennia/evenniaenv/bin/twistd", line 7, in <module>
    from twisted.scripts.twistd import run
  File "/home/jason/code/Evennia/evenniaenv/local/lib/python2.7/site-packages/twisted/scripts/twistd.py", line 13, in <module>
    from twisted.application import app
  File "/home/jason/code/Evennia/evenniaenv/local/lib/python2.7/site-packages/twisted/application/app.py", line 17, in <module>
    from twisted import copyright, plugin, logger
  File "/home/jason/code/Evennia/evenniaenv/local/lib/python2.7/site-packages/twisted/plugin.py", line 18, in <module>
    from zope.interface import Interface, providedBy
ImportError: No module named zope.interface



Vincent LE GOFF

unread,
Apr 6, 2017, 7:14:40 PM4/6/17
to eve...@googlegroups.com

Jason,


There's actually mention of this very issue on the installation page, if I'm not mistaken).


> Some versions of Ubuntu 16 features an issue where you can't start the server but get an error saying "Twisted requires zope.interface 3.6.0 or later: no module named zope.interface.". This even though a much later version of  zope.interface  is clearly installed in the virtualenv (as verified with  pip list ). This appears to be due to a bug in the zope installer; it fails to install an empty  __init__.py  file. To fix this, issue the following command:  touch pyenv/local/lib/python2.7/site-packages/zope/__init__.py . That creates the file and things should then work correctly.


(From https://github.com/evennia/evennia/wiki/Getting-Started)


Have you tried this?


HTH,


Vincent

--
You received this message because you are subscribed to the Google Groups "Evennia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evennia+u...@googlegroups.com.
To post to this group, send email to eve...@googlegroups.com.
Visit this group at https://groups.google.com/group/evennia.
To view this discussion on the web visit https://groups.google.com/d/msgid/evennia/b5029021-5423-4532-ab0f-cd20e7c5a8d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages