2021年3月29日星期一

Error in Pycharm while importing packages

I am trying to run below code in Pycharm with Python 3.8.2 interpreter. I am running this code in VM Machine Win 10 on client network. I also checked File>Settings>Python Interpreter in project settings in Pycharm, it lists down all packages available which includes Pandas 1.2.0 version.

   import pandas as pd     pd.__version__  

It shows me below error for any package I try to import. Please help.

Error Code below:

C:\Users\rahulk\venv\pythonProject\Scripts\python.exe C:/Users/rahulk/pythonProject/Test1.py  Traceback (most recent call last):    File "c:/Users/rahulk/pythonProject/Test1.py", line 1, in <module>      import pandas as pd    File "P:\ABC_Repository\Python\Python38\pandas\__init__.py", line 29, in <module>      from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib    File "P:\ABC_Repository\Python\Python38\pandas\_libs\__init__.py", line 13, in <module>      from pandas._libs.interval import Interval    File "\pandas\_libs\_interval.pyx", line 1, in init pandas._libs.interval    File "\pandas\_libs\hashtable.pyx", line 1, in init pandas._libs.hashtable    File "\pandas\_libs\missing.pyx", line 1, in init pandas._libs.missing    File "P:\ABC_Repository\Python\Python38\pandas\_libs\tslibs\__init__.py", line 30, in <module>      from .conversion import OutofBoundsTimedelta, localize_pydatetime    File "\pandas\_libs\tslibs\conversion.pyx", line 1, in init pandas._libs.tslabs.conversion    File "\pandas\_libs\tslibs\timezones.pyx", line 16, in init pandas._libs.tslabs.timezones  AttributeError: module 'pytz'has no attribute 'utc'        Process finished with exit code 1  
https://stackoverflow.com/questions/66864216/error-in-pycharm-while-importing-packages March 30, 2021 at 11:00AM

没有评论:

发表评论