I have looked at other answers such as conda install future
and others but none seem to solve this error. Everything was working till yesterday but today when I am trying to run my script I get this error.
I initially thought that I had multiple pandas packages from pip and conda so I uninstalled from both and then installed via conda again. But the error still persists.
I have installed python 3.6 as a separate environment in anaconda 2.
Traceback (most recent call last):
File "/Users/amit/anaconda2/envs/python36/lib/python3.6/site-packages/pandas/compat/__init__.py", line 49, in <module>
import __builtin__ as builtins
ModuleNotFoundError: No module named '__builtin__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 18, in <module>
from nameserver import NameServer
File "/Users/amit/Work/ml/marl/nameserver.py", line 4, in <module>
import pandas as pd
File "/Users/amit/anaconda2/envs/python36/lib/python3.6/site-packages/pandas/__init__.py", line 23, in <module>
from pandas.compat.numpy import *
File "/Users/amit/anaconda2/envs/python36/lib/python3.6/site-packages/pandas/compat/__init__.py", line 62, in <module>
import http.client as httplib
ModuleNotFoundError: No module named 'http.client'
=============
EDIT 1
Following @EvgenyPogrebnyak's advice I created a new env named py36
. I tried running the print statement python -c "import pandas as pd; print(pd.__version__)"
statement from the home directory or infact any other directory it runs fine but when I run it from my project directory I get this particular error, which is weird.
amit:~ $source activate py36
(py36) amit:~ $python -c "import pandas as pd; print(pd.__version__)"
0.23.0
(py36) amit:~ $cd Work/ml/marl/
(py36) amit:~/Work/ml/marl $python -c "import pandas as pd; print(pd.__version__)"
Traceback (most recent call last):
File "/Users/amit/anaconda2/envs/py36/lib/python3.6/site-packages/pandas/compat/__init__.py", line 49, in <module>
import __builtin__ as builtins
ModuleNotFoundError: No module named '__builtin__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/amit/anaconda2/envs/py36/lib/python3.6/site-packages/pandas/__init__.py", line 23, in <module>
from pandas.compat.numpy import *
File "/Users/amit/anaconda2/envs/py36/lib/python3.6/site-packages/pandas/compat/__init__.py", line 62, in <module>
import http.client as httplib
ModuleNotFoundError: No module named 'http.client'