XML TO CSV Converter

Asked by At

I was trying to convert the xml files to csv file I had this error

python xml_to_csv.py Traceback (most recent call last): File "xml_to_csv.py", line 3, in <module> import pandas as pd File "C:\Users\MHD\Anaconda3\envs\tf_15\lib\site-packages\pandas\__init__.py", line 23, in <module> from pandas.compat.numpy import * File "C:\Users\MHD\Anaconda3\envs\tf_15\lib\site-packages\pandas\compat\numpy\__init__.py", line 10, in <module> _np_version = np.__version__ AttributeError: module 'numpy' has no attribute '__version__'

any help will be appreciated


1 Answers

RockAndRoleCoder On Best Solutions

You'll need to post your code. But from the looks of the error, you're having an import issue. Please make sure you have Pandas and Numpy installed. Secondly to import them you would put:

import pandas as pd
import numpy as np

Where the pd and np are the alias names so you can use them as a shortcut. If you don't have numpy /pandas installed or you aren't sure, you can use: pip install pandas
pip install numpy

Also fyi, it looks like you have anaconda. Which should have come with those libraries already. But if it doesn't, you should try:

conda install pandas
conda install numpy