Pycharm在windows上找不到用pip安装的包或模块 [英] Pycharm cann't find the packages or modules installed with pip on windows

查看:48
本文介绍了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安装的包或模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆