I am struggling with the first basic PVLib tutorial where I simply import Locations:
from pvlib.location import Location
# Rome, Italy data
latitude = 41.9
longitude = 12.5
tz = 'Europe/Rome'
altitude = 27
name = 'Rome'
location = Location(latitude, longitude, tz, altitude, name)
print(location)
This is the Output with the error if I try to run the code in Pycharm (otherwise in Jupyter Notebook it works properly):
*C:\Users\ASUS\AppData\Local\Microsoft\WindowsApps\python3.10.exe C:\Users\ASUS\PycharmProjects\RenewableEnergyModelling\PVLib01_ModelChain&Location.py Traceback (most recent call last): File "C:\Users\ASUS\PycharmProjects\RenewableEnergyModelling\PVLib01_ModelChain&Location.py", line 1, in from pvlib.location import Location File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pvlib_init_.py", line 3, in from pvlib import ( # noqa: F401 File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pvlib\atmosphere.py", line 342, in )(pvlib.spectrum.spectral_factor_firstsolar) AttributeError: partially initialized module 'pvlib' has no attribute 'spectrum' (most likely due to a circular import)
Process finished with exit code 1*
I enquired about this type of error and tried to solve it myself, but could not get a result. There seems to be nothing like this on the internet.