问题遇到的现象和发生背景
pycharm安装在D盘无法安装第三方库
问题相关代码,请勿粘贴截图
在解释器中安装报错内容
尝试从系统终端运行此命令。确保使用为 'D:\python\python.exe' 处的 Python 解释器安装的正确版本的 'pip'。
Traceback (most recent call last):
File "D:\PyCharm\PyCharm 2021.1.1\plugins\python\helpers\packaging_tool.py", line 114, in main
do_install(pkgs)
File "D:\PyCharm\PyCharm 2021.1.1\plugins\python\helpers\packaging_tool.py", line 59, in do_install
run_pip(['install'] + pkgs)
File "D:\PyCharm\PyCharm 2021.1.1\plugins\python\helpers\packaging_tool.py", line 73, in run_pip
runpy.run_module(module_name, run_name='__main__', alter_sys=True)
File "D:\python\lib\runpy.py", line 206, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "D:\python\lib\runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "D:\python\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\python\lib\site-packages\pip\__main__.py", line 29, in <module>
from pip._internal.cli.main import main as _main
File "D:\python\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "D:\python\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "D:\python\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "D:\python\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 24, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "D:\python\lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "D:\python\lib\site-packages\pip\_internal\configuration.py", line 20, in <module>
from pip._internal.exceptions import (
File "D:\python\lib\site-packages\pip\_internal\exceptions.py", line 14, in <module>
from pip._vendor.rich.console import Console, ConsoleOptions, RenderResult
File "D:\python\lib\site-packages\pip\_vendor\rich\console.py", line 46, in <module>
from ._log_render import FormatTimeCallable, LogRender
File "D:\python\lib\site-packages\pip\_vendor\rich\_log_render.py", line 5, in <module>
from .text import Text, TextType
File "D:\python\lib\site-packages\pip\_vendor\rich\text.py", line 5, in <module>
from pip._vendor.rich.emoji import EmojiVariant
File "D:\python\lib\site-packages\pip\_vendor\rich\emoji.py", line 4, in <module>
from .jupyter import JupyterMixin
File "D:\python\lib\site-packages\pip\_vendor\rich\jupyter.py", line 4, in <module>
from .segment import Segment
File "D:\python\lib\site-packages\pip\_vendor\rich\segment.py", line 19, in <module>
from .cells import (
File "D:\python\lib\site-packages\pip\_vendor\rich\cells.py", line 6, in <module>
from ._lru_cache import LRUCache
File "D:\python\lib\site-packages\pip\_vendor\rich\_lru_cache.py", line 13, in <module>
class LRUCache(OrderedDict[CacheKey, CacheValue]):
TypeError: 'type' object is not subscriptable
运行结果及报错内容
在控制台上输入pip install 安装库出现的报错 :SyntaxError: invalid syntax
我的解答思路和尝试过的方法
在cmd中运行pip也是出现如上的报错代码,pip已经更新到最新版并且将pip 的安装目录添加到环境变量中
我想要达到的结果
能够正常使用pip