Attempting to install Nikola, I'm getting an error from setuptools that appeared to be coming from doit. I reported it there but they pointed me here. According to the doit folks, their "environment marker" line in their setup.py is identical in form to the (apparently working) code in the setup.py of Nikola. The following is a transcript of the four commands issued on my Debian Stable amd64 box (mkvirtualenv, confirmation of the version of Python in the virtualenv, pip to upgrade pip & setuptools, and finally a pip to install Nikola)
$ mkvirtualenv -p python3 nikola3
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in nikola3/bin/python3
Also creating executable in nikola3/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/tim/code/virtualenvs/nikola3/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/tim/code/virtualenvs/nikola3/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/tim/code/virtualenvs/nikola3/bin/preactivate
virtualenvwrapper.user_scripts creating /home/tim/code/virtualenvs/nikola3/bin/postactivate
virtualenvwrapper.user_scripts creating /home/tim/code/virtualenvs/nikola3/bin/get_env_details
(nikola3)$ python --version
Python 3.4.2
(nikola3)$ pip install --upgrade pip setuptools # locally outdated
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Collecting setuptools
Using cached setuptools-34.2.0-py2.py3-none-any.whl
Collecting pyparsing
Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Collecting packaging>=16.8 (from setuptools)
Using cached packaging-16.8-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools)
Using cached appdirs-1.4.0-py2.py3-none-any.whl
Collecting six>=1.6.0 (from setuptools)
Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: pip, pyparsing, six, packaging, appdirs, setuptools
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Successfully uninstalled pip-7.1.2
Found existing installation: pyparsing 2.0.3
DEPRECATION: Uninstalling a distutils installed project (pyparsing) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Not uninstalling pyparsing at /usr/lib/python2.7/dist-packages, outside environment /home/tim/code/virtualenvs/nikola3
Found existing installation: setuptools 5.5.1
Not uninstalling setuptools at /usr/lib/python2.7/dist-packages, outside environment /home/tim/code/virtualenvs/nikola3
Successfully installed appdirs-1.4.0 packaging-16.8 pip-9.0.1 pyparsing-2.0.3 setuptools-5.5.1 six-1.10.0
(nikola3)$ pip install Nikola
Collecting Nikola
Using cached Nikola-7.8.3-py2.py3-none-any.whl
Collecting mako>=1.0.0 (from Nikola)
Using cached Mako-1.0.6.tar.gz
Collecting doit>=0.28.0; python_version >= "3.4" (from Nikola)
Using cached doit-0.30.2.tar.gz
Complete output from command python setup.py egg_info:
error in doit setup command: Invalid environment marker: python_version <= "3.3"
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jfmqssic/doit/
I'm at a loss why Nikola appears to be able to find the python_version environment marker while doit chokes on it. I'm glad to assist in debugging this despite my lack of knowledge regarding the internals of setuptools.
The issue lies with the Setuptools version. 5.5.1 there doesn't support ranged comparators (<=) for environment markers. I don't forget which version added support for it, but I'm pretty sure 5.5 is not late enough.
Are you able to update Setuptools in that environment?
@jaraco I thought I'd pulled the latest setuptools into my environment with
(nikola3)$ pip install --upgrade pip setuptools # locally outdated
that I used (which I did because previous attempts complained that pip and setuptools were out of date). Is there something I should have done to get an adequate version of setuptools into my virtualenv?
Ah, I see that it's mentioning something about "not uninstalling {pyparsing,setuptools}" because they're found in /usr/lib/python2.7/dist-packages which is strange, since I thought that a virtualenv was supposed to isolate me from those system packages. Especially Py2.x stuff when in a Py3.x virtualenv. I uninstalled pep8/flake8/Calibre (which were pulling in system versions of pyparsing & setuptools), nuked the virtualenv, recreated it, upgraded pip and setuptools as above and they seem to install now.
So I guess I'm just left wondering why my virtualenv didn't isolate me from my system libraries.
Turns out an antiquated local install of an unofficial package had inserted a ~/.../lib/python2.7/... in my $PYTHONPATH which was interfering with things. Once I tracked that down, everything started working as expected finally. Sorry for the noise.
Most helpful comment
@jaraco I thought I'd pulled the latest
setuptoolsinto my environment withthat I used (which I did because previous attempts complained that
pipandsetuptoolswere out of date). Is there something I should have done to get an adequate version ofsetuptoolsinto my virtualenv?