Unable to import packages
elenaparaschiv opened this issue · 2 comments
elenaparaschiv commented
I completed the steps in readme. When I try running any of the files I get import errors.
For example at quickstart.py on the import line 1 :
from google.analytics.data_v1beta import BetaAnalyticsDataClient
returns the following error
“AttributeError: module 'google.analytics' has no attribute 'data_v1beta'”
In terminal I tried executing :
$ python
>>> import google
>>> google.analytics
<module 'google.analytics' (namespace)>
>>> google.analytics.data_v1beta
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'google.analytics' has no attribute 'data_v1beta'
busunkim96 commented
Hi @elenaparaschiv,
I'm not able to reproduce the issue - the import works as expected for me. Could you try following these steps?
- Create virtualenv.
python3 -m venv env
source env/bin/activate
- Install
google-analytics-data
.
pip install google-analytics-data
- Run code.
(env) busunkim@busunkim:~/bugs$ python3
Python 3.9.9 (main, Jan 12 2022, 16:10:51)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.analytics.data_v1beta import BetaAnalyticsDataClient
>>> client = BetaAnalyticsDataClient()
suztomo commented
Closing for obsolete and not-reproducible.