I have done research but I am not able to find a clear solution... How to import 3rd party package if I have a package with the same name?
Example:
Project tree looks like this:
├── Pipfile
├── Pipfile.lock
├── analytics
│ ├── __init__.py
│ └── client.py
└── main.py
Content of analytics/client.py is simple:
def identify():
print("local analytics")
analytics/init.py is one-liner:
from .client import identify
main.py
import analytics
analytics.identify();
If I run python main.py
it will write local analytics to the output. It's ok.
However, If I install 3rd party package with name analytics, e.g.
pipenv install analytics-python
(https://segment.com/docs/sources/server/python/)
and run python main.py
, it will write local analytics to the output again.
How to run code from 3rd party package?