# Python package\_data files not installed in Travis virtual environment?

**URL:** <https://travis-ci.community/t/python-package-data-files-not-installed-in-travis-virtual-environment/5330>\
**Category:** Linux\
**Tags:** python\
**Created:** [October 6, 2019, 11:39am UTC](https://travis-ci.community/t/python-package-data-files-not-installed-in-travis-virtual-environment/5330 "2019-10-06T11:39:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![orenbenkiki](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/orenbenkiki/32/2841_2.png) [@orenbenkiki](https://travis-ci.community/u/orenbenkiki)\
**Post date:** [October 6, 2019, 11:39am UTC](https://travis-ci.community/t/python-package-data-files-not-installed-in-travis-virtual-environment/5330/1 "2019-10-06T11:39:14Z")

</div>

I have a Python package that contains some data files (`.pyi` stub files). They are listed in `package_data` and the `MANIFEST.in` file. When I `pip install` the package on a Linux server, the files are included in the package under `.../site-packages/my-package/path/to/file.pyi`, as expected.

However, when Travis installs the package as a dependency (`pip install [.develop]` in a dependent package), these files are _not_ installed; that is, `.../site-packages/my-package` does not contain the `.pyi` files. This means running `mypy` on the dependent package fails, which breaks the build.

Is there something special about the `pip install` in the virtual environment created by Travis, and what do I need to do to get it to include the `package_data` files?

---

<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:** [October 6, 2019, 2:58pm UTC](https://travis-ci.community/t/python-package-data-files-not-installed-in-travis-virtual-environment/5330/2 "2019-10-06T14:58:32Z")

</div>

There’s nothing special about Travis’ virtualenv except the fact that it’s not recreated each time but restored from a prebuilt tarball.

I suspect either an old version of `pip` or `setuptools` that don’t understand the metadata, or something different in the installation process (e.g. [`setup.py develop` is very different under the hood from `pip install`](https://stackoverflow.com/questions/56979756/get-file-path-during-pip-install-in-setup-py/56980174#56980174)).

Without seeing the build, can’t say any more so please include a link to it in any further inquiries.

---

<div class="post-metadata">

**Author:** ![orenbenkiki](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/orenbenkiki/32/2841_2.png) [@orenbenkiki](https://travis-ci.community/u/orenbenkiki)\
**Post date:** [October 6, 2019, 3:20pm UTC](https://travis-ci.community/t/python-package-data-files-not-installed-in-travis-virtual-environment/5330/3 "2019-10-06T15:20:41Z")

</div>

Here’s a link to a failing build with debug prints in the dependent crate `setup.py`, which shows the `poor_stubs` files are do not exist in the `tgutils` package. These stubs are installed properly when I `pip install tgutils` on my servers…

Thanks!

Edit: The actual [link](https://travis-ci.org/tanaylab/metacell.py/jobs/594175639).

---

<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:** [October 6, 2019, 4:02pm UTC](https://travis-ci.community/t/python-package-data-files-not-installed-in-travis-virtual-environment/5330/4 "2019-10-06T16:02:35Z")

</div>

Running `pip install tgutils` in a Bionic VM, I don’t see anything named “`poor_stubs`”, either:

> ```
> venv/lib/python3.6/site-packages/tgutils:
> total 84
> -rw-r--r-- 1 vmuser vmuser 8023 окт 6 18:53 application.py
> -rw-r--r-- 1 vmuser vmuser 1168 окт 6 18:53 cache.py
> -rw-r--r-- 1 vmuser vmuser 63 окт 6 18:53 __init__.py
> -rw-r--r-- 1 vmuser vmuser 3903 окт 6 18:53 load_yaml.py
> -rw-r--r-- 1 vmuser vmuser 3955 окт 6 18:53 make.py
> -rw-r--r-- 1 vmuser vmuser 9287 окт 6 18:53 numpy.py
> -rw-r--r-- 1 vmuser vmuser 12520 окт 6 18:53 pandas.py
> drwxr-xr-x 2 vmuser vmuser 4096 окт 6 18:53 __pycache__
> -rw-r--r-- 1 vmuser vmuser 0 окт 6 18:53 py.typed
> -rw-r--r-- 1 vmuser vmuser 345 окт 6 18:53 setup_mypy.py
> -rw-r--r-- 1 vmuser vmuser 1603 окт 6 18:53 tests.py
> -rw-r--r-- 1 vmuser vmuser 13468 окт 6 18:53 tg_qsub.py
> -rw-r--r-- 1 vmuser vmuser 64 окт 6 18:53 version.py
> 
> ```

Perhaps these files already exist at your server, or you run some additional commands to generate them.

---

<div class="post-metadata">

**Author:** ![orenbenkiki](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/orenbenkiki/32/2841_2.png) [@orenbenkiki](https://travis-ci.community/u/orenbenkiki)\
**Post date:** [October 6, 2019, 4:15pm UTC](https://travis-ci.community/t/python-package-data-files-not-installed-in-travis-virtual-environment/5330/5 "2019-10-06T16:15:09Z")

</div>

Hmmm, tried on another server - you are right. Strange…  
So it is nothing to do with Travis - I’ll figure it out.

Thanks!
