• Members 19 posts
    Feb. 18, 2017, 11:46 a.m.

    Error with install Misago.

    $ virtualenv venv
    Running virtualenv with interpreter /usr/bin/python2
    New python executable in venv/bin/python2
    Also creating executable in venv/bin/python
    Installing setuptools, pip...done.
    
    $ source venv/bin/activate
    $ git clone https://github.com/rafalp/Misago.git
    $ cd Misago/
    $ git rev-parse HEAD
    f126f6f6bf4ade70c6484914599c413adb330cc5
    $ python setup.py install
    error in Misago setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
    $ pip install -r requirements.txt
    Exception:
    Traceback (most recent call last):
      File "/home/user/www/misago-project/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
        status = self.run(options, args)
      File "/home/user/www/misago-project/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 274, in run
        for req in parse_requirements(filename, finder=finder, options=options, session=session):
      File "/home/user/www/misago-project/venv/local/lib/python2.7/site-packages/pip/req.py", line 1632, in parse_requirements
        req = InstallRequirement.from_line(line, comes_from, prereleases=getattr(options, "pre", None))
      File "/home/user/www/misago-project/venv/local/lib/python2.7/site-packages/pip/req.py", line 173, in from_line
        return cls(req, comes_from, url=url, prereleases=prereleases)
      File "/home/user/www/misago-project/venv/local/lib/python2.7/site-packages/pip/req.py", line 71, in __init__
        req = pkg_resources.Requirement.parse(req)
      File "/home/user/www/misago-project/venv/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2793, in parse
        reqs = list(parse_requirements(s))
      File "/home/user/www/misago-project/venv/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2721, in parse_requirements
        "version spec")
      File "/home/user/www/misago-project/venv/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2686, in scan_list
        raise ValueError(msg, line, "at", line[p:])
    ValueError: ('Expected version spec in', 'django~=1.10.3', 'at', '~=1.10.3')
    
    Storing debug log for failure in /home/user/.pip/pip.log
    

    Same story with virtualenv -p /usr/bin/python3 venv

    $ pip install -r requirements.txt 
    Exception:
    Traceback (most recent call last):
      File "/home/user/www/misago-project/venv/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main
        status = self.run(options, args)
      File "/home/user/www/misago-project/venv/lib/python3.4/site-packages/pip/commands/install.py", line 274, in run
        for req in parse_requirements(filename, finder=finder, options=options, session=session):
      File "/home/user/www/misago-project/venv/lib/python3.4/site-packages/pip/req.py", line 1632, in parse_requirements
        req = InstallRequirement.from_line(line, comes_from, prereleases=getattr(options, "pre", None))
      File "/home/user/www/misago-project/venv/lib/python3.4/site-packages/pip/req.py", line 173, in from_line
        return cls(req, comes_from, url=url, prereleases=prereleases)
      File "/home/user/www/misago-project/venv/lib/python3.4/site-packages/pip/req.py", line 71, in __init__
        req = pkg_resources.Requirement.parse(req)
      File "/home/user/www/misago-project/venv/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2793, in parse
        reqs = list(parse_requirements(s))
      File "/home/user/www/misago-project/venv/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2721, in parse_requirements
        "version spec")
      File "/home/user/www/misago-project/venv/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2686, in scan_list
        raise ValueError(msg, line, "at", line[p:])
    ValueError: ('Expected version spec in', 'django~=1.10.3', 'at', '~=1.10.3')
    
    Storing debug log for failure in /home/user/.pip/pip.log
    
    $ pip -V
    pip 1.5.6 from /home/user/www/misago-project/venv/lib/python3.4/site-packages (python 3.4)
    $ python -V
    Python 3.4.2
    

    Any ideas whats wrong?

  • Feb. 18, 2017, 3:56 p.m.

    Same as here: misago-project.org/t/initializing-misago/271/#post-1288

    You are running outdated PIP thats not supporting "compatible with" comparator for dependency version, AKA ~=

    edit: I've looked into it further, turns out setuptools 5.5.1 is 2.5 years old and is grossly outdated. To install Misago you'll need setuptools version 8 or higher, because it was version 8 of setuptools that implemented support for PEP 440 version comparisons. This PEP is going to be four years old in few weeks as of time of writing this post... so yea, its good to update your setup tools ;)

  • edit

    Thread title has been changed from Problems with installing.

  • Feb. 18, 2017, 4:55 p.m.

    @lensalff0x1f I've updated my post with valid answer. ;) Hope this helps!

    I'll try tweaking thread's title so it easier to find via forum search.

  • edit

    Thread title has been changed from "Expected version spec in" when installing dependencies.

  • arrow_forward
  • Feb. 18, 2017, 5:10 p.m.

    And this is already documented in "Setup and maintenance" chapter of Misago's docs.

  • Members 19 posts
    Feb. 18, 2017, 5:42 p.m.
  • Feb. 18, 2017, 6:12 p.m.

    As general rule, installing python packages from your OS's repo is bad idea. Use PIP to update itself and other packages.

  • Members 19 posts
    Feb. 18, 2017, 10:06 p.m.

    Ok, I delete package from OS, make new env and update pip and setuptools to latest:

    $ git rev-parse HEAD
    c8ddb4c09543ec451f48eadf0e34ecc8f2a999af
    $ pip -V
    pip 9.0.1 from /home/user/www/misago-project/venv/lib/python3.4/site-packages (python 3.4)
    $ pip show setuptools
    Name: setuptools
    Version: 34.2.0
    

    And get another error:

    $ python setup.py install
    
    ...
    
    Installed /home/user/www/misago-project/venv/lib/python3.4/site-packages/requests-2.13.0-py3.4.egg
    Searching for pytz
    Reading https://pypi.python.org/simple/pytz/
    Downloading https://pypi.python.org/packages/7a/f6/15f6aebcec6696bd3d0aced7efcdea220cb3378e7b8a4d81aa98ecda5953/pytz-2016.10-py3.4.egg#md5=9cea3a67283164b1439098c97540329c
    Best match: pytz 2016.10
    Processing pytz-2016.10-py3.4.egg
    Moving pytz-2016.10-py3.4.egg to /home/veloufa/www/misago-project/venv/lib/python3.4/site-packages
    Adding pytz 2016.10 to easy-install.pth file
    
    Installed /home/user/www/misago-project/venv/lib/python3.4/site-packages/pytz-2016.10-py3.4.egg
    Searching for psycopg2~=2.6.2
    Reading https://pypi.python.org/simple/psycopg2/
    Downloading https://pypi.python.org/packages/7b/a8/dc2d50a6f37c157459cd18bab381c8e6134b9381b50fbe969997b2ae7dbc/psycopg2-2.6.2.tar.gz#md5=4a392949ba31a378a18ed3e775a4693f
    Best match: psycopg2 2.6.2
    Processing psycopg2-2.6.2.tar.gz
    Writing /tmp/easy_install-j403tjp8/psycopg2-2.6.2/setup.cfg
    Running psycopg2-2.6.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-j403tjp8/psycopg2-2.6.2/egg-dist-tmp-cv36fnbi
    In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
  • Feb. 18, 2017, 10:08 p.m.
  • Members 19 posts
    Feb. 18, 2017, 10:21 p.m.

    Oh, sorry for stupid post. I get error, write about it here and only after it I realize problem in another library. And google same solution. Yep, it works.

  • Feb. 18, 2017, 10:36 p.m.

    Yep, speaking from experience the Psycopg2 and Pillow are the troublemakers, with Pillow happy to compile without basic libs and crash on you only after you've got whole app up and running due to that.

    After you've got Misago running, try setting your avatar from jpeg image to make sure your Pillow has compiled with JPG support. Next try change your avatar to generated individual avatar to see if it has text-drawing extension. After that you should be good to go with compiled dependencies.