Development setup confusion
![](https://secure.gravatar.com/avatar/3ad33651a0a9e687dacba200e9ddc3a2.jpg?s=120&d=mm&r=g)
I think a setup step might be missing from the developer's docs https://docs.mailman3.org/en/latest/devsetup.html
If I go through the venv setup and when I call mailman info, the following error shows up (missing dependency).
... File "/home/_/Workspace/personal/mailman/src/mailman/__init__.py", line 38, in <module> from mailman.core.i18n import initialize File "/home/_/Workspace/personal/mailman/src/mailman/core/i18n.py", line 22, in <module> from flufl.i18n import PackageStrategy, registry ModuleNotFoundError: No module named 'flufl.i18n'
However, when I run just run tox, the .tox/qa/bin/mailman info command works without any issues.
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 2/20/21 3:07 PM, Marius Ghita wrote:
I think a setup step might be missing from the developer's docs https://docs.mailman3.org/en/latest/devsetup.html
If I go through the venv setup and when I call mailman info, the following error shows up (missing dependency).
... File "/home/_/Workspace/personal/mailman/src/mailman/__init__.py", line 38, in <module> from mailman.core.i18n import initialize File "/home/_/Workspace/personal/mailman/src/mailman/core/i18n.py", line 22, in <module> from flufl.i18n import PackageStrategy, registry ModuleNotFoundError: No module named 'flufl.i18n'
How did you install Mailman core in your venv? Mailman core's setup includes flufl.i18n>=2.0 in it's requirements.
However, when I run just run tox, the .tox/qa/bin/mailman info command works without any issues.
Because .tox/qa is it's own venv that included all the dependencies
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/3ad33651a0a9e687dacba200e9ddc3a2.jpg?s=120&d=mm&r=g)
On Sun, Feb 21, 2021 at 1:28 AM Mark Sapiro <mark@msapiro.net> wrote:
I think a setup step might be missing from the developer's docs https://docs.mailman3.org/en/latest/devsetup.html
If I go through the venv setup and when I call mailman info, the following error shows up (missing dependency).
... File "/home/_/Workspace/personal/mailman/src/mailman/__init__.py", line 38, in <module> from mailman.core.i18n import initialize File "/home/_/Workspace/personal/mailman/src/mailman/core/i18n.py",
On 2/20/21 3:07 PM, Marius Ghita wrote: line
22, in <module> from flufl.i18n import PackageStrategy, registry ModuleNotFoundError: No module named 'flufl.i18n'
How did you install Mailman core in your venv? Mailman core's setup includes flufl.i18n>=2.0 in it's requirements.
I have a folder ~/Workspace/personal where I ran:
$ python3 -m venv venv3 $ source ./venv3/bin/activate $ cd mailman $ python setup.py develop
For a second there I considered that the issue might have been that the dependency expects and older Python version. I have 3.9 on my desktop, so I spun up a Vagrant box which has python3.6 with the same issue.
Vagrantfile to reproduce the issue https://gist.github.com/mhitza/4dbec7d0efc6a94e658b5dd085e411ef
![](https://secure.gravatar.com/avatar/3ad33651a0a9e687dacba200e9ddc3a2.jpg?s=120&d=mm&r=g)
Do note that these two commands, from the Vagrantfile, work if you run them in the venv only (not sure why)
pip3 install --upgrade pip
pip3 install -U setuptools
Just noticed now because I've nuked my local folder and tried with a clean git clone again
On Sun, Feb 21, 2021 at 1:52 AM Marius Ghita <ghita.v.marius@gmail.com> wrote:
On Sun, Feb 21, 2021 at 1:28 AM Mark Sapiro <mark@msapiro.net> wrote:
I think a setup step might be missing from the developer's docs https://docs.mailman3.org/en/latest/devsetup.html
If I go through the venv setup and when I call mailman info, the following error shows up (missing dependency).
... File "/home/_/Workspace/personal/mailman/src/mailman/__init__.py",
38, in <module> from mailman.core.i18n import initialize File "/home/_/Workspace/personal/mailman/src/mailman/core/i18n.py",
On 2/20/21 3:07 PM, Marius Ghita wrote: line line
22, in <module> from flufl.i18n import PackageStrategy, registry ModuleNotFoundError: No module named 'flufl.i18n'
How did you install Mailman core in your venv? Mailman core's setup includes flufl.i18n>=2.0 in it's requirements.
I have a folder ~/Workspace/personal where I ran:
$ python3 -m venv venv3 $ source ./venv3/bin/activate $ cd mailman $ python setup.py develop
For a second there I considered that the issue might have been that the dependency expects and older Python version. I have 3.9 on my desktop, so I spun up a Vagrant box which has python3.6 with the same issue.
Vagrantfile to reproduce the issue https://gist.github.com/mhitza/4dbec7d0efc6a94e658b5dd085e411ef
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 2/20/21 3:07 PM, Marius Ghita wrote:
I think a setup step might be missing from the developer's docs https://docs.mailman3.org/en/latest/devsetup.html
If I go through the venv setup and when I call mailman info, the following error shows up (missing dependency).
... File "/home/_/Workspace/personal/mailman/src/mailman/__init__.py", line 38, in <module> from mailman.core.i18n import initialize File "/home/_/Workspace/personal/mailman/src/mailman/core/i18n.py", line 22, in <module> from flufl.i18n import PackageStrategy, registry ModuleNotFoundError: No module named 'flufl.i18n'
This is a packaging issue. The short answer is if in your venv you run
pip uninstall flufl.bounce flufl.lock flufl.i18n pip install flufl.bounce flufl.lock flufl.i18n
to remove and reinstall the flufl modules, it will then work.
The longer answer is if you look in your venv's site-packages directory before you remove the flufl modules, you will see
flufl.bounce-3.0.2-py3.9.egg/ flufl.i18n-3.1.5-py3.9.egg/ flufl.lock-5.0.5-py3.9.egg/
and in easy-install.pth entries
./flufl.lock-5.0.5-py3.9.egg ./flufl.i18n-3.1.5-py3.9.egg/ ./flufl.bounce-3.0.2-py3.9.egg/
and after, in site-packages
flufl/ flufl.bounce-3.0.2.dist-info/ flufl.bounce-3.0.2-py3.9-nspkg.pth flufl.i18n-3.1.5.dist-info/ flufl.i18n-3.1.5-py3.9-nspkg.pth flufl.lock-5.0.5.dist-info/ flufl.lock-5.0.5-py3.9-nspkg.pth
and in site-packages/flufl
bounce/ i18n/ lock/
This later configuration works fo importing any of flufl.bounce, flufl.i18n and flufl.lock, but the former winds up looking in flufl.bounce-3.0.2-py3.9.egg/ for everything and only finds flufl.bounce and not the others.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/8c8c6e35ec7ca5c708a6049152b2bedd.jpg?s=120&d=mm&r=g)
On Sat, Feb 20, 2021, at 5:33 PM, Mark Sapiro wrote:
On 2/20/21 3:07 PM, Marius Ghita wrote:
I think a setup step might be missing from the developer's docs https://docs.mailman3.org/en/latest/devsetup.html
If I go through the venv setup and when I call mailman info, the following error shows up (missing dependency).
... File "/home/_/Workspace/personal/mailman/src/mailman/__init__.py", line 38, in <module> from mailman.core.i18n import initialize File "/home/_/Workspace/personal/mailman/src/mailman/core/i18n.py", line 22, in <module> from flufl.i18n import PackageStrategy, registry ModuleNotFoundError: No module named 'flufl.i18n'
This is a packaging issue. The short answer is if in your venv you run
pip uninstall flufl.bounce flufl.lock flufl.i18n pip install flufl.bounce flufl.lock flufl.i18n
to remove and reinstall the flufl modules, it will then work.
The larger issue is that Barry added support for PEP 420 implicit namespace1
which is only supported by pip (setuptools) and not distutils as per 2. So,
setup.py develop
isn’t able to install them properly. Which is why you have
to uninstall and install them using pip
after python setup.py develop
.
The solution is to replace all the places we have python setup.py develop
to pip install -e .
which results in an editable install and uses setuptools.
I have done that in several places, but please point out anywhere you see
python setup.py develop
and we can replace it with pip install -e .
.
The longer answer is if you look in your venv's site-packages directory before you remove the flufl modules, you will see
flufl.bounce-3.0.2-py3.9.egg/ flufl.i18n-3.1.5-py3.9.egg/ flufl.lock-5.0.5-py3.9.egg/
and in easy-install.pth entries
./flufl.lock-5.0.5-py3.9.egg ./flufl.i18n-3.1.5-py3.9.egg/ ./flufl.bounce-3.0.2-py3.9.egg/
and after, in site-packages
flufl/ flufl.bounce-3.0.2.dist-info/ flufl.bounce-3.0.2-py3.9-nspkg.pth flufl.i18n-3.1.5.dist-info/ flufl.i18n-3.1.5-py3.9-nspkg.pth flufl.lock-5.0.5.dist-info/ flufl.lock-5.0.5-py3.9-nspkg.pth
and in site-packages/flufl
bounce/ i18n/ lock/
This later configuration works fo importing any of flufl.bounce, flufl.i18n and flufl.lock, but the former winds up looking in flufl.bounce-3.0.2-py3.9.egg/ for everything and only finds flufl.bounce and not the others.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-leave@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3
Security Policy: https://wiki.list.org/x/QIA9
-- thanks, Abhilash Raj (maxking)
participants (3)
-
Abhilash Raj
-
Marius Ghita
-
Mark Sapiro