Home > Software engineering >  pip install, How to fix ImportError
pip install, How to fix ImportError

Time:11-11

I'm having ImportError: cannot import name 'Literal' from 'typing' error message when I try to use pip install. Anyone can help?

CodePudding user response:

The problem is with the configuration of your environmental variables. The first thing, I'd suggest you do is uninstall all the unused versions of python. To my mind, the latest of python 3.x.x series is the best.

Steps:

The easiest way of accessing it is just to type environment variable in Windows 10 search bar. (Assuming you are using Windows 10)

enter image description here

Then follow these:

enter image description here

At the bottom half part of the subsequent window search for path:

enter image description here

If you double click that, look for python. Make sure you have such paths added there and you need to have a compatible version of python. Usually, your python bin directory is located in Program Files.

enter image description here

  • Related