Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirement missing #1

Closed
b3yond opened this issue May 11, 2017 · 3 comments
Closed

Requirement missing #1

b3yond opened this issue May 11, 2017 · 3 comments

Comments

@b3yond
Copy link

b3yond commented May 11, 2017

Hi :)

I failed to run your script.

Steps to reproduce:

  1. sh requirements
$ sh requirements
[sudo] Passwort für b3yond: 
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
»python-pip« ist bereits die neuste Version (8.1.1-2ubuntu0.4).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 1 nicht aktualisiert.
The directory '/home/b3yond/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                               
The directory '/home/b3yond/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                                      
Collecting pandas
  Downloading pandas-0.20.1-cp27-cp27mu-manylinux1_x86_64.whl (22.3MB)
    100% |████████████████████████████████| 22.3MB 56kB/s 
Collecting pytz>=2011k (from pandas)
  Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
    100% |████████████████████████████████| 491kB 2.2MB/s 
Requirement already satisfied: python-dateutil in /usr/lib/python2.7/dist-packages (from pandas)
Collecting numpy>=1.7.0 (from pandas)
  Downloading numpy-1.12.1-cp27-cp27mu-manylinux1_x86_64.whl (16.5MB)
    100% |████████████████████████████████| 16.5MB 71kB/s 
Installing collected packages: pytz, numpy, pandas
Successfully installed numpy-1.12.1 pandas-0.20.1 pytz-2017.2
The directory '/home/b3yond/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                               
The directory '/home/b3yond/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                                      
Collecting nltk
  Downloading nltk-3.2.2.tar.gz (1.2MB)
    100% |████████████████████████████████| 1.2MB 554kB/s 
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from nltk)
Installing collected packages: nltk
  Running setup.py install for nltk ... done
Successfully installed nltk-3.2.2
The directory '/home/b3yond/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                               
The directory '/home/b3yond/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                                      
Collecting plotly
  Downloading plotly-2.0.8.tar.gz (964kB)
    100% |████████████████████████████████| 972kB 680kB/s 
Collecting decorator (from plotly)
  Downloading decorator-4.0.11-py2.py3-none-any.whl
Collecting nbformat>=4.2 (from plotly)
  Downloading nbformat-4.3.0-py2.py3-none-any.whl (154kB)
    100% |████████████████████████████████| 163kB 2.7MB/s 
Requirement already satisfied: pytz in /usr/local/lib/python2.7/dist-packages (from plotly)
Requirement already satisfied: requests in /usr/local/lib/python2.7/dist-packages (from plotly)
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from plotly)
Collecting jupyter-core (from nbformat>=4.2->plotly)
  Downloading jupyter_core-4.3.0-py2.py3-none-any.whl (76kB)
    100% |████████████████████████████████| 81kB 1.8MB/s 
Collecting traitlets>=4.1 (from nbformat>=4.2->plotly)
  Downloading traitlets-4.3.2-py2.py3-none-any.whl (74kB)
    100% |████████████████████████████████| 81kB 5.1MB/s 
Collecting ipython-genutils (from nbformat>=4.2->plotly)
  Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting jsonschema!=2.5.0,>=2.4 (from nbformat>=4.2->plotly)
  Downloading jsonschema-2.6.0-py2.py3-none-any.whl
Requirement already satisfied: enum34; python_version == "2.7" in /usr/lib/python2.7/dist-packages (from traitlets>=4.1->nbformat>=4.2->plotly)
Collecting functools32; python_version == "2.7" (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2->plotly)
  Downloading functools32-3.2.3-2.zip
Installing collected packages: decorator, ipython-genutils, traitlets, jupyter-core, functools32, jsonschema, nbformat, plotly
  Running setup.py install for functools32 ... done
  Running setup.py install for plotly ... done
Successfully installed decorator-4.0.11 functools32-3.2.3.post2 ipython-genutils-0.2.0 jsonschema-2.6.0 jupyter-core-4.3.0 nbformat-4.3.0 plotly-2.0.8 traitlets-4.3.2
The directory '/home/b3yond/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                               
The directory '/home/b3yond/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                                      
Requirement already satisfied: beautifulsoup4 in /usr/lib/python2.7/dist-packages
The directory '/home/b3yond/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                               
The directory '/home/b3yond/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                                      
Requirement already satisfied: requests in /usr/local/lib/python2.7/dist-packages
The directory '/home/b3yond/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                               
The directory '/home/b3yond/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                                      
Collecting tldextract
  Downloading tldextract-2.0.2-py2.py3-none-any.whl (52kB)
    100% |████████████████████████████████| 61kB 710kB/s 
Requirement already satisfied: idna in /usr/lib/python2.7/dist-packages (from tldextract)
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from tldextract)
Collecting requests-file>=1.4 (from tldextract)
  Downloading requests-file-1.4.2.tar.gz
Requirement already satisfied: requests>=2.1.0 in /usr/local/lib/python2.7/dist-packages (from tldextract)
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from requests-file>=1.4->tldextract)
Installing collected packages: requests-file, tldextract
  Running setup.py install for requests-file ... done
Successfully installed requests-file-1.4.2 tldextract-2.0.2
The directory '/home/b3yond/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                               
The directory '/home/b3yond/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.                                                                                                                      
Collecting wordcloud
  Downloading wordcloud-1.3.1.tar.gz (169kB)
    100% |████████████████████████████████| 174kB 1.6MB/s 
Collecting matplotlib (from wordcloud)
  Downloading matplotlib-2.0.2-cp27-cp27mu-manylinux1_x86_64.whl (14.5MB)
    100% |████████████████████████████████| 14.5MB 32kB/s 
Requirement already satisfied: numpy>=1.6.1 in /usr/local/lib/python2.7/dist-packages (from wordcloud)
Requirement already satisfied: pillow in /usr/lib/python2.7/dist-packages (from wordcloud)
Collecting cycler>=0.10 (from matplotlib->wordcloud)
  Downloading cycler-0.10.0-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil in /usr/lib/python2.7/dist-packages (from matplotlib->wordcloud)
Requirement already satisfied: functools32 in /usr/local/lib/python2.7/dist-packages (from matplotlib->wordcloud)
Requirement already satisfied: six>=1.10 in /usr/lib/python2.7/dist-packages (from matplotlib->wordcloud)
Requirement already satisfied: pytz in /usr/local/lib/python2.7/dist-packages (from matplotlib->wordcloud)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in /usr/lib/python2.7/dist-packages (from matplotlib->wordcloud)
Collecting subprocess32 (from matplotlib->wordcloud)
  Downloading subprocess32-3.2.7.tar.gz (54kB)
    100% |████████████████████████████████| 61kB 4.1MB/s 
Installing collected packages: cycler, subprocess32, matplotlib, wordcloud
  Running setup.py install for subprocess32 ... done
  Running setup.py install for wordcloud ... done
Successfully installed cycler-0.10.0 matplotlib-2.0.2 subprocess32-3.2.7 wordcloud-1.3.1
[nltk_data] Downloading package stopwords to /home/b3yond/nltk_data...
[nltk_data]   Unzipping corpora/stopwords.zip.
[nltk_data] Downloading package punkt to /home/b3yond/nltk_data...
[nltk_data]   Unzipping tokenizers/punkt.zip.
  1. python tool.py
$ python tool.py 
Traceback (most recent call last):
  File "tool.py", line 6, in <module>
    from pandas.tseries.resample import TimeGrouper 
ImportError: No module named resample

Suggestions:

sudo pip install seems to run more smoothly with the sudo -H flag. But maybe this is just for my environment.
pandas.tseries.resample doesn't seem to be downloaded by pip. How did you get the module and can you replace it?

@sidtechnical
Copy link
Owner

Hi @b3yond ,

I am glad that you gave a shot to try out this tool. Unfortunately I could not reproduce the same error as yours on my machines. If you provide me the information about your operating system (with version) along with the versions of your pip, python and pandas, I can reproduce them on a virtual machine and try to debug it.

Looking at your install logs, I think it could be the issue with an outdated pip, so try upgrading it to a latest version sudo -H pip2 install --upgrade pip, rerun sh requirements so that it picks up the right version of pandas for you.

Surprisingly, it is not the case where capitalization of tseries or resample in the line pandas.tseries.resample like it happens most of the time with different versions of pandas. But you can try changing the line 6 of tool.py i.e. from pandas.tseries.resample import TimeGrouper to from pandas.tseries.Resample import TimeGrouper or from pandas.Tseries.resample import TimeGrouper or from pandas.Tseries.Resample import TimeGrouper something like that.

@b3yond
Copy link
Author

b3yond commented May 12, 2017

Hi,

tried your suggestions:

I upgraded pip and reinstalled all requirements, still did not work.
I tried uppercase modules, still did not work.

$ pip2 --version
pip 9.0.1 from /home/b3yond/.local/lib/python2.7/site-packages (python 2.7)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial
$ cat /proc/version
Linux version 4.4.0-77-generic (buildd@lgw01-59) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #98-Ubuntu SMP Wed Apr 26 08:34:02 UTC 2017
$ pip show pandas
Name: pandas
Version: 0.20.1
Summary: Powerful data structures for data analysis, time series,and statistics
Home-page: http://pandas.pydata.org
Author: The PyData Development Team
Author-email: pydata@googlegroups.com
License: BSD
Location: /usr/local/lib/python2.7/dist-packages
Requires: pytz, python-dateutil, numpy
$ python --version
Python 2.7.12

thanks for caring :3

@sidtechnical
Copy link
Owner

I could reproduce it on my virtual machine
Can you change the line 6 of tool.py from from pandas.tseries.resample import TimeGrouper to from pandas.core.resample import TimeGrouper. Like I expected, they changed the module name/directory. Here is the change log.

Let me know if it still persists and reopen the issue. For now, I will mark it as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants