4

After upgrading to pip 10.0.1, I can't install any new packages in Visual Studio 2017.

----- Installing 'beautifulsoup4==4.6.0' -----
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'main'
----- Failed to install 'beautifulsoup4==4.6.0' -----

Or

----- Installing 'matplotlib==2.2.2' -----
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'main'
----- Failed to install 'matplotlib==2.2.2' -----

Or

----- Installing 'requests-auth==1.0.2' -----
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'main'
----- Failed to install 'requests-auth==1.0.2' -----
Suzanne
  • 582
  • 2
  • 11
  • 31
  • 5
    This question is specifically about installing python modules within Visual Studio using the menu option "Install python package...". This is not a duplicate question, especially because any solution found in the other threads will not be implementable here. (VS is running some pip command in the background, and user cannot modify it) – cowlinator Jun 19 '18 at 21:19
  • 4
    I just ran into the exact same thing. Updating Pip via Visual Studio's Python Environment manager breaks the ability to update/install packages. A temporary solution is to manually rollback pip to version 9.0.3. The default installation directory for 64bit Python is C:\Python27amd64. Go there and type: C:\Python27amd64\python.exe -m pip install --upgrade pip==9.0.3 This will at least allow you to install new packages. Just completely ignore the update to pip 10+ until someone at Microsoft has fixed this. Oh and send them a bug report so they actually know about it. :-P – Nathilion Jun 21 '18 at 12:06
  • I have this question with IronPython in VS, and even I downgraded the pip, the problem is still here. Any updates on this? – user6539552 Jul 01 '18 at 07:03
  • @Nathilion, I tried your suggestion, but I got "index out of range: -1" error. I failed to do even downgrade of pip. – user6539552 Jul 01 '18 at 08:31
  • @user6539552 Ai, the quickest solution I can think of then is to clean out the Python installation and then reinstall it. First take note of the Python installation directory (my 64bit can be found at C:\Python27amd64). Then uninstall the module using the Visual Studio Installer. Next up: wipe any remaining trace of the Python folder and any bits left in the registry. And lastly reinstall the module. While typing this I just thought of something else that might work: you could manually remove pip from the folder and then start a repair install from VS installer. – Nathilion Jul 02 '18 at 09:44
  • @Nathilion, it works for me on Python installation, but not IronPython installation. I'd like to use IronPython and hence, install the related libraries os that IronPython can use. Any suggestion on it? Also, as you suggested, how to "manually" remove pip from the folder and install from VS installer? – user6539552 Jul 05 '18 at 06:24

0 Answers0