I have an anaconda install for Python. When I fire up python and attempt to import packages this happens.

Python 3.7.6 (default, Jan  8 2020, 13:42:34) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import pandas as pd
Error: You must specify two command line arguments

This information might be useful

(base) MAC:Fri Feb 14:09:32:~> python --version
Python 3.7.6
(base) MAC:Fri Feb 14:09:32:~> conda --version
conda 4.8.2
(base) MAC:Fri Feb 14:09:32:~> 

Has anyone else seen this?

  • Do you have a file in your current directory named pandas.py? That would mask the real module. – jordanm Feb 14 at 16:01
  • I ran find and can only find pandas.py in the anaconda subtree. – ncmathsadist Feb 14 at 18:37
  • @jordanm Thanks; see my answer below. This is an ugly cautionary tale. – ncmathsadist Feb 14 at 19:50

This is what happened. IN my home directory I had a program named copy.py, which was an example I use for teaching fileIO; it copies a file. It takes two command-line arguments and errors out if the user fails to supply them.

Evidently, there is a module named copy that pandas uses. My copy.py got seen prior to the system's and it created this mess.

Thanks, @jordanm, you provided the hint that helped me to see this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.