ImportError: attempted relative import with no known parent package

414 views
Skip to first unread message

Francisco Ebeling Barros

unread,
Jul 4, 2019, 4:37:32 PM7/4/19
to apmonitor
Hi,

I'm new both to Python and Gekkon, and I'm not getting past this error:

">>> from gekko import GEKKO
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    from gekko import GEKKO
  File "C:\Python\lib\site-packages\gekko\gekko.py", line 12, in <module>
    from .apm import cmd, get_file
ImportError: attempted relative import with no known parent package"

Can someone help?

Regards,
Francisco Ebeling

Francisco Ebeling Barros

unread,
Jul 4, 2019, 6:50:06 PM7/4/19
to apmonitor
I solved this error by repairing Python!

John Hedengren

unread,
Jul 6, 2019, 6:42:26 PM7/6/19
to APM Google Groups
Thanks for posting an update. I also get similar error if I call my script gekko.py and then try to import gekko. Changing the name to something besides gekko.py resolves that issue.

-John Hedengren

--
--
APMonitor user's group e-mail list.
- To post a message, send email to apmo...@googlegroups.com
- To unsubscribe, send email to apmonitor+...@googlegroups.com
- Visit this group at http://groups.google.com/group/apmonitor
---
You received this message because you are subscribed to the Google Groups "apmonitor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apmonitor+...@googlegroups.com.
To post to this group, send email to apmo...@googlegroups.com.
Visit this group at https://groups.google.com/group/apmonitor.
To view this discussion on the web visit https://groups.google.com/d/msgid/apmonitor/95c2fe16-b653-4f8a-9bcc-95a1b8a49fc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Best regards,

John Hedengren
APMonitor Optimization Suite
Reply all
Reply to author
Forward
0 new messages