0

After upgrading pip, i can't install any other packages(e.g:pip install pandas). Always it is showing ImportError:cannot import name 'main' Am using windows 7 and I don't have administrator access

I already tried below steps but nothing worked.

python -m pip uninstall pip
python -m pip install pip==9.0.3

getting error msg as 'no module named pip.main; pip is a package and cannot be directly executed

CodeIt
  • 3,492
  • 3
  • 26
  • 37
Guruprakash
  • 13
  • 1
  • 5
  • 2
    Possible duplicate of [Error after upgrading pip: cannot import name 'main'](https://stackoverflow.com/questions/49836676/error-after-upgrading-pip-cannot-import-name-main) – Vaibhav Vishal Jul 19 '19 at 05:32

1 Answers1

0

Alternate solution to fix your problem.

Download this python file and run the below command.

python get-pip.py

After that, run

python -m pip install --user pandas

--user makes pip install packages without any admin privileges.

CodeIt
  • 3,492
  • 3
  • 26
  • 37
  • when using these commands am getting error as python get-pip.py > Permission Error :[Errno:13] Permission denied. python get-pip.py--user > FilenotFoundError: [Errno 2] No such file or directory – Guruprakash Jul 24 '19 at 04:59
  • @Guruprakash You need to download this [file](https://bootstrap.pypa.io/get-pip.py), make sure you save it as `get-pip.py`. Once it is downloaded, open *terminal* from that folder and run `python get-pip.py`. – CodeIt Jul 24 '19 at 05:19
  • Thanks for the reply. I have tried from the folder but getting error message (after msg: Installing collected packages:pip,wheel) as "FilenotFoundError: [Errno 2] No such file or directory – 'C:\\Users\\xyz\\AppData\\Roaming\\Python\\Python36\\site-packages\\pip\\_vendor\\distlib\\t32.exe". – Guruprakash Jul 24 '19 at 10:42
  • @Guruprakash You need to uninstall pip first the install using the downloaded file. – CodeIt Jul 24 '19 at 10:56
  • uninstalling pip showing this error "Import Error: cannot import "pkg_resources". I tried "pip uninstall pip" and "pip uninstall pip --user" – Guruprakash Jul 26 '19 at 06:11
  • You can try an alternate method to install pandas only. Download the `.whl` file for pandas. For [32 bit](https://files.pythonhosted.org/packages/52/4f/af4649ffd5082a3d6b6bf27b1508185e7dc2643c7f046fd3956b37c1a08f/pandas-0.25.0-cp36-cp36m-win32.whl) or for [64 bit](https://files.pythonhosted.org/packages/6e/f6/7c5053cd6cae3ae099f4f950b9a5b4cb881432febdf2184f4b2d2d6de357/pandas-0.25.0-cp36-cp36m-win_amd64.whl) and Open `cmd` from the download folder then run `pip install pandas-0.25.0-cp36-cp36m.xxxxx.whl` `<<<` Replace with correct file name. – CodeIt Jul 26 '19 at 06:22