I have uploaded a simple python package in https://test.pypi.org. When I download this with pip and try yo run I get FileNotFoundError: [Errno 2] File b'data/spam_collection.csv' does not exist: b'data/spam_collection.csv'
. Earlier I had issues with uploading the csv file when packaging. See my question in Could not upload csv file to test.pypi.org. Now after installing the package with pip I run pip show -f bigramspamclassifier
. I get the csv file listed. Therefore, I believe the file has been uploaded. I think the issue is with reading the file in my python file in the package. What should be the path to the csv file in SpamClassifier.py?
pip show -f bigramspamclassifier
Version: 0.0.3
Summary: A bigram approach for classifying Spam and Ham messages
Home-page: ######
Author: #####
Author-email: #######
Location: /home/kabilesh/PycharmProjects/TestPypl3/venv/lib/python3.6/site-packages
Requires: nltk, pandas
Required-by:
Files:
bigramspamclassifier-0.0.3.dist-info/INSTALLER
bigramspamclassifier-0.0.3.dist-info/LICENSE
bigramspamclassifier-0.0.3.dist-info/METADATA
bigramspamclassifier-0.0.3.dist-info/RECORD
bigramspamclassifier-0.0.3.dist-info/WHEEL
bigramspamclassifier-0.0.3.dist-info/top_level.txt
bigramspamclassifier/SpamClassifier.py
bigramspamclassifier/__init__.py
bigramspamclassifier/__pycache__/SpamClassifier.cpython-36.pyc
bigramspamclassifier/__pycache__/__init__.cpython-36.pyc
bigramspamclassifier/data/spam_collection.csv
My project file structure
Path to csv in SpamClassifier.py file #This what I want to know
def classify(self):
fullCorpus = pd.read_csv("data/spam_collection.csv", sep="\t", header=None)
fullCorpus.columns = ["lable", "body_text"]