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安装的包或模块
基础教程推荐
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 包装空间模型 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
