No module named 'pandas.compat' - python

I am getting the following error when I run any python program that uses panda
Traceback (most recent call last):
File "filter_SNV_SV.py", line 3, in <module>
import pandas as pd
File "/users/<userid>/.local/lib/python3.8/site-packages/pandas/__init__.py", line 22, in <module>
from pandas.compat import (
ModuleNotFoundError: No module named 'pandas.compat'
I can understand that the error is because it is searching for panda at .local/lib, but when I check the which python, it gives me following
/users/<userid>/anaconda3/bin/python
and
python3 -m pip freeze | grep -i pandas
pandas==1.3.3
pandas-compat==0.1.1
I am running it on CentOS 6 cluster. Can anyone suggest what should I do about this?

It worked fine after I renamed /users/<userid>/.local/lib/python3.8 to /users/<userid>/.local/lib/py3.8

Related

Unable to import pandas in Linux environment

In Linux Environment I have installed pandas using "pip install pandas"
but when I'm running python and using import pandas for that I'm getting such error
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pandas
Is there anyways which automatically installs pandas library as a part of code in Linux environment

my python console always gives me error when i try to import pandas

enter image description here
import pandas as pd
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'pandas'
You first need to install pandas!
Open your command prompt and type this:
pip install pandas
That should work!

ModuleNotFoundError: No module named 'future'

I have a Python script that I am trying to run in Linux via a bash script called ./launch.sh. When I launch the code I get the following error returned.
[user#localhost mktdata.out]$ ./launch.sh
[user#localhost mktdata.out]$ Traceback (most recent call last):
File "strats/merlin.py", line 10, in <module>
File "strats/merlin/mktdata.py", line 11, in <module>
File "strats/dao/utils/itertools.py", line 1, in <module>
ModuleNotFoundError: No module named 'future'
Line 1 in the Python script itertools.py line 1 that the error is referring to is:
from future.moves.itertools import zip_longest
Is there a package that I need to install in order for this code to work?
You need to import future like this:
from __future__ import *
In the event that fails, use pip to install it like this (Use sudo for MAC):
pip install future
Here is more on installing future.

Quandl import error in Python 3

I'm using Python 3.6.3 on Windows 10 and Quandl module in my pip list, but I get the following error:
import quandl
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import quandl
File "C:\Users\Kamal\AppData\Local\Programs\Python\Python36-32\lib\quandl\__init__.py", line 3, in <module>
from .api_config import ApiConfig
ModuleNotFoundError: No module named 'quandl.api_config'
Try pip3 install quandl. If you have python2 installed, there may be a mismatch in symlinks related to pip.

ImportError while running python program

I have tried all the import methods and upgrading the libraries but still I'm unable to get over this error. I have downloaded and installed all the nltk and corpus data programmatically and it is working in the python shell but i'm getting error.
Traceback (most recent call last):
File "spark.py", line 7, in <module>
from textblob_aptagger import PerceptronTagger
File "/usr/local/lib/python2.7/dist-packages/textblob_aptagger/__init__.py", line 8, in <module>
from textblob_aptagger.taggers import PerceptronTagger
File "/usr/local/lib/python2.7/dist-packages/textblob_aptagger/taggers.py", line 10, in <module>
from textblob.packages import nltk
ImportError: No module named packages
Here's a pastebin to my code and imports..
Same error has been posted on github here. Use this instead to install textblob:
$ pip install -U git+https://github.com/sloria/textblob-aptagger.git#dev
Also, you should change from text.blob import TextBlob as tbto from textblob...
Works for me..

Categories