[1].If you can't install packages in PyCharm, it's likely due to the default Python version being either too new or too old. You just need to switch the System Interpreter to the second most recent version of Python.
Settings>Python Interpreter>Add Interpreter>Add Local Interpreter>System Interpreter
[2].Press 'Tab' to confirm the suggested content.
[3].pip.ini missing. Check whether the pip.ini file is available on this computer.
1 | pip config -v debug |
The red box in the above image indicates that the pip.ini file is missing. Before proceeding to add it, first determine the location of cacert.pem. In Python, type the following code to return the location of cacert.pem.
1 2 | import certifi print(certifi.where()) |
With the location of cacert.pem identified, continue by filling in the PATH=? in the following file with the location information you just obtained. Save this as pip.ini, and then copy this pip.ini to the four locations mentioned above where it is missing.
1 2 3 4 5 6 7 8 9 10 11 12 | [global] trusted-host = pypi.python.org pypi.org files.pythonhosted.org index-url = https://pypi.python.org/simple path = XXXXXXXX\certifi\cacert.pem [install] trusted-host = pypi.python.org pypi.org files.pythonhosted.org path = XXXXXXXX\certifi\cacert.pem |
No comments:
Post a Comment