Pycharm cann#39;t find the packages or modules installed with pip on windows(Pycharm在windows上找不到用pip安装的包或模块)
问题描述
虽然我在环境变量中添加了路径,但 Pycharm 不与 pip 包同步.以下元素将清除主题:
Pycharm doesn't sync with the pip packages though i have added the path in environment variable.
The following elements will clear the topic:
已经安装了 sklearn 包:
pycharm 找不到那个包:
环境变量:
推荐答案
问题是 pycharm 在虚拟环境中创建您的所有项目.因此,您在虚拟环境之外安装的包(全局站点包)不会被继承到您的项目中.有一个简单的解决方案.当您创建一个 pycharm 项目时,请确保选中 继承全局站点包" 复选框,如此处所示.然后您将能够将所有包导入您的虚拟环境,前提是它们已安装在您的计算机中.
The thing is that pycharm creates all of your projects inside a virtual environment. So the packages that you installed outside the virtual environment(global site packages) does not get inherited in to your project. There is a simple solution for that. When you create a pycharm project, make sure to check the "inherit global-site packages" checkbox as shown here.Then you'll be able to import all the packages to your virtual environment, provided they have been installed in your computer.
您也可以使用pip install"单独安装所有软件包.在 pycharm 终端.如果包已经安装在虚拟环境之外,pip 会使用缓存文件而不是重新下载包.
Alternatively you can install all the packages separately using "pip install" in the pycharm terminal. If the package has been installed outside the virtual environment, pip will use cached files instead of downloading the package again.
或者您可以使用 Settings -> 安装软件包.项目->正如其他答案所暗示的那样,项目解释器.
这篇关于Pycharm在windows上找不到用pip安装的包或模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Pycharm在windows上找不到用pip安装的包或模块


基础教程推荐
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 筛选NumPy数组 2022-01-01