0

I've installed anaconda for spyder ide. But I had multiple problems.

runfile('C:/Users/Berk DOĞUŞ/Spyder Projects/DogrusalRegresyon.py', wdir='C:/Users/Berk DOĞUŞ/Spyder Projects') Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/Berk DOĞUŞ/Spyder Projects/DogrusalRegresyon.py', wdir='C:/Users/Berk DOĞUŞ/Spyder Projects')

File "C:\AConda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile execfile(filename, namespace)

File "C:\AConda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Berk DOĞUŞ/Spyder Projects/DogrusalRegresyon.py", line 13, in import pandas as pd

File "C:\Users\Berk DOĞUŞ\AppData\Roaming\Python\Python36\site-packages\pandas__init__.py", line 35, in "the C extensions first.".format(module))

ImportError: C extension: No module named 'pandas._libs.tslib' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.

I don't understand where I am making a mistake? I tried the answer here but it has led to a different issue:

runfile('C:/Users/Berk DOĞUŞ/Spyder Projects/DogrusalRegresyon.py', wdir='C:/Users/Berk DOĞUŞ/Spyder Projects') Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/Berk DOĞUŞ/Spyder Projects/DogrusalRegresyon.py', wdir='C:/Users/Berk DOĞUŞ/Spyder Projects')

File "C:\AConda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile execfile(filename, namespace)

File "C:\AConda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Berk DOĞUŞ/Spyder Projects/DogrusalRegresyon.py", line 12, in import pandas as pd

File "C:\AConda\lib\site-packages\pandas__init__.py", line 40, in import pandas.core.config_init

File "C:\AConda\lib\site-packages\pandas\core\config_init.py", line 12, in import pandas.core.config as cf

File "C:\AConda\lib\site-packages\pandas\core\config.py", line 57, in import pandas.compat as compat

AttributeError: module 'pandas' has no attribute 'compat'

Thanks for roganjosh. Just deleted the python.

There is another error like :

Berk Dogus
  • 11
  • 3
  • There's a couple of points [here](https://stackoverflow.com/questions/50089668/pandas-import-modulenotfounderror-no-module-named-pandas-libs-tslib) but I'm not sure it's conclusive. – roganjosh Aug 14 '18 at 10:31
  • Everything I can find seems to suggest just using `conda` to uninstall pandas and reinstalling it with `conda`. Did you already have a version of pandas installed? – roganjosh Aug 14 '18 at 10:36
  • I did where you conducted me at first comment. So the good news there is no error like above. The bad news is the new error has occurred :( – Berk Dogus Aug 14 '18 at 10:42
  • I'm not sure what you mean by "deleted the python"? You mean you used `conda` to uninstall and reinstall pandas? – roganjosh Aug 14 '18 at 10:52
  • No I mean i did like "My guess is the virtual env is not using anaconda, and the install of pandas is messed up (perhaps created before installing anaconda?). I would delete this directory C:\Users\ishan\AppData\Roaming\Python\Python36 and see if that helps" – Berk Dogus Aug 14 '18 at 10:53
  • Ok, so the next step I would say is to try what I put in my last comment and hope that fixes it – roganjosh Aug 14 '18 at 10:59
  • How can i use conda command? Ive tried couple of times but didnt worked. Can i do it with pip command? // conda worked by the way // – Berk Dogus Aug 14 '18 at 11:01
  • You should also have `Anaconda Prompt` installed – roganjosh Aug 14 '18 at 11:05
  • If you used anaconda only for spyder, you might aswell just install python and spyder. First DL the desired python version (I recommand latest 3.x version), and then open a console and use `py -3.x -m pip install spyder` – Mathieu Aug 14 '18 at 11:21
  • And last point, the special characters in your account name might pose an issue. – Mathieu Aug 14 '18 at 11:22

1 Answers1

1

Ok guys thanks for everything. Found the solution. First of all if you have python and Anaconda at same the time, delete the folder of python. Like Here

Then listen roganjosh's advice and uninstal-reinstall pandas lib using conda. Then turn of and turn on spyder. That's all. Problem solved.

Berk Dogus
  • 11
  • 3