我已经克隆了一个项目,因此当尝试在脚本中安装软件包时,尝试从pycharm安装时出现以下错误:
proposed solution:
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/home/yovel/PycharmProjects/Triangulation-Calculator/venv/bin/python'.
Error: Traceback (most recent call last):
File "/snap/pycharm-community/179/plugins/python-ce/helpers/packaging_tool.py", line 73, in run_pip
runpy.run_module(module_name, run_name='__main__', alter_sys=True)
File "/usr/lib/python3.8/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 95, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/pip/__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "/usr/lib/python3/dist-packages/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 18, in <module>
from pip._internal.models.format_control import FormatControl
File "/usr/lib/python3/dist-packages/pip/_internal/models/format_control.py", line 1, in <module>
from pip._vendor.packaging.utils import canonicalize_name
ModuleNotFoundError: No module named 'pip._vendor.packaging'
但是当我从终端运行它时,它会成功安装该软件包。
pip3 install pandas
...
Successfully installed pandas-1.0.1 python-dateutil-2.8.1 pytz-2019.3
我尝试更新venv和pip,但无法正常工作。
我应该提到它不是原始解释器,因为原始版本是python 3.6。