# Py.test fails on Ubuntu 16.04

**URL:** <https://discourse.myhdl.org/t/py-test-fails-on-ubuntu-16-04/250>\
**Category:** Support\
**Created:** [February 8, 2018, 5:03am UTC](https://discourse.myhdl.org/t/py-test-fails-on-ubuntu-16-04/250 "2018-02-08T05:03:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![legendbb](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.myhdl.org/legendbb/32/81_2.png) [@legendbb](https://discourse.myhdl.org/u/legendbb)\
**Post date:** [February 8, 2018, 5:03am UTC](https://discourse.myhdl.org/t/py-test-fails-on-ubuntu-16-04/250/1 "2018-02-08T05:03:11Z")

</div>

myHDL 1.0 dev version has no issue on MacOSX with Python 2.7.10  
But on Ubuntu 16.04 with default python3.5.2; didn’t figure out how to run py.test of python 3.6.

py.test fails with error message:

myhdl.CosimulationError: Premature simulation end

```
/home/user/.local/lib/python3.5/site-packages/myhdl/_Cosimulation.py:104: CosimulationError

```

--------------------------------------- Captured stderr call ---------------------------------------  
Traceback (most recent call last):  
File “/home/user/Workspace/myHDL/myhdl/myhdl/test/core/test\_Cosimulation.py”, line 31, in   
from myhdl import Signal  
ImportError: No module named myhdl  
============================== 9 failed…

Please comment,

---

<div class="post-metadata">

**Author:** ![legendbb](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.myhdl.org/legendbb/32/81_2.png) [@legendbb](https://discourse.myhdl.org/u/legendbb)\
**Post date:** [February 9, 2018, 3:23am UTC](https://discourse.myhdl.org/t/py-test-fails-on-ubuntu-16-04/250/2 "2018-02-09T03:23:30Z")

</div>

Don’t know exact what was the issue, and walk around.  
I guess, myhdl core test had issue with 3.5.2, and my myhdl was not installed for python 2.7.12 so I didn’t following to make py.test working:  
# I have multiple versions of python in system 2.7.12; 3.5; 3.6  
sudo apt-get install python-pip  
# assume this installs pip to 2.7.12, which doesn’t have pip  
python -m pip install myhdl

When I rerun myhdl/test/core/py.test still see “platform linux – Python 3.5.2, pytest-3.4.0, py-1.5.2, pluggy-0.6.0” but, 308 passed in 13.29 seconds.

---

<div class="post-metadata">

**Author:** ![cfelton](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.myhdl.org/cfelton/32/3_2.png) [@cfelton](https://discourse.myhdl.org/u/cfelton)\
**Post date:** [February 10, 2018, 1:15am UTC](https://discourse.myhdl.org/t/py-test-fails-on-ubuntu-16-04/250/3 "2018-02-10T01:15:20Z")

</div>

That is odd, travis-ci seems to do ok with 3.6  
[https://travis-ci.org/myhdl/myhdl/builds/247387531?utm\_source=github\_status&utm\_medium=notification](https://travis-ci.org/myhdl/myhdl/builds/247387531?utm_source=github_status&utm_medium=notification)

That is an older run, maybe something changed in the latest version.

I run 3.6 and py.test everyday and have not run into an issue.
