# Install using flit works on python 3.8 but fails on 3.6 and 3.7

**URL:** <https://travis-ci.community/t/install-using-flit-works-on-python-3-8-but-fails-on-3-6-and-3-7/8143>\
**Category:** Python\
**Tags:** build-env, python, travis-build\
**Created:** [April 14, 2020, 12:13pm UTC](https://travis-ci.community/t/install-using-flit-works-on-python-3-8-but-fails-on-3-6-and-3-7/8143 "2020-04-14T12:13:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![avaldebe](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/avaldebe/32/4320_2.png) [@avaldebe](https://travis-ci.community/u/avaldebe)\
**Post date:** [April 14, 2020, 12:13pm UTC](https://travis-ci.community/t/install-using-flit-works-on-python-3-8-but-fails-on-3-6-and-3-7/8143/1 "2020-04-14T12:13:11Z")

</div>

my builds started to fail at the installation stage

on python3.8 all goes fine

```auto
$ python --version
Python 3.8.0
$ pip --version
pip 19.3 from /home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/pip (python 3.8)
$ pip install tox-travis
$ tox
.package installdeps: flit
py38 create: /home/travis/build/avaldebe/PyPMS/.tox/py38
py38 installdeps: pytest
py38 inst: /home/travis/build/avaldebe/PyPMS/.tox/.tmp/package/1/PyPMS-0.1.5.tar.gz
[...]

```

but on python3.6 and 3.7 the installation fails

```auto
$ python --version
Python 3.6.7
$ pip --version
pip 19.0.3 from /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pip (python 3.6)
$ pip install tox-travis
$ tox
.package create: /home/travis/build/avaldebe/PyPMS/.tox/.package
.package installdeps: flit
py36 create: /home/travis/build/avaldebe/PyPMS/.tox/py36
py36 installdeps: pytest, pytest-black, pytest-mypy
py36 inst: /home/travis/build/avaldebe/PyPMS/.tox/.tmp/package/1/PyPMS-0.1.5.tar.gz
ERROR: invocation failed (exit code 1), logfile: /home/travis/build/avaldebe/PyPMS/.tox/py36/log/py36-2.log
================================== log start ===================================
Processing ./.tox/.tmp/package/1/PyPMS-0.1.5.tar.gz
  Missing build time requirements in pyproject.toml for file:///home/travis/build/avaldebe/PyPMS/.tox/.tmp/package/1/PyPMS-0.1.5.tar.gz: 'setuptools' and 'wheel'.
  This version of pip does not implement PEP 517 so it cannot build a wheel without 'setuptools' and 'wheel'.
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/travis/build/avaldebe/PyPMS/.tox/py36/lib/python3.6/tokenize.py", line 452, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-8cdyu2ei/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-8cdyu2ei/

```

BTW, I’m using flit to setup/install the package and tox to run my tests

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [April 14, 2020, 1:19pm UTC](https://travis-ci.community/t/install-using-flit-works-on-python-3-8-but-fails-on-3-6-and-3-7/8143/2 "2020-04-14T13:19:09Z")

</div>

The output is pretty descriptive. Did you try doing as it suggests?

---

<div class="post-metadata">

**Author:** ![avaldebe](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/avaldebe/32/4320_2.png) [@avaldebe](https://travis-ci.community/u/avaldebe)\
**Post date:** [April 14, 2020, 1:32pm UTC](https://travis-ci.community/t/install-using-flit-works-on-python-3-8-but-fails-on-3-6-and-3-7/8143/3 "2020-04-14T13:32:04Z")

</div>

I use flit so I do not need to write a setup.py my self. It used to work fine about 5 months ago when I last worked on this project. In fact the first build that failed was after adding some doc files, which should not affect the installation process.

Besides, it only fails on python 3.6 and 3.7. It works fine on python 3.8 and on my local machine…

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [April 14, 2020, 2:13pm UTC](https://travis-ci.community/t/install-using-flit-works-on-python-3-8-but-fails-on-3-6-and-3-7/8143/4 "2020-04-14T14:13:33Z")

</div>

Any number of things have changed since then – package versions in particular. Until you properly diagnose the problem, you cannot say who the culprit is. Passing on the local machine also means nothing because any number of things can be different there.

I would first check the contents of the log files referenced and of the generated `PyPMS-0.1.5.tar.gz` archive for any oddities and differences from 3.8 and pull the thread from there.

---

<div class="post-metadata">

**Author:** ![avaldebe](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/avaldebe/32/4320_2.png) [@avaldebe](https://travis-ci.community/u/avaldebe)\
**Post date:** [April 14, 2020, 5:24pm UTC](https://travis-ci.community/t/install-using-flit-works-on-python-3-8-but-fails-on-3-6-and-3-7/8143/5 "2020-04-14T17:24:58Z")

</div>

Thanks for the insight. It seems that flit gets confused between the travis virtual environment and the tox virtual environment.

So to install properly I needed to change the install and script entries on my .travis.yml from

```auto
install: pip install tox-travis
script: tox

```

to

```auto
 install:
  - pip install flit
  - flit install

script:
  - pytest

```

Still need to replicate the functionality tox provided using a matrix, but now I know what the problem was.

Thanks again,  
Á.
