gamenet / redis-memory-analyzer

Redis memory profiler to find the RAM bottlenecks throw scaning key space in real time and aggregate RAM usage statistic by patterns.
MIT License
772 stars 80 forks source link

Can't install #16

Closed shaharmor closed 8 years ago

shaharmor commented 8 years ago

Hi,

Trying to install on ubuntu 14.04:

Downloading/unpacking rma
  Downloading rma-0.1.5.tar.gz
  Running setup.py (path:/tmp/pip_build_root/rma/setup.py) egg_info for package rma
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/rma/setup.py", line 47
        setup(**sdict, install_requires=['redis', 'tabulate', 'tqdm', 'msgpack-python'])
                     ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/rma/setup.py", line 47

    setup(**sdict, install_requires=['redis', 'tabulate', 'tqdm', 'msgpack-python'])

                 ^

SyntaxError: invalid syntax

----------------------------------------
misterion commented 8 years ago

Could you provide your pip and python version?

shaharmor commented 8 years ago
# python -V
Python 3.4.3
# pip3 -V
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)

It also happens when i manually clone the repo

mjpieters commented 8 years ago

This is invalid syntax on any Python version before Python 3.5; you can't put **kwargs keyword argument expansion in front of other keyword arguments. Swap the two:

setup(install_requires=['redis', 'tabulate', 'tqdm', 'msgpack-python'], **sdict)

Python 3.5 allows this as PEP 448 added support for an arbitrary number of expansions to be applied.

misterion commented 8 years ago

@mjpieters tnx for help! @shaharmor could you try with 0.1.6 ?

shaharmor commented 8 years ago

Now it requests for the msgpack module (Which isn't listed as a requirement).

After installing msgpack-python manually it asked for tqdm (Also not listed..) Then it asked for tabulate...

and only then it finished successfully.

Can't you make it that it will automatically install it?

misterion commented 8 years ago

@mjpieters could i ask you help again? Now in setup args install_requires listed all requred components - 'redis', 'tabulate', 'tqdm', 'msgpack-python'. Also i see it in rma.egg-info requires.txt. But they do not install. Why?

misterion commented 8 years ago

@shaharmor i move all **kwargs as args. please test it with 0.1.7.

mjpieters commented 8 years ago

The install_requires looks correct to me but take into account only tools like easy_install and pip will go and fetch those requirements. If you run python setup.py install then you'll need to install the requirements manually.

mjpieters commented 8 years ago

Hrm, I can confirm the package still doesn't install with pip either.

mjpieters commented 8 years ago

Ah, you do from rma import __version__ and that then loads rma/__init__.py, which starts loading everything else, including from rma.application import RmaApplication which then imports from rma.scanner import Scanner and scanner.py has import msgpack.

Don't import your package in setup.py.

mjpieters commented 8 years ago

You could look at What is the correct way to share package version with setup.py and the package? for an alternative method of sharing the version between setup.py and the package.

misterion commented 8 years ago

Tnx a lot @mjpieters !