fact-project / pyfact

A python package with useful methods concernig the FACT-telescope
13 stars 3 forks source link

install fails, No module named 'dateutil' #52

Closed relleums closed 7 years ago

relleums commented 7 years ago

I am not yet sure where this comes from, the photon-stream tests on travis do not pass, because they can not install pyfact. However, on my machine pyfact and the photon-stream run fine. There seems to be an odd combination with the photon-stream, pyfact and travis.

Worker information

hostname: i-03d13bb-precise-production-2-worker-org-docker.travisci.net:cc53d574-cdfb-4ec7-a3f8-cc046f908a9a

version: v2.5.0 https://github.com/travis-ci/worker/tree/da3a43228dffc0fcca5a46569ca786b22991979f

instance: c9612e1:travis:python

startup: 614.592313ms
system_info

Build system information

Build language: python

Build group: stable

Build dist: precise

Build id: 229159547

Job id: 229159548

travis-build version: 66bd59b85

Build image provisioning date and time

Thu Feb  5 15:09:33 UTC 2015

Operating System Details

Distributor ID: Ubuntu

Description:    Ubuntu 12.04.5 LTS

Release:    12.04

Codename:   precise

Linux Version

3.13.0-29-generic

Cookbooks Version

a68419e https://github.com/travis-ci/travis-cookbooks/tree/a68419e

GCC version

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Copyright (C) 2011 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

LLVM version

clang version 3.4 (tags/RELEASE_34/final)

Target: x86_64-unknown-linux-gnu

Thread model: posix

Pre-installed Ruby versions

ruby-1.9.3-p551

Pre-installed Node.js versions

v0.10.36

Pre-installed Go versions

1.4.1

Redis version

redis-server 2.8.19

riak version

2.0.2

MongoDB version

MongoDB 2.4.12

CouchDB version

couchdb 1.6.1

Neo4j version

1.9.4

RabbitMQ Version

3.4.3

ElasticSearch version

1.4.0

Installed Sphinx versions

2.0.10

2.1.9

2.2.6

Default Sphinx version

2.2.6

Installed Firefox version

firefox 31.0esr

PhantomJS version

1.9.8

ant -version

Apache Ant(TM) version 1.8.2 compiled on December 3 2011

mvn -version

Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)

Maven home: /usr/local/maven

Java version: 1.7.0_76, vendor: Oracle Corporation

Java home: /usr/lib/jvm/java-7-oracle/jre

Default locale: en_US, platform encoding: ANSI_X3.4-1968

OS name: "linux", version: "3.13.0-29-generic", arch: "amd64", family: "unix"

fix.CVE-2015-7547

$ export DEBIAN_FRONTEND=noninteractive

Reading package lists...

Building dependency tree...

Reading state information...

The following extra packages will be installed:

  libc-bin libc-dev-bin libc6-dev

Suggested packages:

  glibc-doc

The following packages will be upgraded:

  libc-bin libc-dev-bin libc6 libc6-dev

4 upgraded, 0 newly installed, 0 to remove and 264 not upgraded.

Need to get 8,856 kB of archives.

After this operation, 13.3 kB of additional disk space will be used.

Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libc6-dev amd64 2.15-0ubuntu10.18 [2,948 kB]

Get:2 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libc-dev-bin amd64 2.15-0ubuntu10.18 [84.5 kB]

Get:3 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libc-bin amd64 2.15-0ubuntu10.18 [1,178 kB]

Get:4 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libc6 amd64 2.15-0ubuntu10.18 [4,646 kB]

Fetched 8,856 kB in 0s (32.2 MB/s)

Preconfiguring packages ...

(Reading database ... 72431 files and directories currently installed.)

Preparing to replace libc6-dev 2.15-0ubuntu10.10 (using .../libc6-dev_2.15-0ubuntu10.18_amd64.deb) ...

Unpacking replacement libc6-dev ...

Preparing to replace libc-dev-bin 2.15-0ubuntu10.10 (using .../libc-dev-bin_2.15-0ubuntu10.18_amd64.deb) ...

Unpacking replacement libc-dev-bin ...

Preparing to replace libc-bin 2.15-0ubuntu10.10 (using .../libc-bin_2.15-0ubuntu10.18_amd64.deb) ...

Unpacking replacement libc-bin ...

Processing triggers for man-db ...

Setting up libc-bin (2.15-0ubuntu10.18) ...

(Reading database ... 72430 files and directories currently installed.)

Preparing to replace libc6 2.15-0ubuntu10.10 (using .../libc6_2.15-0ubuntu10.18_amd64.deb) ...

Unpacking replacement libc6 ...

Setting up libc6 (2.15-0ubuntu10.18) ...

Setting up libc-dev-bin (2.15-0ubuntu10.18) ...

Setting up libc6-dev (2.15-0ubuntu10.18) ...

Processing triggers for libc-bin ...

ldconfig deferred processing now taking place

3.5 is not installed; attempting download

Downloading archive: https://s3.amazonaws.com/travis-python-archives/binaries/ubuntu/12.04/x86_64/python-3.5.tar.bz2

$ sudo tar xjf python-3.5.tar.bz2 --directory /
git.checkout

1.25s$ git clone --depth=50 --branch=master https://github.com/fact-project/photon_stream.git fact-project/photon_stream

Cloning into 'fact-project/photon_stream'...

remote: Counting objects: 383, done.

remote: Compressing objects: 100% (155/155), done.

remote: Total 383 (delta 237), reused 358 (delta 225), pack-reused 0

Receiving objects: 100% (383/383), 12.45 MiB | 16.79 MiB/s, done.

Resolving deltas: 100% (237/237), done.

Checking connectivity... done.

$ cd fact-project/photon_stream

$ git checkout -qf 6df180115c9118d2a12f1ebe67cee7d2d78bb12d

0.01s$ source ~/virtualenv/python3.5/bin/activate

$ python --version

Python 3.5.2

$ pip --version

pip 9.0.1 from /home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages (python 3.5)
before_install.1

0.00s$ export DISPLAY=:99.0

before_install.2

0.02s$ sh -e /etc/init.d/xvfb start

Starting virtual X frame buffer: Xvfb.

15.76s$ pip install .

Processing /home/travis/build/fact-project/photon_stream

Collecting docopt (from photon-stream==0.0.1)

  Downloading docopt-0.6.2.tar.gz

Collecting scipy (from photon-stream==0.0.1)

  Downloading scipy-0.19.0-cp35-cp35m-manylinux1_x86_64.whl (47.9MB)

    100% |████████████████████████████████| 47.9MB 29kB/s 

Collecting sklearn (from photon-stream==0.0.1)

  Downloading sklearn-0.0.tar.gz

Collecting scikit-image (from photon-stream==0.0.1)

  Downloading scikit_image-0.13.0-cp35-cp35m-manylinux1_x86_64.whl (33.8MB)

    100% |████████████████████████████████| 33.8MB 35kB/s 

Collecting matplotlib (from photon-stream==0.0.1)

  Downloading matplotlib-2.0.1-cp35-cp35m-manylinux1_x86_64.whl (14.6MB)

    100% |████████████████████████████████| 14.6MB 100kB/s 

Collecting pyfact (from photon-stream==0.0.1)

  Downloading pyfact-0.10.1.tar.gz (79kB)

    100% |████████████████████████████████| 81kB 7.8MB/s 

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

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

      File "/tmp/pip-build-s4__lxk6/pyfact/setup.py", line 2, in <module>

        from fact import __version__

      File "/tmp/pip-build-s4__lxk6/pyfact/fact/__init__.py", line 1, in <module>

        from .time import fjd, iso2dt, run2dt, facttime, night, night_integer, datestr

      File "/tmp/pip-build-s4__lxk6/pyfact/fact/time.py", line 24, in <module>

        import dateutil

    ImportError: No module named 'dateutil'

    ----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-s4__lxk6/pyfact/

The command "pip install ." failed and exited with 1 during .

Your build has been stopped.
relleums commented 7 years ago

I investigated a bit more. Turns out that I made a mistake. pyfact can not be installed in usual python, this is where the missing dateutil comes from. The photon-stream travis.yml does not tell travis to first install an anaconda environment. This is why the photon-stream could not install pyfact. As we once defined anaconda to be a mandatory dependency it is up on the photon-stream travis tests to first install anaconda. So I incorrectly blamed pyfact. Moreover there was already dateutil in the setup.py:

    install_requires=[
        'numpy',
        'scipy',
        'matplotlib>=1.4',
        'python-dateutil', <---
        'pymongo>=2.7',
        'simple-crypt',
        'setuptools',
        'sqlalchemy',
        'pymysql',
        'pandas',
        'astropy',
        'peewee',
        'h5py',
        'wrapt',
        'tables',  # pytables in anaconda
        'python-dateutil', <---
],
maxnoe commented 7 years ago

No, I do not see a reason why pyfact should not be installable in a non-conda environment. This must be possible and work out of the box!

I found the problem!

It is that we no import __version__ from fact/__init__.py in the setup.py file. As fact.__init__ also imports the time module, datetutil is a required now at setup parsing time, not only at install time.

dneise commented 7 years ago

No, I do not see a reason why pyfact should not be installable in a non-conda environment. This must be possible and work out of the box!

If that is true and important enough to warrant exclamation marks, please explain shorty, why the pyfact travis.yml starts with installing miniconda? Just for speed reasons? since conda install is sometimes more efficient than pip install?

If that is the case, I think one should make a point of not using miniconda in the tests .. thus clearly showing conda in not a requirement.

maxnoe commented 7 years ago

THis comes from a time where installing numpy on travis was just not possible using pip. I think since numpy no has binary wheels on pypi there is no real reason anymore to use conda on travis.