title: I have a Python code by a multimeter manufacturer, that builds a data frame during the code duration to save voltage measurements. But I have errors
body: <p>I have imported the libraries, connected the multimeter, but I encounter an error related to a writer function</p>
  <pre><code># =============================================================================
  # VISA SETUP
  # =============================================================================
  import pyvisa as visa
  
  rm = visa.ResourceManager()
  rList = rm.list_resources()
  
  my_instrument = rm.open_resource(rList[0])
  idn_info = (my_instrument.query('*IDN?'))
  
  print(idn_info)
  # =============================================================================
  # ============================================================================
  
  import time
  import matplotlib.pyplot as plt
  import pandas as pd 
  
  DMM = my_instrument
  
  #set parameters here:
  xInc = 15       #number of seconds between samples
  samples = 50    #number of samples you want overall
  updateInc = 30  #how often the program reminds you it's running (in seconds)
  
  xValues = []
  yValues = []
  for i in range(samples):
      if (i*xInc) % updateInc == 0:
          print(&quot;Acquiring data...&quot;)
      time.sleep(xInc)
      xValues.append(i * xInc)
      yValues.append(float(DMM.query(':MEASure:VOLTage:DC?')))
  
  #create simple reference plot
  print(&quot;Plotting...&quot;)
  xLabel = &quot;Time (s)&quot;
  yLabel = &quot;Voltage (V)&quot;
  plt.xlabel(xLabel) 
  plt.ylabel(yLabel) 
  plt.title('DM3058E Monitoring') 
  plt.plot(xValues, yValues)
  
  #export to CSV in current directory 
  print(&quot;Exporting to CSV...&quot;)
  df = pd.DataFrame({xLabel:xValues, yLabel:yValues})
  df.to_csv('DM3058_Monitoring.csv') 
  
  print(&quot;Done!&quot;)
  </code></pre>
  <p>This is the code I receive:</p>
  <p>Traceback (most recent call last):
  File &quot;C:\Users\rrashid\Desktop\py\QR_code\multimeter.py&quot;, line 4, in 
  import pyvisa as visa
  File &quot;C:\Users\rrashid\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyvisa_<em>init</em>_.py&quot;, line 14, in 
  from importlib.metadata import version, PackageNotFoundError
  File &quot;C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\importlib\metadata_<em>init</em>_.py&quot;, line 4, in 
  import csv
  File &quot;C:\Users\rrashid\Desktop\py\QR_code\csv.py&quot;, line 4, in 
  writer = csv.writer(file)
  AttributeError: partially initialized module 'csv' has no attribute 'writer' (most likely due to a circular import)
  PS C:\Users\rrashid\Desktop\py\QR_code&gt;</p>