“安装” pip 在 Pycharm 失败,但在 Jupyternotebook 工作。为什么?

发布于 2025-01-09 05:32:55 字数 854 浏览 1 评论 0原文

我只是 Python 的超级初学者。我正在寻求帮助。
我的目标是通过 Pycharm 安装“selenium”。 我尝试过这种方法:

pip install selenium

我的 Pycharm 能够识别“pip”,但不能识别“install”。
我尝试了多种方法来解决这个问题。

  • 使用Python3.9解释器(失败)
  • 使用Conda解释器(失败)
  • 重新安装pip(失败)
  • 安装selenium @ Jupyternotebook(工作)
  • 通过Pycharm解释器设置直接添加包(工作)

I some how figured it out through the two methods below, but I would like to make *'pip'* working on my Pycharm. And I think this is the problem of **path setting**, because *'pip install'* worked at Jupyternotebook. Does anybody have solution to this situation?
. Operating System : MacOS
Conda Path : /Users/****/opt/anaconda3/envs/pythonProject/bin/python
Python Path : /usr/local/bin/python3.9

I'm only super beginner using Python. And I'm looking for help.
My objective is to install 'selenium' through Pycharm.
I've tried this method:

pip install selenium

My Pycharm was able to recognize 'pip' but not 'install'.
I've tried several methods to solve this.

  • Using Python3.9 interpreter (failed)
  • Using Conda interpreter (failed)
  • re-installing pip (failed)
  • installing selenium @ Jupyternotebook (worked)
  • directly adding the package through Pycharm Interpreter settings (worked)

I some how figured it out through the two methods below, but I would like to make *'pip'* working on my Pycharm. And I think this is the problem of **path setting**, because *'pip install'* worked at Jupyternotebook. Does anybody have solution to this situation?
.

Operating System : MacOS

Conda Path : /Users/****/opt/anaconda3/envs/pythonProject/bin/python

Python Path : /usr/local/bin/python3.9

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喵星人汪星人 2025-01-16 05:32:55

您安装了多个 python,其中一个在 jupyter-notebook 内核中使用,一个在 pycharm 中使用,一个在 conda 环境中使用。您可以为所有这些 python 安装 pip。

您可以通过以下方式在 pycharm 设置中检查 pycharm python 解释器:PyCharm |偏好 |项目| Python 解释器。您还可以将 PyCharm 设置为使用 jupyter-notebook 正在使用的 python。 jupyter-notebook 内核可以通过以下方式查看:jupyter kernelspec list

You have multiple pythons installed, one that is being used in the jupyter-notebook kernel, one in pycharm, and one in the conda environment. You could install pip for all these pythons.

You can check you pycharm python interpreter in pycharm settings by following: PyCharm | Preferences | Project | Python Interpreter. And you can also set PyCharm to use the python that jupyter-notebook is using. jupyter-notebook kernels can be viewed via: jupyter kernelspec list

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文