Noelle
Noelle

Reputation: 1

Error trying to " import epipy " or " from epipy import * " in python (using pycharm IDE)

Python throwing an error when I try to import epipy even though I installed the package to the project interpreter (python file's interpreter is also set to same environment)

My code:

import pandas as pd

import epipy

I expect to import installed packages with no errors, received error below:

/Users/Noelle/Python/stats/bin/python /Users/Noelle/Python/stats/basic_analytics.py
Traceback (most recent call last):
  File "/Users/Noelle/Python/stats/basic_analytics.py", line 2, in <module>
    import epipy
  File "/Users/Noelle/Python/stats/lib/python3.6/site-packages/epipy/__init__.py", line 5, in <module>
    from .analyses import generation_analysis, reproduction_number, create_2x2
  File "/Users/Noelle/Python/stats/lib/python3.6/site-packages/epipy/analyses.py", line 88
    print 'Summary of reproduction numbers'
                                          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Summary of reproduction numbers')?

Process finished with exit code 1

Upvotes: 0

Views: 149

Answers (2)

Ross
Ross

Reputation: 21

That error is because print is being called:

print'Summary of reproduction numbers'

Instead of:

print('Summary of reproduction numbers')

Python 3 print syntax is different from python 2

EDIT: Seems this is because the epipy package you installed is for python 2 and not python 3

Upvotes: 0

G. Anderson
G. Anderson

Reputation: 5955

Did you install from pip or directly from github? According to this post, the pip version is only compatible with python 2, for py3.x you have to download the github version directly

Upvotes: 2

Related Questions