This time, I managed to figure it out myself. There were two problems:
The first problem was that I had *two* versions of fabric installed - one I
had installed with pip, and one I had installed with "sudo apt install
fabric". Once I removed that one ("sudo apt remove fabric"), I got a
different error.
This new error complained about not finding fabric.api. It turned out, my
version of fabric was too new, because apparently, they had changed a lot
of stuff in fabric 2.0.0. So I had to figure out which was the newest 1.x
version of fabric. That I did by typing "pip install fabric==foo", where
"foo" is supposed to be a version number - but since the version number is
invalid, pip will respond with the available versions, and it turned out
that 1.2.2 was the one I wanted - so "pip install fabric==1.2.2" did the
trick.
Den lördag 12 januari 2019 kl. 17:25:10 UTC+1 skrev Christer Enfors:
>
> Hi, it's me again, everybody's favorite mailinglist spammer. Sorry about
> that, but I really want to get Mezzanine fully working for my local Python
> user group.
>
> This time I'm having trouble running 'fab', it can't seem to find
> Mezzanine. I've activated my virtual environment (PyVarm) in which
> Mezzanine is installed (I have a two line prompt
> <https://hackernoon.com/why-linux-developers-should-use-gitprompt-8d654e5b87e1>,
>
> so it may not be obvious, but I am indeed using the venv).
>
> (PyVarm) [16:44] enfors @ shodan: ~/devel/python/PyVarm
> $ fab secure
> Traceback (most recent call last):
> File "/usr/lib/python2.7/dist-packages/fabric/main.py", line 658, in
> main
> docstring, callables, default = load_fabfile(fabfile)
> File "/usr/lib/python2.7/dist-packages/fabric/main.py", line 165, in
> load_fabfile
> imported = importer(os.path.splitext(fabfile)[0])
> File "/home/enfors/devel/python/PyVarm/fabfile.py", line 14, in <module>
> from mezzanine.utils.conf import real_project_name
> ImportError: No module named mezzanine.utils.conf
>
>
> (PyVarm) Exit status: 1 [16:44] enfors @ shodan: ~/devel/python/PyVarm
> $ python
> Python 2.7.12 (default, Nov 12 2018, 14:36:49)
> [GCC 5.4.0 20160609] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import mezzanine
> >>> import mezzanine.utils
> >>> import mezzanine.utils.conf
> >>>
>
>
> (PyVarm) [16:46] enfors @ shodan: ~/devel/python/PyVarm
> $ fab --version
> Fabric 1.10.2
> Paramiko 1.16.0
>
>
> (PyVarm) [16:46] enfors @ shodan: ~/devel/python/PyVarm
> $ python --version
> Python 2.7.12
>
>
> This is really strange, because as you can see above, I can import
> mezzanine.utils.conf manually without any problems.
>
> Just typing "fab" on the command line generates the same error, as long as
> I'm in the directory with Mezzanine's fabfile.py. The start of this file
> looks like this:
>
> from __future__ import print_function, unicode_literals
> from future.builtins import open
>
>
> import os
> import re
> import sys
> from contextlib import contextmanager
> from functools import wraps
> from getpass import getpass, getuser
> from glob import glob
> from importlib import import_module
> from posixpath import join
>
>
> from mezzanine.utils.conf import real_project_name
>
> It's this last line there, that's generating the error.
>
>
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.