circstat / pycircstat

Toolbox for circular statistics with Python
MIT License
157 stars 42 forks source link

No module named 'decorator' #64

Closed robshep closed 4 years ago

robshep commented 5 years ago

I think the import should be decorators

File "arc.py", line 5, in <module>
    import pycircstat
  File "/[...]/.venv/lib/python3.7/site-packages/pycircstat/__init__.py", line 6, in <module>
    from .descriptive import *
  File "/[...]/.venv/lib/python3.7/site-packages/pycircstat/descriptive.py", line 8, in <module>
    from decorator import decorator
ModuleNotFoundError: No module named 'decorator'
fabiansinz commented 5 years ago

decorator is correct. It has nothing to do with the local file decorators if you look in how it is used in the file. I am using python 3.7.3 and just imported decorator.decorator without any problem. Can you try that import from your local python prompt?

robshep commented 5 years ago

I was importing descriptors.

No longer using this lib in favour of R’s circular stats library. Thanks

Rob

Get Outlook for iOShttps://aka.ms/o0ukef


From: Fabian Sinz notifications@github.com Sent: Monday, May 27, 2019 12:39 pm To: circstat/pycircstat Cc: Rob Shepherd; Author Subject: Re: [circstat/pycircstat] No module named 'decorator' (#64)

decorator is correct. It has nothing to do with the local file decorators if you look in how it is used in the file. I am using python 3.7.3 and just imported decorator.decorator without any problem. Can you try that import from your local python prompt?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/circstat/pycircstat/issues/64?email_source=notifications&email_token=AANXMUYITO54XVZOFX5CDD3PXPB6DA5CNFSM4HPXQSYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWJSOBY#issuecomment-496183047, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AANXMU3XAOBCHW4ZIJF6EOLPXPB6DANCNFSM4HPXQSYA.

robshep commented 5 years ago

Just checked this out and in python 3.7.2

import decorator.decorators Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'decorator'

I'm working in a python3 venv and I've uninstalled and re-installed this module but it doesn't bring any dependencies. I don't have any experience with python modules, but maybe a problem for others.

Thanks

Rob

fabiansinz commented 5 years ago

My current guess is that there is something wrong with your venv. If you installed the module you should be able to import it. Does import decorator work?

robshep commented 5 years ago

No, I can't import decorator as above.

It's a new venv just made to try this lib.

I've recreated it here, if you want to follow:

rob@graviton-161 circular$ cd /tmp
rob@graviton-161 tmp$ mkdir test_pycircstat
rob@graviton-161 tmp$ cd test_pycircstat/
rob@graviton-161 test_pycircstat$ /usr/local/bin/python3.7 -V
Python 3.7.2
rob@graviton-161 test_pycircstat$ /usr/local/bin/python3.7 -m venv .venv
rob@graviton-161 test_pycircstat$ source .venv/bin/activate
(.venv) rob@graviton-161 test_pycircstat$ which pip
/private/tmp/test_pycircstat/.venv/bin/pip
(.venv) rob@graviton-161 test_pycircstat$ pip install pycircstat
Collecting pycircstat
  Using cached https://files.pythonhosted.org/packages/60/28/a154b18dfa5b1d767a2a9b99977fa94285bd8defa6d5eb553095bda3aa70/pycircstat-0.0.2-py3-none-any.whl
Installing collected packages: pycircstat
Successfully installed pycircstat-0.0.2
You are using pip version 18.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(.venv) rob@graviton-161 test_pycircstat$ which python
/private/tmp/test_pycircstat/.venv/bin/python
(.venv) rob@graviton-161 test_pycircstat$ python -V
Python 3.7.2
(.venv) rob@graviton-161 test_pycircstat$ python
Python 3.7.2 (default, Feb 12 2019, 08:16:38)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import decorator
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'decorator'
>>> import pycircstat
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/private/tmp/test_pycircstat/.venv/lib/python3.7/site-packages/pycircstat/__init__.py", line 6, in <module>
    from .descriptive import *
  File "/private/tmp/test_pycircstat/.venv/lib/python3.7/site-packages/pycircstat/descriptive.py", line 8, in <module>
    from decorator import decorator
ModuleNotFoundError: No module named 'decorator'

Apologies if it's something weird on my specific system.
It would be nice to return to this lib later ;)

Rob

fabiansinz commented 5 years ago

Do you have docker installed? Maybe it would be work trying the import in a python3.7 image. I just tried this

docker run -it --entrypoint bash --rm python:3.7.2
root@e85548cc7c40:/# pip3 install decorator
Collecting decorator
  Downloading https://files.pythonhosted.org/packages/5f/88/0075e461560a1e750a0dcbf77f1d9de775028c37a19a346a6c565a257399/decorator-4.4.0-py2.py3-none-any.whl
Installing collected packages: decorator
Successfully installed decorator-4.4.0
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@e85548cc7c40:/# python3
Python 3.7.2 (default, Mar 27 2019, 08:41:08)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import decorator
>>> from decorator import decorator
>>>

It passed without error. I seems that the venv might be the problem.

robshep commented 5 years ago

it works if I install decorator manually.

should the pip not fetch it?

robshep commented 5 years ago

if not then please consider updating the readme installation steps to install dependencies manually.

thanks

fabiansinz commented 5 years ago

Ok that's interesting. I thought you did try to install it manually before. Quick question, how did you install pycircstat in the first place? Technically, decorator is in the dependencies mentioned in the setup.py so it should be installed.

robshep commented 5 years ago

pip

See: https://github.com/circstat/pycircstat/issues/64#issuecomment-496190301

fabiansinz commented 5 years ago

Ok, I just verified that this is missing in the pip version and needs to be installed. Thanks for the feedback.

avdaranyi commented 4 years ago

This would fix it: #69